The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: lamer on May 24, 2005, 06:32:42 PM

Title: Working with resource script
Post by: lamer on May 24, 2005, 06:32:42 PM
Hi all!
Are there any functions or something else for reading from - writing to resource script files (.rc) ?
Or I should just read/write byte after byte ?

Regards
Title: Re: Working with resource script
Post by: AeroASM on May 24, 2005, 06:41:31 PM
Normally programs do not have to interact with .rc files so there are no special APIs for them. You will have to make do with ReadFile and WriteFIle.
Title: Re: Working with resource script
Post by: lamer on May 24, 2005, 06:59:02 PM
Quote from: AeroASM on May 24, 2005, 06:41:31 PM
Normally programs do not have to interact with .rc files
And what about resource editors?
Do they all use ReadFile/WriteFile? :(
Title: Re: Working with resource script
Post by: AeroASM on May 24, 2005, 07:15:47 PM
The .rc file is compiled into a .res file which is linked into the executable under a section called .rsrc. They all use ReadFile/WriteFile to edit the exe manually.
Title: Re: Working with resource script
Post by: lamer on May 24, 2005, 08:12:43 PM
When you just create .rc file there is no .res. You may open Notepad and manually create the .rc, but you probably use any more advanced, visual resource editor. That's what I want to know - how do they write (or read) into the .rc - by Read/WriteFile or more handy routines.
Title: Re: Working with resource script
Post by: AeroASM on May 25, 2005, 06:36:52 AM
They probably use functions like fread and fwrite in the C runtime library, but all that these functions do is call ReadFile/WriteFile, which is the only way to read files under Windows.
Title: Re: Working with resource script
Post by: Vortex on May 25, 2005, 09:49:18 AM
Hi lamer,

Have a look at Ketilo's resource editor from RadASM package, if I am not wrong, it comes with full source code so you can think about creating your own resource script engine to manipulate .rc files.