
Originally Posted by
Jason
All of that "pumping" is rubbish. You can't just pump random bytes into the resource section, some programs actually USE their resources, and overwriting them with rubbish data can cause instability. You *can* overwrite the padding of each section (each section is page aligned, so you can compute the difference between VirtualSize and SizeOfRawData and overwrite the difference), but there a multitude of safe places in an executable image that you can overwrite.
No one said to overwrite resources, I said pump... meaning to add new resources into the resource section of the image.. and yes I 100% agree with the page alignment hence the reason why I stated "if" enough space(aka padding) allows you to write random byte to the end of the code section(or any other section for that matter). to add new resources is a simple process using windows API UpdateResource
UpdateResource function
A small example in Delphi would be something like....
Code:
ResourceHandle := BeginUpdateResourceW(PWideChar(WideString(SaveDialog1.Filename)) , False); //File name
UpdateResourceW(ResourceHandle,PWideChar(RT_RCDATA),(PWideChar(WideString('DATA'))),0,@szData[1],Length(szData));
EndUpdateResourceW(ResourceHandle, False);
szData is just a string generated randomly, SaveDialog1.Filename is the file you want to add resources to... simple 3 lines of code to add resources
