|
@@ -78,11 +78,12 @@ uses
|
|
{$endif wince}
|
|
{$endif wince}
|
|
procedure GetModuleByAddr(addr: pointer; var baseaddr: pointer; var filename: string);
|
|
procedure GetModuleByAddr(addr: pointer; var baseaddr: pointer; var filename: string);
|
|
begin
|
|
begin
|
|
- baseaddr:= nil;
|
|
|
|
|
|
+ baseaddr:=nil;
|
|
if VirtualQuery(addr, @Tmm, SizeOf(Tmm))<>sizeof(Tmm) then
|
|
if VirtualQuery(addr, @Tmm, SizeOf(Tmm))<>sizeof(Tmm) then
|
|
filename:=ParamStr(0)
|
|
filename:=ParamStr(0)
|
|
else
|
|
else
|
|
begin
|
|
begin
|
|
|
|
+ baseaddr:=Tmm.AllocationBase;
|
|
TST[0]:= #0;
|
|
TST[0]:= #0;
|
|
GetModuleFileName(THandle(Tmm.AllocationBase), TST, Length(TST));
|
|
GetModuleFileName(THandle(Tmm.AllocationBase), TST, Length(TST));
|
|
{$ifdef wince}
|
|
{$ifdef wince}
|
|
@@ -494,9 +495,10 @@ begin
|
|
exit;
|
|
exit;
|
|
e.sechdrofs:=filepos(e.f);
|
|
e.sechdrofs:=filepos(e.f);
|
|
e.nsects:=peheader.NumberOfSections;
|
|
e.nsects:=peheader.NumberOfSections;
|
|
- e.secstrofs:=peheader.PointerToSymbolTable+peheader.NumberOfSymbols*sizeof(coffsymbol)+4;
|
|
|
|
|
|
+ e.secstrofs:=peheader.PointerToSymbolTable+peheader.NumberOfSymbols*sizeof(coffsymbol);
|
|
if e.secstrofs>e.size then
|
|
if e.secstrofs>e.size then
|
|
exit;
|
|
exit;
|
|
|
|
+ e.processaddress:=peheader.ImageBase;
|
|
OpenPeCoff:=true;
|
|
OpenPeCoff:=true;
|
|
end;
|
|
end;
|
|
{$endif PE32}
|
|
{$endif PE32}
|
|
@@ -522,8 +524,7 @@ type
|
|
SizeOfUninitializedData : longint;
|
|
SizeOfUninitializedData : longint;
|
|
AddressOfEntryPoint : longint;
|
|
AddressOfEntryPoint : longint;
|
|
BaseOfCode : longint;
|
|
BaseOfCode : longint;
|
|
- BaseOfData : longint;
|
|
|
|
- ImageBase : longint;
|
|
|
|
|
|
+ ImageBase : qword;
|
|
SectionAlignment : longint;
|
|
SectionAlignment : longint;
|
|
FileAlignment : longint;
|
|
FileAlignment : longint;
|
|
MajorOperatingSystemVersion : word;
|
|
MajorOperatingSystemVersion : word;
|
|
@@ -538,10 +539,10 @@ type
|
|
CheckSum : longint;
|
|
CheckSum : longint;
|
|
Subsystem : word;
|
|
Subsystem : word;
|
|
DllCharacteristics : word;
|
|
DllCharacteristics : word;
|
|
- SizeOfStackReserve : int64;
|
|
|
|
- SizeOfStackCommit : int64;
|
|
|
|
- SizeOfHeapReserve : int64;
|
|
|
|
- SizeOfHeapCommit : int64;
|
|
|
|
|
|
+ SizeOfStackReserve : qword;
|
|
|
|
+ SizeOfStackCommit : qword;
|
|
|
|
+ SizeOfHeapReserve : qword;
|
|
|
|
+ SizeOfHeapCommit : qword;
|
|
LoaderFlags : longint;
|
|
LoaderFlags : longint;
|
|
NumberOfRvaAndSizes : longint;
|
|
NumberOfRvaAndSizes : longint;
|
|
DataDirectory : array[1..$80] of byte;
|
|
DataDirectory : array[1..$80] of byte;
|
|
@@ -561,9 +562,10 @@ begin
|
|
exit;
|
|
exit;
|
|
e.sechdrofs:=filepos(e.f);
|
|
e.sechdrofs:=filepos(e.f);
|
|
e.nsects:=peheader.NumberOfSections;
|
|
e.nsects:=peheader.NumberOfSections;
|
|
- e.secstrofs:=peheader.PointerToSymbolTable+peheader.NumberOfSymbols*sizeof(coffsymbol)+4;
|
|
|
|
|
|
+ e.secstrofs:=peheader.PointerToSymbolTable+peheader.NumberOfSymbols*sizeof(coffsymbol);
|
|
if e.secstrofs>e.size then
|
|
if e.secstrofs>e.size then
|
|
exit;
|
|
exit;
|
|
|
|
+ e.processaddress:=peheader.ImageBase;
|
|
OpenPePlusCoff:=true;
|
|
OpenPePlusCoff:=true;
|
|
end;
|
|
end;
|
|
{$endif PE32PLUS}
|
|
{$endif PE32PLUS}
|