Versión por argumentos, agradecimientos a Space.Medafighter.X
Saludos!
Código (asm) [Seleccionar]
;Busca offsets cli - by pablomi
.386
.model flat, stdcall
option casemap :none
include \masm32\include\masm32rt.inc
includelib \masm32\lib\kernel32.lib
includelib \masm32\lib\user32.lib
includelib \masm32\lib\masm32.lib
.data
error db "No se encontro la funcion.",0
.data?
libreriaTMP dd ?
libreria db 256 dup(?)
funcionTMP dd ?
funcion db 256 dup(?)
argc dd ?
.code
codigo:
invoke GetCommandLineW
invoke CommandLineToArgvW, eax, addr argc
or eax, eax
cmp dword ptr argc, 3
jb @f
mov ebx, dword ptr[eax+4]
mov dword ptr libreriaTMP, ebx
mov ebx, dword ptr[eax+8]
mov dword ptr funcionTMP, ebx
invoke WideCharToMultiByte,CP_ACP,0,dword ptr libreriaTMP,-1,addr libreria,256d,0,0
invoke WideCharToMultiByte,CP_ACP,0,dword ptr funcionTMP,-1,addr funcion,256d,0,0
invoke LoadLibrary, addr libreria
invoke GetProcAddress, eax, addr funcion
or eax, eax
je Error
invoke StdOut, uhex$(eax)
invoke ExitProcess, 0
Error:
invoke StdOut, addr error
@@: invoke ExitProcess, 0
end codigo
CitarC:\Users\Pablo\Desktop>bOffsets msvcrt.dll system
7545B16F
C:\Users\Pablo\Desktop>bOffsets msvcrt.dll printf
7541C5B9
C:\Users\Pablo\Desktop>
Saludos!