tried to get your prog running, tested with msvcrt, but the result looks very cryptic, see below. So I wanted to give you a simple example...
StatDyn.exe with msvcrt:
; #########################################################################
.386 ; force 32 bit code
.model flat, stdcall ; memory model & calling convention
option casemap :none ; case sensitive
include \masm32\include\windows.inc
; include \masm32\include\gdi32.inc
include \masm32\include\user32.inc
include \masm32\include\kernel32.inc
; include \masm32\include\masm32.inc
include macros.txt
;
;Extern defines
; EXTERNDEF Copier :PROTO :DWORD,:DWORD
; EXTERNDEF EtatMemoirePile :MEMORY_BASIC_INFORMATION
; EXTERNDEF PoriginePile:DWORD
; déclarations
.data
Hlibrairie dd 0
dd 0,0
.code
;used of the proc
;adress of the dll name IN
;example
;invoke xxx_SearchAdresse,SADR("user32.dll")
The xxx_ must be replaced by the name of the include
xxx_SearchAdresse PROC uses esi edi pNomDLL:DWORD
Local retour:DWORD
Local Hdll:DWORD
;Local [LimiteMaxPhrase]:BYTE
mov retour,0
invoke LoadLibrary,pNomDLL
mov Hlibrairie,eax
.if eax == 0
;invoke Finderrormessage, SADR("LoadLibrary failed")"
jmp FindeSearchAdresse
.endif
lea esi,ADR.. put here the name of the first data beginning by ADR
NouvelleAdresse:
mov edi,esi
add esi,4
invoke GetProcAddress,Hdll,esi
mov [edi],eax
.if eax == 0
;invoke Finderrormessage,esi
;jmp FindeSearchAdresse
.endif
;passer le nom
@@:
.if byte ptr [esi] != 0
inc esi
jmp @B
.endif
inc esi ;passe le zero de fin de nom
.if dword ptr [esi+4] != 0
jmp NouvelleAdresse
.endif
mov retour,1
FindeSearchAdresse:
mov eax,retour
ret
xxx_SearchAdresse endp
xxx_FreeLibrary PROC
invoke FreeLibrary,Hlibrairie
ret
xxx_FreeLibrary endp
end