AV in EXE after creating binary resource

delphi package - madRes, madTools, madStrings, ...

AV in EXE after creating binary resource

Postby Mego » Fri Dec 11, 2009 7:46 pm

Hi,

After creating (with madres) an RCDATA resource (size=10K) in an EXE builded by Centura Team Developer 1.5, my EXE can't start at all.

If a resource size 256 bytes, everything is OK
If I'm creating an RCDATA resource (size=10K) manually with Restorator 2006 - everything is OK.
If I'm creating an RCDATA resource (size=10K) with madres in some EXE builded by Delphi - everything is OK also.

Is it a bug in madres or i'm doing something illegal?
Code: Select all
  rh := madres.BeginUpdateResourceW(PChar(sFileName), False);
  if rh = 0 then begin
    Win32Check(madres.UpdateResourceW(rh, RT_RCDATA, PChar(sResName), 1049 , pData, iDataSize));
    Win32Check(madres.EndUpdateResourceW(rh, False));
  end;

I can send you an EXE file if you need.
Thanks a lot!
Mego
 
Posts: 3
Joined: Fri Dec 11, 2009 7:30 pm

Postby Mego » Fri Dec 11, 2009 7:48 pm

sorry for a mistake in the code:
Code: Select all
if rh <> 0 then begin .....
of course...
Mego
 
Posts: 3
Joined: Fri Dec 11, 2009 7:30 pm

Postby madshi » Mon Dec 14, 2009 8:34 am

I don't know Restorator 2006, what is that?

Generally when adding a big resource, madRes has to modify the sections of the PE file structure. Usually that works just fine. But it might make problems with certain EXE files produced by certain compilers. I'd suggest that you double check this with the freeware "Resource Hacker". Is this freeware able to add your resource without making it crash?
madshi
Site Admin
 
Posts: 9412
Joined: Sun Mar 21, 2004 5:25 pm

Postby Mego » Mon Dec 14, 2009 5:07 pm

I've added a 25K resource into my EXE with ResourceHacker 3.4.0. successfully, the EXE is still working.

With madres I can add 256 bytes resources without error on EXE start.

I've also tried Colin Wislon's Resource editor, but it made my EXE only 40K long (instead of 30M). The same behaviour is when using standard WinAPI UpdateResourceW
Mego
 
Posts: 3
Joined: Fri Dec 11, 2009 7:30 pm

Postby madshi » Mon Dec 14, 2009 5:37 pm

Well, you can compare the EXEs produced by Resource Hacker and madRes with the freeware tool "PEBrowse Pro". That will let you check the PE file sections and their properties. Maybe you can find out in what way they differ and which difference might be responsible for the crash when using madRes. Also you could load the madRes produced EXE with Resource Hacker and check whether the resources all seem to be alright.
madshi
Site Admin
 
Posts: 9412
Joined: Sun Mar 21, 2004 5:25 pm


Return to madBasic

Who is online

Users browsing this forum: No registered users and 1 guest

cron