Skip to content

Commit

Permalink
server: Fix PE32 loading
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Jan 29, 2024
1 parent b61dc46 commit 9c6ada2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/adbg/object/server.d
Original file line number Diff line number Diff line change
Expand Up @@ -622,9 +622,12 @@ L_ARG:
if (o.file_size < mz_hdr.sizeof)
return adbg_oops(AdbgError.unknownObjFormat);

version (Trace) trace("e_lfarlc=%#x", o.i.mz.header.e_lfarlc);

// If e_lfarlc (relocation table) starts lower than e_lfanew,
// then assume old MZ.
if (o.i.mz.header.e_lfarlc <= 0x40)
// NOTE: e_lfarlc can point to 0x40.
if (o.i.mz.header.e_lfarlc < 0x40)
return adbg_object_mz_load(o);

// If e_lfanew points within MZ extended header
Expand Down

0 comments on commit 9c6ada2

Please sign in to comment.