32位程序注入64位程序

2021-06-06 00:06:58 字數 1331 閱讀 9300

#include #include #define makerex(w,r,x,b) __asm __emit 0100##w##r##x##b##b

#define rep __asm __emit 0xf3

#pragma pack(1)

typedef struct _stubargs

stubargs,*pstubargs;

#pragma pack()

__declspec(naked) void __stdcall stubto64(void)

}__declspec(naked) __int64 __cdecl lcall(void*off,unsigned short seg,...)//__int64 func,unsigned argc,...)

#define call64proc(addr,argc,...) lcall(stubto64,0x33,(unsigned __int64)addr,argc,__va_args__)

#define to64(x) ((__int64)(x))

hmodule getnativentdll(void)

} lastone=(char*)mbi.allocationbase;

} return ntdll;

}void* getprocaddress64(const void*baseaddress,const char*name)

} }return 0;

}handle createthread64(handle processhandle,void*threadproc,void*parameter,int suspended)

typedef struct _unicode_string64

unicode_string64, *punicode_string64;

hmodule injectlibrary64(handle processhandle,wchar_t*name,unsigned short namelength)

static struct

pre=;

buf=virtualallocex(processhandle,0,namelength+sizeof pre+stublen,mem_commit|mem_reserve,page_execute_readwrite);

if(buf)

closehandle(hthread);

} virtualfreeex(processhandle,buf,0,mem_release);

} return 0;

}int _tmain()

64位程序和32位程序通訊問題

最近遇到乙個問題,64位程式向32位程式傳送乙個wm copydata訊息,發現傳遞的資料和收到的資料不對 函式 如下,typedef struct tagcopydatastruct copydatastruct,pcopydatastruct 傳送方 64位程式 void csenddlg on...

易語言64位程序注入DLL

今天就先來講解下用易語言注入dll到64位程式程序,由於windows的安全機制 現在程式分32位和64位,導致乙個問題的出現 32位程式無法載入64位程式dll,64位程式無法載入32位程式dll。通俗點說就是 在64位的windows系統中,乙個64位程序不能載入乙個32位dll,乙個32位程序...

64位程序呼叫32位dll的解決方法

最近做在windows xp x64,vs2005環境下做32位程式編譯為64位程式的工作,遇到了一些64位程式設計中可能遇到的問題 如內聯彙編 解決方法改為c c long型別的變化,最關鍵的遇到了64位程序需要呼叫32位dll的問題。由於有一些32位dll沒有源 無法重新編譯為64位dll,所以...