文件名称:从内存中调用DLL函数的源代码,鄙视MemLibLoader不开源
文件大小:3KB
文件格式:RAR
更新时间:2017-02-05 04:52:53
Delphi
找了个7z的Delphi源码,发现MemLibLoader未开源,其实就是从内存中调用DLL函数,从网上找了些代码拼了一个,以下函数申明方式全部从MemLibLoader照抄 function _LoadLibraryA(FileName:PAnsiChar):DWORD; function _LoadLibraryW(FileName:PWideChar):DWORD; function _LoadLibraryFromResourceA(Instance:DWORD;Name,ResType:PAnsiChar):DWORD; function _LoadLibraryFromResourceW(Instance:DWORD;Name,ResType:PWideChar):DWORD; function _LoadLibraryFromResourceIDA(Instance:DWORD;ResID:Integer;ResType:PAnsiChar):DWORD; function _LoadLibraryFromResourceIDW(Instance:DWORD;ResID:Integer;ResType:PWideChar):DWORD; function _GetProcAddress(hMoudle:DWORD;lpProcName:PAnsiChar):Pointer; stdcall; function _GetProcAddressA(hMoudle:DWORD;lpProcName:PAnsiChar):Pointer; stdcall; function _GetProcAddressW(hMoudle:DWORD;lpProcName:PAnsiChar):Pointer; stdcall; function _LoadLibraryMem(lpMemory:Pointer):DWORD; procedure _FreeLibrary(hMoudle:DWORD); 不过_LoadMemRunExe函数目前无法体会原作者的意图,未加上去。D7下嵌入7z源代码有效,其他环境为测试。
【文件预览】:
MemLibrary.pas