Any Recomended Document?
Any Recomended Document?
ok, this is loosly connected to your collection..
for MadRes you can edit icons, this is done by editing the pe header. now i was wanting to learn how to do this myself nd was wondering if you recommend any documents on pe headers / editing icons inside executables.
the only reason i'm asking you is because you've already mastered this task
thanks in advance.
for MadRes you can edit icons, this is done by editing the pe header. now i was wanting to learn how to do this myself nd was wondering if you recommend any documents on pe headers / editing icons inside executables.
the only reason i'm asking you is because you've already mastered this task
thanks in advance.
its nice to see a programmer proud of his creations!
the only reason i ask. is because theres plenty of documents on extracting icons, but i cant fin anything (which i can follow) thats about removing / adding icons to a file. i only want it out of interest, there wont be any HatRes units coming out
{Edit}
PS. i like ur trousers in that photo u got on ur site
the only reason i ask. is because theres plenty of documents on extracting icons, but i cant fin anything (which i can follow) thats about removing / adding icons to a file. i only want it out of interest, there wont be any HatRes units coming out
{Edit}
PS. i like ur trousers in that photo u got on ur site
Hmmmm... You can begin reading here:
http://msdn.microsoft.com/msdnmag/issue ... fault.aspx
http://msdn.microsoft.com/msdnmag/issue ... fault.aspx
Those articles are about how the PE format looks like. I think the author of those articles also has written (and published) a little program which parses the resource section and lists all contained resources.
Apart from that there simply is not that much documentation about these things...
http://msdn.microsoft.com/msdnmag/issue ... fault.aspx
http://msdn.microsoft.com/msdnmag/issue ... fault.aspx
Those articles are about how the PE format looks like. I think the author of those articles also has written (and published) a little program which parses the resource section and lists all contained resources.
Apart from that there simply is not that much documentation about these things...
yeah i noticed
thanks for all ur help madshi, and while ur here, help me with a lil nooby question if u have a few seconds
i'm not sure what informtion needs to go into where i placed the ??s (and i thought seein as u took so long to make the code i'd give it a lil go)
thanks for all ur help madshi, and while ur here, help me with a lil nooby question if u have a few seconds
Code: Select all
VAR update:cardinal;
{..}
update := BeginUpdateResourceW('file.exe',true);
LoadIconGroupResourceW(update,??,??,'iconfile.ico');
EndUpdateResourceW(update,false);
That depends on what you want to do. The first parameter is the name that the icon resource shall get. The second parameter is the language. You can use any name for the first parameter and "0" for the language.
I suggest using the freeware resource hacker tool to check whether your manipulations worked out the way you planned. A google search will tell you where to download that tool. I'm using it myself.
I suggest using the freeware resource hacker tool to check whether your manipulations worked out the way you planned. A google search will tell you where to download that tool. I'm using it myself.
Editing icons (iam using Win9x)
Hey madshi, i've been looking for working code for a long time
thanks for fixing the bugs.. but heh now there's a small problem..
update := madRes.BeginUpdateResourceW('c:\test.exe'),true);
if update <> 0 then //its not 0 so it keeps going
begin
LoadIconGroupResourceW(update,'MAINICON',0,'c:\someicon.ico');
EndUpdateResourceW(update, false);
end;
but it doest replace MAINICON, i tried replacing 'MAINICON' string
with PWideChar(RT_GROUP_ICON)
but it did't change anything.
Maybe you know whats wrong ?
thanks for fixing the bugs.. but heh now there's a small problem..
update := madRes.BeginUpdateResourceW('c:\test.exe'),true);
if update <> 0 then //its not 0 so it keeps going
begin
LoadIconGroupResourceW(update,'MAINICON',0,'c:\someicon.ico');
EndUpdateResourceW(update, false);
end;
but it doest replace MAINICON, i tried replacing 'MAINICON' string
with PWideChar(RT_GROUP_ICON)
but it did't change anything.
Maybe you know whats wrong ?
bugs ?
update := MadRes.BeginUpdateResourceW('c:\test.exe',true);
if update <> 0 then
begin
MadRes.LoadIconGroupResourceW(update,
//'MAINICON'
PWideChar(RT_GROUP_ICON)
,0,'c:\someicon.ico');
MadRes.EndUpdateResourceW(update, false);
end;
by calling MadRes function unit it works..
but it overwrites my Resource Dialog and other important resources...
any ideas ?
if update <> 0 then
begin
MadRes.LoadIconGroupResourceW(update,
//'MAINICON'
PWideChar(RT_GROUP_ICON)
,0,'c:\someicon.ico');
MadRes.EndUpdateResourceW(update, false);
end;
by calling MadRes function unit it works..
but it overwrites my Resource Dialog and other important resources...
any ideas ?
okeydokey .. u see the line
well u can use true or false for that second parameter .. if u use true it will wipe all resources and start fresh .. if u choose false it will keep all existing resources and just overwrite the one u specify in the name paramter .. ie RT_GROUP_ICON
make sense?
Code: Select all
BeginUpdateResourceW('c:\test.exe',true);
make sense?