Skip to content

Commit

Permalink
idaloader: make use of ea_helper_t & set image base address
Browse files Browse the repository at this point in the history
Thanks to camden-smallwood for ea_helper_t suggestion!
  • Loading branch information
emoose committed Aug 10, 2024
1 parent 6f0d1e3 commit a377c7a
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions idaloader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,9 @@ void idaapi load_file(linput_t *li, ushort /*_neflags*/, const char * /*fileform
comp.size_ldbl = 0;
set_compiler(comp, SETCOMP_OVERRIDE);

inf_set_baseaddr(0);
inf_set_64bit(false); // needed for hexppc64 to treat us as 32bit
ea_helper_t eah;
eah.setup(false); // file format does not support 64-bit data
inf_set_64bit(false);

qlseek(li, 0);

Expand All @@ -290,6 +291,9 @@ void idaapi load_file(linput_t *li, ushort /*_neflags*/, const char * /*fileform
bool result = file.load(li);
if (result)
{
inf_set_baseaddr(file.base_address() >> 4);
set_imagebase(file.base_address());

// If this is XEX2 try loading in x360.til, in case we have one
if (file.header().Magic == MAGIC_XEX2)
add_til("x360.til", 0);
Expand Down

0 comments on commit a377c7a

Please sign in to comment.