flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
score_under 13 Jan 2010, 10:28
Instead of loading resources from your hInstance or the result of GetModuleHandle(0), load them from the HMODULE of your DLL. (The result of LoadLibrary).
|
|||
![]() |
|
Borsuc 13 Jan 2010, 16:45
But why? Why's it better to have two files instead of 1? It will actually be bigger since the filesystem has an alignment for files.
|
|||
![]() |
|
Teehee 13 Jan 2010, 16:50
Just in case of my .exe get bigger than 2mb (bc of resources), it will run faster if I separate the resources in a dll, don't? So I load only when needed.
ps: 2mb was just a example. |
|||
![]() |
|
Borsuc 13 Jan 2010, 17:02
Maybe, you could always just append them to the end of the .exe manually (without being part of a section!) like installers do, which can be really big (gigabytes even).
![]() |
|||
![]() |
|
Teehee 13 Jan 2010, 17:05
*_* how??
|
|||
![]() |
|
Borsuc 13 Jan 2010, 17:15
I don't know how to do it with normal FASM 'format PE' to be honest. But you can append the resources with a simple command after the program is compiled, like:
"copy /B main.exe+resources" (command line append) -- of course you'll probably have to know the size of your .exe before appending the resources in the source code itself and use it as 'offset' to start reading the resources from, which I don't know if it's possible to get the size of the file with normal 'format PE' FASM -- I use manual macros to make the PE file with 'format binary' where you can get the size. If it sounds too complicated then go with your method, but should you wish to try this later, maybe to improve yourself, hope it helped. ![]() |
|||
![]() |
|
Teehee 13 Jan 2010, 17:21
but how do you load the content of that address? for instance using LoadIcon,0,address? or manually? and you will have to know the size of icon\bitmaps\etc.. seems too complicated..
![]() |
|||
![]() |
|
Borsuc 13 Jan 2010, 17:50
Well I thought you were talking about 'custom' resources, i.e custom data, not the Windows resources -- because I didn't think Windows resources were so big
![]() (obviously I was thinking of 'ReadFile' just like reading any data ![]() _________________ Previously known as The_Grey_Beast |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.