Exemplo n.º 1
0
R_API void r_anal_state_insert_bb(RAnalState* state, RAnalBlock *bb) {
	if (!state || !bb) {
		return;
	}
	if (!r_anal_state_search_bb (state, bb->addr) && state->current_fcn) {
		r_list_append (state->current_fcn->bbs, bb);
        state->bytes_consumed += state->current_bb->op_sz;
		if (!r_hashtable64_insert(state->ht, bb->addr, bb)) {
			eprintf ("Inserted bb 0x%04"PFMT64x" failure\n", bb->addr);
		}
	}
}
Exemplo n.º 2
0
R_API void r_anal_state_insert_bb(RAnalState* state, RAnalBlock *bb) {
	if (!state || !bb) {
		return;
	}
	if (!r_anal_state_search_bb (state, bb->addr) && state->current_fcn) {
		r_list_append (state->current_fcn->bbs, bb);
        state->bytes_consumed += state->current_bb->op_sz;
		const char *key = sdb_fmt (0, "0x%08"PFMT64x, bb->addr);
		if (!ht_insert (state->ht, key, bb)) {
			eprintf ("Inserted bb 0x%04"PFMT64x" failure\n", bb->addr);
		}
	}
}
Exemplo n.º 3
0
R_API void r_anal_state_insert_bb (RAnalState* state, RAnalBlock *bb) {
	if (!state || !bb)
		return;
	if (r_anal_state_search_bb (state, bb->addr) == NULL &&
		state->current_fcn) {
		RAnalBlock *tmp_bb;
		IFDBG eprintf ("Inserting bb 0x%04"PFMT64x" into hash table\n", bb->addr);
		r_list_append(state->current_fcn->bbs, bb);
        state->bytes_consumed += state->current_bb->op_sz;
		IFDBG eprintf ("[--] Consumed 0x%02x bytes, for a total of 0x%02x\n", (short )state->current_bb->op_sz, (short) state->bytes_consumed);
		if (r_hashtable64_insert(state->ht, bb->addr, bb)) {
			IFDBG eprintf ("Inserted bb 0x%04"PFMT64x" successfully inserted into hashtable\n", bb->addr);
		}
		IFDBG {
			tmp_bb = r_hashtable64_lookup(state->ht, bb->addr);
			IFDBG eprintf ("Inserted bb 0x%04"PFMT64x" matches one in hash table: %02x.\n", bb->addr, bb->addr == tmp_bb->addr);
		}
	}