Windows DLL для PE (x86) - PullRequest
       14

Windows DLL для PE (x86)

0 голосов
/ 09 ноября 2019

У меня есть пример кода, который использует следующие заголовки:

#include <stdio.h>
#include <string.h>
#include <stdlib.h>

Я хочу использовать dll для того, чтобы использовать некоторые функции из этих заголовков (поскольку наше назначение - построить PE).

Например, для использования printf я вызываю

  1. LoadLibrary ("msvcrt.dll")

  2. FindFunction ("GetProcAddress")

  3. GetProcAddress (msvcrt, "printf")

со следующим кодом:

push 0x0            ; pushing null
push 0x41797261     ; pushing A,y,r,a
push 0x7262694c     ; pushing r,b,i,L
push 0x64616f4c     ; pushing d,a,o,L
push esp            ; push pointer for "LoadLibraryA"

call FindFunction   ; call FindFunction("LoadLibraryA")
add esp, 0x14       ; clear stack

push 0x00006c6c     ; pushing null,l,l
push 0x642e7472     ; pushing d,.,t,r
push 0x6376736d     ; pushing c,v,s,m
push esp

call eax            ; call LoadLibrary("msvcrt.dll")
add esp, 0x0c       ; clear stack (note arguments are cleared already)

push eax            ; store module handle for msvcrt
push 0x00007373     ; pushing null,s,s
push 0x65726464     ; pushing e,r,d,d
push 0x41636f72     ; pushing A,c,o,r
push 0x50746547     ; pushing P,t,e,G
push esp            ; push pointer for "GetProcAddress"

call FindFunction   ; call FindFunction("GetProcAddress")
add esp, 0x14       ; clear stack
pop ebx             ; restore module handle for msvcrt

push 0x00006674     ; pushing null,f,t
push 0x6e697270     ; pushing n,i,r,p
push esp            ; push pointer for "printf"
push ebx            ; push module handle for msvcrt

call eax            ; call GetProcAddress(msvcrt, "printf")

Но я не могу найти, в каких DLLследующие функции:

  1. scanf - я предполагаю, что он находится в том же dll, что и printf
  2. strtok
  3. strcmp
  4. itoa
  5. strcat

Спасибо.

...