News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Working with resource script

Started by lamer, May 24, 2005, 06:32:42 PM

Previous topic - Next topic

lamer

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

AeroASM

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.

lamer

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? :(

AeroASM

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.

lamer

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.

AeroASM

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.

Vortex

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.