flat assembler
Message board for the users of flat assembler.
Index
> Windows > resources |
Author |
|
okasvi 22 Jul 2006, 15:13
I'm not sure if fasm can assemble ms coff file containing resources, but fasm does have resource macros(are they macros?), see manual.
|
|||
22 Jul 2006, 15:13 |
|
kohlrak 22 Jul 2006, 19:01
If you're talking about MS resource files (.rc and .h) they're standard C++ header files. I don't know how you'd go about it though. I dont' know much about assembly (just starting to read tutorials, but i'm not getting anywhere, just talking about how the hardware is setup at this point), but i am assuming that when you call the resources, you're calling a set of instructions that copies the resources (such as icons for example) to the RAM then some to deal with it there. If i'm right, you could either take the binary data and manually put all the values of it in your ASM file (via variables) or make a bunch of variables which are the exact size of the resource (but all are 0) to take up just enough space, then go into the exe file and hex edit the values in (which would be quicker and easier than putting them into the ASM).
But that's all my simple pre-assembly learning assumption. If you hex edit it in, you might want to make some of the 0s into a string that would help you identify the start and end of the space. I know it sounds like a pain, but if you make them english enough, it should make it alot easier. |
|||
22 Jul 2006, 19:01 |
|
Xanfa 10 Aug 2006, 03:46
I use VC++6 to create .RES file and do this in my PE file:
section '.rsc' data resource from 'Myresource.res' readable It's all for my resource section. I've never work with MScoff format, but sure it's the same as PE format (read documentation for more !) |
|||
10 Aug 2006, 03:46 |
|
daluca 12 Aug 2006, 05:33
thank's Xanfa but what i really want is tu use only the macros that fasm
suplie like: Code: format ms coff section '.rsrc' resource data readable ; resource directory directory RT_MENU,menus,\ RT_ICON,icons,\ RT_GROUP_ICON,group_icons,\ RT_VERSION,versions ; resource subdirectories resource menus,\ 37,LANG_ENGLISH+SUBLANG_DEFAULT,main_menu resource icons,\ 1,LANG_NEUTRAL,icon_data resource group_icons,\ 17,LANG_NEUTRAL,main_icon resource versions,\ 1,LANG_NEUTRAL,version menu main_menu menuitem '&File',0,MFR_POPUP menuitem '&New',IDM_NEW menuseparator menuitem 'E&xit',IDM_EXIT,MFR_END menuitem '&Help',0,MFR_POPUP + MFR_END menuitem '&About...',IDM_ABOUT,MFR_END icon main_icon,icon_data,'minipad.ico' versioninfo version,VOS__WINDOWS32,VFT_APP,VFT2_UNKNOWN,LANG_ENGLISH+SUBLANG_DEFAULT,0,\ 'FileDescription','MiniPad - example program',\ 'LegalCopyright','No rights reserved.',\ 'FileVersion','1.0',\ 'ProductVersion','1.0',\ 'OriginalFilename','MINIPAD.EXE' but fasm gives error.this macros only work with PE format resource is just a data section right? but i don't now what simbols should be public or extern maybe is posible to create some macros to build this data i only sai it since fasm can output *.obj files and golink can link this *.obj files in to the final *.exe including the resources that must be in *.obj format i don't want to use any resource compiler only macros like in the example above. but thank's anyway |
|||
12 Aug 2006, 05:33 |
|
Reverend 10 Sep 2006, 15:20
.RES files are generally the same as fasm's macros output (.RES files have some header first AFAIK). So it would be possible to do what you want, but these macros use 'RVA' which is reserved for 'format PE'.
|
|||
10 Sep 2006, 15:20 |
|
OzzY 10 Sep 2006, 17:49
daluca,
You can use FASM macros to create a resource section or use external resource editor and then use it in FASM. Here is an example on using external resource editor (you need to use "format PE" and not COFF): 1) You build the resources, dialogs, icons, etc using the editor. You can use MS VC++, Pelles C or ResEd (available at RADasm site). 2) One you save it you get a .rc and need to compile it. Use gorc (available at http://www.jorgon.freeserve.co.uk/ ) to compile it: Quote:
And you get a .res file. 3) Include the .res file in your source code: Code: section '.rsrc' resource data from 'rsrc.res' or Code:
data resource from 'rsrc.res'
end data
if you don't want a new section. 4) Assemble the source and test: Quote:
That's it. If you have any questions I can post an example on both methods (external .res and FASM Resource macros) To use FASM macros you also need "format PE" and not COFF, I think. To use coff you need to use external resource editor, compile it to .res and then link: Quote:
|
|||
10 Sep 2006, 17:49 |
|
Garthower 11 Sep 2006, 08:58
But not all so is good, as can seem all over again. I have faced some problems enough for a long time, and they till now are not solved. Anybody and has not prompted their decision, and I not in a condition to solve them. For example, by means of standard macroses who are delivered with FASM, the dialogue window cannot appoint the class and if to use resources record
Code: section '.rsrc' resource data from 'rsrc.res' and it has not turned out to force to work for me dialogue windows. These questions I lifted all on branches of this forum, and they till now have remained without the answer. About a problem of work of resource dialogue windows: http://board.flatassembler.net/topic.php?t=5765 About a problem of purpose of a class to dialogue windows: http://board.flatassembler.net/topic.php?t=4559 |
|||
11 Sep 2006, 08:58 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.