flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
Reverend 31 Dec 2005, 14:30
I don't have 64-bit processor, but you can always try the hardcore way
![]() ![]() But it is true, that any section cannot be blank. Also check if you gave readable properties to '.rsrc' section. I had once such mistake and it was pain to find it, as everything in my code seemed alright. |
|||
![]() |
|
TheColonial 02 Jan 2006, 10:47
Hrm, I'm not sure if that's going to fix it
![]() As I said, I don't mind helping out with this - and as soon as I have a working set of win64???.inc files I'm more than happy to share them up!. Thanks for the response Reverend. TC. |
|||
![]() |
|
Tomasz Grysztar 02 Jan 2006, 10:54
That's strange, because, as far as I know (from the official PE/COFF specification) the resource format have stayed the same for the 64-bit executables. Have you tried it also with "resource from" construction?
The WIN64*.INC headers are not yet ready, since they would perhaps need the 64-bit equates (in the EQUATES subdir), too. I still do not have any 64-bit machine, what is the main reason why I haven't made such includes yet. |
|||
![]() |
|
Feryno 02 Jan 2006, 14:18
I failed to add resource to win64 exe with macros for win32. So I use terrible but working method:
1. I compile resource to obj file with gorc http://www.jorgon.freeserve.co.uk/Gorcjorgbeta.zip 2.Then I include binary part of resource.obj into win64 *.asm file in resource section: section '.rsrc' resource data readable file 'fdbg_resource.obj':3Ch,10BCh (last value must be calculated for various resource.obj sizes) 3. I compile *.asm file with FASM 4. The most important is patching resource in exe: e.g. for 8 entries (I'm not realy good programmer, so I don't know the exact name for resource "entry" - but it's e.g. 1 menu + 1 accelerator table + 6 dialogs = 8 "entries") so patch for 8 entries looks like: lea rdi,[file_buffer]; <-point to begin of EXE loaded in patcher after ReadFile - bytes 'MZ' cmp word [rdi],'MZ' jnz we_didnt_read_exe mov rcx,400h/8 mov rax,'.rsrc' cld repnz scasq; terrible method for find .rsrc section, but it works... jnz close_exit mov eax,[rdi+4]; grab section memory relative offset from program memory base start mov ecx,[rdi+12]; grab section RVA in *.exe lea rdx,[file_buffer] add dword [rdx + rcx + 158h],eax ; patch it ! add dword [rdx + rcx + 168h],eax ; patch it ! add dword [rdx + rcx + 178h],eax ; patch it ! add dword [rdx + rcx + 188h],eax ; patch it ! add dword [rdx + rcx + 198h],eax ; patch it ! add dword [rdx + rcx + 1A8h],eax ; patch it ! add dword [rdx + rcx + 1B8h],eax ; patch it ! add dword [rdx + rcx + 1C8h],eax ; patch it ! for 1 "entry" in rsrc patch is: add dword [rdx + rcx + 48h],eax ; patch it ! for 2 "entries": add dword [rdx + rcx + 80h],eax ; patch it ! add dword [rdx + rcx + 90h],eax ; patch it ! for 3 "entries" add dword [rdx + rcx + 0B8h],eax ; patch it ! add dword [rdx + rcx + 0C8h],eax ; patch it ! add dword [rdx + rcx + 0D8h],eax ; patch it ! for 4 entries: add dword [rdx + rcx + 0D8h],eax ; patch it ! add dword [rdx + rcx + 0E8h],eax ; patch it ! add dword [rdx + rcx + 0F8h],eax ; patch it ! add dword [rdx + rcx + 108h],eax ; patch it ! now it's rule to create 5 and above, just remove first 2 and add 3 at the end, every higher by 10h - for 5 it's: F8,108,118,128,138 But I don't known if patch offsets arent different for other "entries", I use everytime this order: 1 menu, 1 accelerator table, x dialogs. At this time I have resource with 13 "entries" in my project, and if somebody want it, I can send it... Last sentence was a joke, and I know, that you are better coders and you are able to do it by macros. I'm not able to construct a macros, but I'm able to test everything if somebody create it. Last edited by Feryno on 02 Jan 2006, 14:35; edited 4 times in total |
|||
![]() |
|
Tomasz Grysztar 02 Jan 2006, 14:27
Do you have any information whether the resource format is changed in Win64?
Or please send me the sample of correct Win64 resources. |
|||
![]() |
|
Feryno 02 Jan 2006, 14:37
|
|||
![]() |
|
Tomasz Grysztar 02 Jan 2006, 15:03
Well, just as I supposed, the format of resources is the same. Then it must be some problem with alignment or data order inside the resources. When you do resource from "fdbg_resource.res" does it also create the resources that are not accepted?
|
|||
![]() |
|
Feryno 05 Jan 2006, 05:51
I'm too sorry to gave you wrong informations about macros. As Tomasz said, there isn't difference between win64 and win32 resources. Macros for win32 can be used for win64 very well. Yesterday I tried macros again (more than half year since my unsucces with them) and everything was perfect.
Now I will have to rewrite 20 kB resource of my project to macros... and it will be my death! Win64 porting of 1 sample with resource from fasmw.zip included samples:
|
|||||||||||
![]() |
|
Garthower 22 Jun 2006, 12:18
I have a question. How it is possible, using macroses, to dialogue to appoint a class? For example, in RC-resource it looks so:
Code: Dialog1 DIALOG 0, 0, 388, 162 STYLE DS_MODALFRAME | DS_3DLOOK | DS_CONTEXTHELP | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX CLASS "MyClass" CAPTION "" FONT 9, "MS Serif" { .... } |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.