Jump to content
Tuts 4 You

Embedded exe into memory without extracting [Delphi]


C++

Recommended Posts

Posted

How to execute embedded exe into memory without extracting ?

 

I can extract file from resources but I want to execute without extracting.

 

I hope this is not duplicate posts. :unsure:

Posted

no idea, but asked my friend google, on first result, point me :

https://stackoverflow.com/a/6401261/1320686

 

send a friend request to Google, you can ask everything you want & knows everything!

  • Like 1
Posted
30 minutes ago, whoknows said:

no idea, but asked my friend google, on first result, point me :


https://stackoverflow.com/a/6401261/1320686

 

send a friend request to Google, you can ask everything you want & knows everything!

Already tested that code but gives 0000000 for imagebase so it failed to launch embedded exe. But I'll figure it out soon. 

Posted

The code linked above is a RunPE code, it inject an exe into a "new" process and not the same

imgbase:=DWORD(VirtualAllocEx(PInfo.hProcess,Ptr(INH^.OptionalHeader.ImageBase),INH^.OptionalHeader.SizeOfImage,MEM_COMMIT or MEM_RESERVE,PAGE_EXECUTE_READWRITE));

the code above gave you 0 because you're trying to alloc on an already allocated memory or because some memory page stuff (which I don't know) (VirtuallAlloc/VirtualAllocEx are not very obedient when you specify the memory), to solve this problem you should call ZwUnmapViewOfSection before calling it

I googled "RunPe delphi" and this is one of the results
http://www.delphibasics.info/home/delphibasicssnippets/memoryexecutionunit-winxpwinvistawin7

  • Like 2

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...