7 switch (
bin->ne_header->targOS) {
13 return "European MS-DOS 4.x";
17 return "BOSS (Borland Operating System Services)";
87 for (
i = 0;
i <
bin->ne_header->SegCount;
i++) {
104 bin->segments = segments;
123 ut16 off =
bin->ne_header->ResidNamTable +
bin->header_offset;
129 bool resident =
true, first =
true;
139 off =
bin->ne_header->OffStartNonResTab;
186 rz_list_foreach (
entries, it, en) {
226 typeName =
"FONTDIR";
232 typeName =
"ACCELERATOR";
238 typeName =
"MESSAGETABLE";
241 typeName =
"GROUP_CURSOR";
244 typeName =
"GROUP_ICON";
247 typeName =
"NAMETABLE";
250 typeName =
"VERSION";
253 typeName =
"DLGINCLUDE";
256 typeName =
"PLUGPLAY";
262 typeName =
"ANICURSOR";
265 typeName =
"ANIICON";
271 typeName =
"MANIFEST";
293 if (!
bin->resources) {
296 ut16 resoff =
bin->ne_header->ResTableOffset +
bin->header_offset;
334 if (ni.
rnID & 0x8000) {
353 ut16 off =
bin->ne_header->ImportNameTable +
bin->header_offset + 1;
355 for (
i = 0;
i <
bin->ne_header->ModRefs;
i++) {
395 if (
bin->ne_header->csEntryPoint) {
403 entry->paddr =
bin->ne_header->ipEntryPoint + (
s ?
s->paddr : 0);
407 while (off < bin->ne_header->EntryTableLength) {
409 if (!bundle_length) {
413 if (
off >=
bin->ne_header->EntryTableLength) {
419 for (
i = 0;
i < bundle_length;
i++) {
430 }
else if (bundle_type == 0xFF) {
439 entry->paddr = (
ut64)
bin->segment_entries[segnum - 1].offset *
bin->alignment + segoff;
442 if (
off >=
bin->ne_header->EntryTableLength || bundle_type >
bin->ne_header->SegCount) {
446 entry->paddr = (
ut64)
bin->segment_entries[bundle_type - 1].offset *
bin->alignment + (*
p);
487 rz_list_foreach (segments, it, seg) {
541 offset = modref[rel.
index - 1] +
bin->header_offset +
bin->ne_header->ImportNameTable;
558 if (strstr(seg->
name,
"FIXED")) {
576 rz_list_foreach (
symbols, sit, sym) {
605 }
while (
offset != 0xFFFF);
622 if (!
bin->ne_header) {
627 if (
bin->ne_header->FileAlnSzShftCnt > 31) {
630 bin->alignment = 1 <<
bin->ne_header->FileAlnSzShftCnt;
631 if (!
bin->alignment) {
632 bin->alignment = 1 << 9;
642 if (!
bin->segment_entries) {
646 if (!
bin->ne_header->EntryTableLength) {
649 bin->entry_table =
calloc(1,
bin->ne_header->EntryTableLength);
650 if (!
bin->entry_table) {
667 free(
bin->resident_name_table);
RZ_API void rz_bin_symbol_free(RzBinSymbol *sym)
RZ_API void rz_bin_import_free(RzBinImport *imp)
RZ_API void rz_bin_section_free(RzBinSection *bs)
RzList * entries(RzBinFile *bf)
RzList * symbols(RzBinFile *bf)
RzList * imports(RzBinFile *bf)
RzList * relocs(RzBinFile *bf)
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void count
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void start
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API RZ_BORROW RzListIter * rz_list_find(RZ_NONNULL const RzList *list, const void *p, RZ_NONNULL RzListComparator cmp)
Returns RzListIter element which matches via the RzListComparator.
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW void * rz_list_get_n(RZ_NONNULL const RzList *list, ut32 n)
Returns the N-th element of the list.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
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")
RzList * rz_bin_ne_get_symbols(rz_bin_ne_obj_t *bin)
rz_bin_ne_obj_t * rz_bin_ne_new_buf(RzBuffer *buf, bool verbose)
void rz_bin_ne_free(rz_bin_ne_obj_t *bin)
static void __free_resource(void *resource)
static char * __get_target_os(rz_bin_ne_obj_t *bin)
static int __translate_perms(int flags)
static char * __read_nonnull_str_at(RzBuffer *buf, ut64 offset)
static void __free_resource_entry(void *entry)
RzList * rz_bin_ne_get_imports(rz_bin_ne_obj_t *bin)
bool rz_bin_ne_buf_init(RzBuffer *buf, rz_bin_ne_obj_t *bin)
static char * __resource_type_str(int type)
static void ne_sanitize_name(char *name, ut16 count)
RzList * rz_bin_ne_get_entrypoints(rz_bin_ne_obj_t *bin)
static char * __func_name_from_ord(char *module, ut16 ordinal)
static int __find_symbol_by_paddr(const void *paddr, const void *sym)
RzList * rz_bin_ne_get_segments(rz_bin_ne_obj_t *bin)
RzList * rz_bin_ne_get_relocs(rz_bin_ne_obj_t *bin)
static bool __ne_get_resources(rz_bin_ne_obj_t *bin)
struct _TYPEINFO NE_image_typeinfo_entry
struct _RELOC NE_image_reloc_item
struct _SEGMENT NE_image_segment_entry
struct _NAMEINFO NE_image_nameinfo_entry
#define RZ_BIN_BIND_GLOBAL_STR
#define rz_buf_read_le16_at(b, addr, result)
RZ_API bool rz_buf_read8_at(RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *result)
Read a byte at the specified address in the buffer.
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
RZ_API bool rz_file_exists(const char *str)
void(* RzListFree)(void *ptr)
RZ_API RZ_OWN char * rz_path_system(RZ_NULLABLE const char *path)
Return the full system path of the given subpath path.
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
#define RZ_JOIN_3_PATHS(p1, p2, p3)
RZ_API Sdb * sdb_new(const char *path, const char *name, int lock)
RZ_API void sdb_close(Sdb *s)
RZ_API char * sdb_get(Sdb *s, const char *key, ut32 *cas)
static struct sockaddr static addrlen static backlog const void static flags void flags
ut64 paddr
the paddr where the value should be patched into
ut64(WINAPI *w32_GetEnabledXStateFeatures)()