topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday March 29, 2024, 7:50 am
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: ResHacker.exe -extract then -modify error?  (Read 10968 times)

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
    • View Profile
    • Donate to Member
ResHacker.exe -extract then -modify error?
« on: August 18, 2009, 04:34 AM »
Hi DC,

I am writing a script to modify chrome.dll using Resource Hacker, here's the script:
ResHack.exe -extract chrome.dll, test.rc, 9,101,
ResHack.exe -modify  chrome.dll, chromenew.dll, test.rc, 9,101,

The log says

ResHack.exe -modify  chrome.dll, chromenew.dll, test.rc, 9,101,
Error: Invalid resource type.

Anybody know why?

BTW, any free commandline tools for extract and modify PE's resources?
« Last Edit: August 18, 2009, 04:42 AM by electronixtar »

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #1 on: August 18, 2009, 01:12 PM »
Hi DC,

I am writing a script to modify chrome.dll using Resource Hacker, here's the script:
ResHack.exe -extract chrome.dll, test.rc, 9,101,
ResHack.exe -modify  chrome.dll, chromenew.dll, test.rc, 9,101,

The log says

ResHack.exe -modify  chrome.dll, chromenew.dll, test.rc, 9,101,
Error: Invalid resource type.

Anybody know why?

BTW, any free commandline tools for extract and modify PE's resources?
-electronixtar (August 18, 2009, 04:34 AM)

Hello!
As far as I know, ResHacker does NOT support importing .rc files.
You can try this free nifty tool by XPero to make a ResHacker script, or compile the RC file to a RES file (and then use reshacker to modify it), using for example, the free Pelles Resource Compiler
(Attached here [attachimg=1 ][/attachimg]or can be grabbed from the Pelles C Compiler website])

Have fun reshacking!

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
    • View Profile
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #2 on: August 18, 2009, 08:46 PM »
As far as I know, ResHacker does NOT support importing .rc files.

Thank you scancode. Your tool is very helpful.

Too bad ResHacker does not support .rc import, another issue is ResHacker.exe -extract does not produce standard .rc files, it's ResHacker's own special format with extesion name .rc. I think I need another tool for correcet .rc exporting.


scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #3 on: August 18, 2009, 08:50 PM »
it's ResHacker's own special format with extesion name .rc
-electronixtar (August 18, 2009, 08:46 PM)

Would you be interested in a reshacker -> rc converter?

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
    • View Profile
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #4 on: August 19, 2009, 03:27 AM »
it's ResHacker's own special format with extesion name .rc
-electronixtar (August 18, 2009, 08:46 PM)

Would you be interested in a reshacker -> rc converter?

Yes please provide a small and convenient one. I need it in one of my auto modify scripts.

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #5 on: August 19, 2009, 03:33 AM »
it's ResHacker's own special format with extesion name .rc
-electronixtar (August 18, 2009, 08:46 PM)

Would you be interested in a reshacker -> rc converter?

Yes please provide a small and convenient one. I need it in one of my auto modify scripts.
-electronixtar (August 19, 2009, 03:27 AM)

Okies. I'll give it a shot after I get my fair dose of
Vitamin S
Sleeeeeeep!


scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #6 on: August 19, 2009, 01:30 PM »
Yes please provide a small and convenient one. I need it in one of my auto modify scripts.
-electronixtar (August 19, 2009, 03:27 AM)

Good news! The formats aren't all that different.
Expect a quickie converter in an hour or so.

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #7 on: August 19, 2009, 11:33 PM »
Yes please provide a small and convenient one. I need it in one of my auto modify scripts.
-electronixtar (August 19, 2009, 03:27 AM)
Expect a quickie converter in an hour or so.

Ok, that was the longest hour of my life :D

Anyways, here it is.
Usage: rh2rc.exe infile outfile

Has some basic error checking, and might have some bugs (it's the first version).
Give it a shot and reports any bugs you find please.
« Last Edit: August 19, 2009, 11:39 PM by scancode »

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
    • View Profile
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #8 on: August 26, 2009, 09:21 PM »
Yes please provide a small and convenient one. I need it in one of my auto modify scripts.
-electronixtar (August 19, 2009, 03:27 AM)
Expect a quickie converter in an hour or so.

Ok, that was the longest hour of my life :D

Anyways, here it is.  (see attachment in previous post)Usage: rh2rc.exe infile outfile

Has some basic error checking, and might have some bugs (it's the first version).
Give it a shot and reports any bugs you find please.

That's cool, thank you very much scancode   :Thmbsup:

scancode

  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
  • I will eat Cody someday.
    • View Profile
    • Read more about this member.
    • Donate to Member
Re: ResHacker.exe -extract then -modify error?
« Reply #9 on: August 26, 2009, 09:25 PM »
That's cool, thank you very much scancode   :Thmbsup:
-electronixtar (August 26, 2009, 09:21 PM)

You're welcome! Glad it worked~ :Thmbsup: