|
-
Mar 18th, 2003, 03:59 AM
#1
Thread Starter
New Member
Running files from memory
Hello,
I'm new to ASM and mostly use it inline. What I'm trying to do is run a PE32 executable file from memory using inline ASM in Delphi.
I have the following code;
var
FS: TFileStream;
Mem: TMemoryStream;
Addr: Pointer;
begin
FS := TFileStream.Create('e:\TestApp.exe', fmOpenReadWrite or fmShareDenyWrite);
Mem := TMemoryStream.Create();
Mem.CopyFrom(FS, FS.Size);
Mem.Position := 0;
Addr := Mem.Memory;
asm
JMP Addr
end;
end;
One would expect it to work. At the given address the exe really starts. It's just the raw mem address of the executable. Still, I keep getting Access Violations.
Anyone know what I'm doing wrong ?
Thanks,
- Fahr
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|