flat assembler
Message board for the users of flat assembler.
Index
> Windows > (gelöst)The DLL file isn't working—who can help me? |
| Author |
|
|
Harald2026 11 May 2026, 16:29
Hallo Leute
Dieses DLL Programm lässt sich starten aber er vermittelt nur eine null als Ergebnis. Was hab ich da falsch gemacht ??? TestA wird übergeben und sollte 16 als Ergebnis bringen Hi everyone, This DLL program launches successfully, but it only returns a zero as the result. What did I do wrong here? TestA is passed as input and should yield 16 as the result. format PE64 console DLL entry DllEntryPoint include 'win64a.inc' section '.text' code readable executable proc DllEntryPoint hinstDLL,fdwReason,lpvReserved mov eax,TRUE ret endp ; Funktion: Add(a, b) -> eax = a + b proc AddHar , TestA mov RAX,[TestA] ADD rax,0x00000010 MOV [TestA],rax ret endp ;section '.bss' data readable writeable ;TestA dq ? section '.edata' export data readable writeable export 'TestH.DLL',\ AddHar, 'AddHar' section '.reloc' fixups data readable discardable if $=$$ dd 0,8 ; if there are no fixups, generate dummy entry end if ;section '.idata' import data readable writeable ;library kernel32,'KERNEL32.DLL' ;include 'api/kernel32.inc' invoke AddHar ,TestA ;warum ????? DLL geht nicht !!!! MOV RAX,[TestA] (TestA = 0)
Last edited by Harald2026 on 12 May 2026, 10:24; edited 3 times in total |
|||||||||||
|
|
revolution 11 May 2026, 16:35
404: DLL not found.
Please post the sources. |
|||
|
|
Core i7 11 May 2026, 18:25
For example: DLL library
Code: format pe64 console dll include 'win64ax.inc' entry DllEntry ;//------------- section '.text' code readable executable proc DllEntry uses rbx rsi rdi, hDLL,Reason,Rsv mov eax,1 ret endp align 16 proc AddHar uses rbx rsi rdi mov rax,rcx add rax,0x10 ret endp ;//------------- section '.edata' export data readable writeable export 'TestH.dll',AddHar,'AddHar' ;//------------- section '.reloc' fixups data discardable if $=$$ dd 0,8 end if And application: Code: format pe64 console include 'win64ax.inc' entry start ;//------------- .data buff dq 0 ;//------------- section '.text' code readable executable start: sub rsp,8 cinvoke printf,<10,' Enter dec value: ',0> cinvoke scanf,'%llu',buff mov rcx,[buff] stdcall [AddHar] xchg rdx,rax cinvoke printf,< ' Result.........: %llu',0>,rdx cinvoke getch cinvoke exit,0 section '.idata' import data readable writeable library msvcrt,'msvcrt.dll',TestH,'TestH.dll' import msvcrt,printf,'printf',scanf,'scanf',\ getch,'_getch', exit, 'exit' import TestH, AddHar,'AddHar'
|
||||||||||
|
||||||||||
|
Harald2026 11 May 2026, 21:19
Ich schau mir das mal an. Vielen Dank in voraus...
I'll take a look at that. Thanks in advance... |
|||
|
|
Harald2026 12 May 2026, 10:16
Hallo , mit ein wenig Änderungen hat es endlich Funktioniert , danke dir für deine Hilfe
Hello, with a few minor changes, it finally worked—thank you for your help! format pe64 console dll include 'win64ax.inc' entry DllEntry ;//------------- section '.text' code readable executable proc DllEntry uses rbx rsi rdi, hDLL,Reason,Rsv mov eax,1 ret endp align 16 proc AddHar uses rbx rsi rdi mov rax,rcx add rax,32768 ret endp ;//----------------------------- ;// Or just read RCX: ;//----------------------------- ;//------------- section '.edata' export data readable writeable export 'TestH.dll',AddHar,'AddHar' ;//------------- section '.reloc' fixups data discardable if $=$$ dd 0,8 end if MYPrrogramm eingesetzt CMP [STOPCode],0 JNE FGH ;cinvoke scanf,'%llu',TestA MOV RCX,[TestA] stdcall [AddHar] ;warum ????? DLL geht nicht !!!! ;MOV rdx,rax MOV [TestA],rax FGH: |
|||
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.