我有一个使用以下标头的代码示例:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
我想使用dll来使用这些标头中的某些功能(因为我们的工作是建立PE)。
例如使用我打给printf的
-
Loadlibrary(“ msvcrt.dll”)
-
FindFunction(“ GetProcAddress”)
- 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
push 0x65726464 ; pushing e,d,d
push 0x41636f72 ; pushing A,c,r
push 0x50746547 ; pushing P,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,p
push esp ; push pointer for "printf"
push ebx ; push module handle for msvcrt
call eax ; call GetProcAddress(msvcrt,"printf")
但是我似乎找不到以下功能在哪个dll中:
- scanf-我认为它与printf在同一个dll中
- strtok
- strcmp
- itoa
- strcat
谢谢。