DonationCoder.com forum
 
Read-only archive. This is a static copy of the DonationCoder.com forum. Reading and searching work as before; logging in, posting and private messages do not.
Archive of 2026-10-21 · About this archive · Main site

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

electronixtar

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

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

The log says

Quote
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, 09:42 AM by electronixtar »

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ResHacker.exe -extract then -modify error?
« Reply #1 on: August 18, 2009, 06:12 PM »
Hi DC,

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

The log says

Quote
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?

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 porc.7z (55.9 KB)or can be grabbed from the Pelles C Compiler website])

Have fun reshacking!

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
Re: ResHacker.exe -extract then -modify error?
« Reply #2 on: August 19, 2009, 01:46 AM »
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

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ResHacker.exe -extract then -modify error?
« Reply #3 on: August 19, 2009, 01:50 AM »
it's ResHacker's own special format with extesion name .rc

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

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
Re: ResHacker.exe -extract then -modify error?
« Reply #4 on: August 19, 2009, 08:27 AM »
it's ResHacker's own special format with extesion name .rc

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

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ResHacker.exe -extract then -modify error?
« Reply #5 on: August 19, 2009, 08:33 AM »
it's ResHacker's own special format with extesion name .rc

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.

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

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ResHacker.exe -extract then -modify error?
« Reply #6 on: August 19, 2009, 06:30 PM »
Yes please provide a small and convenient one. I need it in one of my auto modify scripts.

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

scancode

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ResHacker.exe -extract then -modify error?
« Reply #7 on: August 20, 2009, 04:33 AM »
Yes please provide a small and convenient one. I need it in one of my auto modify scripts.
Expect a quickie converter in an hour or so.

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

Anyways, here it is. rh2rc.exe (76.0 KB)
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 20, 2009, 04:39 AM by scancode »

electronixtar

  • Member
  • Joined in 2007
  • **
  • Posts: 141
Re: ResHacker.exe -extract then -modify error?
« Reply #8 on: August 27, 2009, 02:21 AM »
Yes please provide a small and convenient one. I need it in one of my auto modify scripts.
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

  • I will eat Cody someday.
  • Honorary Member
  • Joined in 2007
  • **
  • Posts: 641
    • Cody Award
    • Participated in NANY Challenge Twice
    • Coding Snacks
    • Furry Fandom Badge - Furry Fandom
    • DJ Badge - DJ
Re: ResHacker.exe -extract then -modify error?
« Reply #9 on: August 27, 2009, 02:25 AM »
That's cool, thank you very much scancode   :Thmbsup:

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

Original address: https://www.donationcoder.com/forum/index.php?topic=19564.0