怎样获得程序的进入点?(45分)

  • 主题发起人 主题发起人 笑傲Delphi
  • 开始时间 开始时间

笑傲Delphi

Unregistered / Unconfirmed
GUEST, unregistred user!
function GetEntryPoint(fName: string) : pointer;
begin
with TMemoryStream.Create do
try
LoadFromFile(fName);
dword(result) := GetModuleNtHeaders(dword(Memory)).OptionalHeader.AddressOfEntryPoint;
finally Free end;
end;

procedure SetEntryPoint(fName: string; newEntryPoint: pointer);
begin
with TMemoryStream.Create do
try
LoadFromFile(fName);
GetModuleNtHeaders(dword(Memory)).OptionalHeader.AddressOfEntryPoint := newEntryPoint;
SaveToFile(fName);
finally Free end;
end;
 
怎么不行了?我怎么得分了?
 
后退
顶部