21 for (;
types[ct]; ct++) {
58 return !checksum ?
true :
false;
74 while (ct < lname->nb_elem) {
96 while ((
int)tmp_size < (
int)(
record->size - 1)) {
99 next =
buf[3 + tmp_size] + 1;
117 char cb =
buf[3 + tmp_size];
123 if (
record->size + 3 < tmp_size +
cb) {
154 off_add =
buf[3] & 0xe ? 0 : 3;
157 if (
record->size < 5 + off_add) {
168 if (
record->size < 3 + off_add) {
179 ret->
bits = (
buf[3] & 1) ? 32 : 16;
189 while (ct < total_size - 1) {
190 ct +=
buf[ct] + 1 + (
bits == 32 ? 4 : 2);
191 if (ct > total_size - 1) {
194 if (
buf[ct] & 0x80) {
212 if (
record->size - 1 < ct - 2) {
219 if (ct + 1 + str_size + 4 - 3 >
record->size) {
225 if (ct + 1 + str_size + 2 - 3 >
record->size) {
237 symbol->
name[str_size] = 0;
240 ct += 1 + str_size + (
bits == 32 ? 4 : 2);
244 if (
buf[ct] & 0x80) {
267 if (
buf[ct] & 0x80) {
273 if (
record->size < ct - 2) {
280 if (
buf[ct] & 0x80) {
286 if (!base_grp && !seg_idx) {
289 if (
record->size < ct - 2) {
299 if (!(
record->type & 1)) {
337 if (seg_idx & 0xff00) {
357 ret->
paddr = global_ct + ct;
487 while (++ct_rec < lname->nb_elem) {
488 if (!((
char **)lname->
elems)[ct_rec]) {
490 }
else if (!(obj->
names[ct_obj++] =
strdup(((
char **)lname->
elems)[ct_rec]))) {
528 while (++ct_rec < symbols->nb_elem) {
547 RZ_LOG_ERROR(
"Invalid Ledata record (bad segment index)\n");
551 if (os && (tmp_data = os->
data)) {
552 while (tmp_data->
next) {
553 tmp_data = tmp_data->
next;
601 while (ct_rec < datas->nb_elem) {
632 while (ct < obj->nb_section) {
646 while (ct < obj->nb_symbol) {
658 while (ct < obj->nb_name) {
709 while (ct_sym < obj->nb_symbol) {
710 if (!strcmp(obj->
symbols[ct_sym]->
name,
"_start")) {
712 RZ_LOG_ERROR(
"Invalid segment index for symbol _start\n");
738 while (ct_sec < obj->nb_section) {
763 new->size = data->
size;
764 new->vsize = data->
size;
765 new->paddr = data->
paddr;
RzList * symbols(RzBinFile *bf)
int bits(struct state *s, int need)
RZ_API void Ht_() free(HtName_(Ht) *ht)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
static void list(RzEgg *egg)
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
while(len< limit &&buf1[len]==buf2[len])++len
static const struct names names[]
bool rz_bin_omf_get_entry(rz_bin_omf_obj *obj, RzBinAddr *addr)
static int load_omf_segdef(OMF_record *record, const ut8 *buf, ut64 buf_size)
static bool is_valid_omf_type(ut8 type)
static ut16 omf_get_idx(const ut8 *buf, int buf_size)
ut64 rz_bin_omf_get_vaddr_sym(rz_bin_omf_obj *obj, OMF_symbol *sym)
int rz_bin_omf_send_sections(RzList *list, OMF_segment *section, rz_bin_omf_obj *obj)
static int load_omf_data(const ut8 *buf, int buf_size, OMF_record *record, ut64 global_ct)
void rz_bin_free_all_omf_obj(rz_bin_omf_obj *obj)
static int get_omf_data_info(rz_bin_omf_obj *obj)
static int load_omf_content(OMF_record *record, const ut8 *buf, ut64 global_ct, ut64 buf_size)
static int cpy_omf_names(rz_bin_omf_obj *obj)
static void get_omf_section_info(rz_bin_omf_obj *obj)
static void free_all_omf_names(rz_bin_omf_obj *obj)
static void free_lname(OMF_multi_datas *lname)
static ut32 count_omf_record_type(rz_bin_omf_obj *obj, ut8 type)
static bool load_omf_lnames(OMF_record *record, const ut8 *buf, ut64 buf_size)
static int load_all_omf_records(rz_bin_omf_obj *obj, const ut8 *buf, ut64 size)
static void free_all_omf_records(rz_bin_omf_obj *obj)
static int load_omf_pubdef(OMF_record *record, const ut8 *buf, int buf_size)
int rz_bin_omf_get_bits(rz_bin_omf_obj *obj)
static void free_pubdef(OMF_multi_datas *datas)
static ut32 count_omf_multi_record_type(rz_bin_omf_obj *obj, ut8 type)
static int load_omf_symb(OMF_record *record, ut32 ct, const ut8 *buf, int buf_size, int bits, ut16 seg_idx)
bool rz_bin_checksum_omf_ok(const ut8 *buf, ut64 buf_size)
static void free_all_omf_sections(rz_bin_omf_obj *obj)
static void free_all_omf_symbols(rz_bin_omf_obj *obj)
static ut32 omf_count_symb(ut16 total_size, ut32 ct, const ut8 *buf, int bits)
ut64 rz_bin_omf_get_paddr_sym(rz_bin_omf_obj *obj, OMF_symbol *sym)
static OMF_record_handler * get_next_omf_record_type(OMF_record_handler *tmp, ut8 type)
static int get_omf_infos(rz_bin_omf_obj *obj)
rz_bin_omf_obj * rz_bin_internal_omf_load(const ut8 *buf, ut64 size)
static OMF_record_handler * load_record_omf(const ut8 *buf, ut64 global_ct, ut64 buf_size)
static int get_omf_symbol_info(rz_bin_omf_obj *obj)
insn_type_descr_t types[]
static ut16 rz_read_le16(const void *src)
static ut32 rz_read_le32(const void *src)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
OMF_record_handler * records
ut64(WINAPI *w32_GetEnabledXStateFeatures)()