flat assembler
Message board for the users of flat assembler.
Index
> Windows > Problem with embedded resource / Buttons in WIN 7 style |
Author |
|
Walter 15 Oct 2019, 14:15
Add the include that will pull in Resource.inc for the directory macro.
Code: format PE64 GUI entry start include 'win64a.inc' section '.text' code readable executable |
|||
15 Oct 2019, 14:15 |
|
CodeBreaker 15 Oct 2019, 16:40
Walter, Thank you very much for your reply.
Yes, I forgot to include the file. I fixed it. I also revised the manifest section, to make it more 64-Bit like. Here's the new version. This fixed version is working fine and is also rendering the OK Button in WIN 7 style. Code: ; Example of 64-bit PE program format PE64 GUI entry start include 'win64a.inc' section '.text' code readable executable start: sub rsp,8*5 ; reserve stack for API use and make stack dqword aligned mov r9d,0 lea r8,[_caption] lea rdx,[_message] mov rcx,0 call [MessageBoxA] mov ecx,eax call [ExitProcess] section '.data' data readable writeable _caption db 'Win64 assembly program',0 _message db 'Hello World!',0 section '.idata' import data readable writeable dd 0,0,0,RVA kernel_name,RVA kernel_table dd 0,0,0,RVA user_name,RVA user_table dd 0,0,0,0,0 kernel_table: ExitProcess dq RVA _ExitProcess dq 0 user_table: MessageBoxA dq RVA _MessageBoxA dq 0 kernel_name db 'KERNEL32.DLL',0 user_name db 'USER32.DLL',0 _ExitProcess dw 0 db 'ExitProcess',0 _MessageBoxA dw 0 db 'MessageBoxA',0 section '.rsrc' resource data readable directory 24,manifest resource manifest,\ 1,LANG_NEUTRAL,man resdata man db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',13,10 db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',13,10 db '<dependency>',13,10 db ' <dependentAssembly>',13,10 db ' <assemblyIdentity',13,10 db ' type="win32"',13,10 db ' name="Microsoft.Windows.Common-Controls" ',13,10 db ' version="6.0.0.0"',13,10 db ' publicKeyToken="6595b64144ccf1df" ',13,10 db ' language="*" ',13,10 db ' processorArchitecture="*"/>',13,10 db ' </dependentAssembly>',13,10 db ' </dependency>',13,10 db ' <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">',13,10 db ' <security>',13,10 db ' <requestedPrivileges>',13,10 db ' <requestedExecutionLevel',13,10 db ' level="asInvoker" ',13,10 db ' uiAccess="false"/>',13,10 db ' </requestedPrivileges>',13,10 db ' </security>',13,10 db ' </trustInfo>',13,10 db ' </assembly>' endres Thank you very much for your help. |
|||
15 Oct 2019, 16:40 |
|
Walter 15 Oct 2019, 18:49
See if this works in Windows 7. I'm using Windows 10, and the reference to comctl32 was not needed.
Code: ;************* ;* Msg64.asm * ;************* format PE64 GUI 4.0 entry start include 'win64a.inc' section '.text' code readable executable start: sub rsp,8*5 invoke InitCommonControls invoke MessageBox,0,strMessage,strCaption,0 invoke ExitProcess,0 section '.data' data readable writeable strCaption db 'Msg64',0 strMessage db 'Hello!',0 section '.idata' import data readable writeable library kernel,'KERNEL32.DLL',\ user,'USER32.DLL',\ comctl32,'COMCTL32.DLL' import kernel,\ ExitProcess,'ExitProcess' import user,\ MessageBox,'MessageBoxA' import comctl32,\ InitCommonControls,'InitCommonControls' section '.rsrc' resource data readable directory RT_MANIFEST,manifest resource manifest,1,LANG_NEUTRAL,man resdata man db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">' db '<dependency><dependentAssembly><assemblyIdentity ' db 'type="win32" name="Microsoft.Windows.Common-Controls" ' db 'version="6.0.0.0" processorArchitecture="*" ' db 'publicKeyToken="6595b64144ccf1df" language="*" />' db '</dependentAssembly></dependency></assembly>' endres |
|||
15 Oct 2019, 18:49 |
|
CodeBreaker 15 Oct 2019, 19:15
It works like a charm. That's perfect. Thank you very much indeed.
|
|||
15 Oct 2019, 19:15 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.