經典dll injection,使用幾個WinAPI的組合
- OpenProcess取得remote process HANDLE
- VirtualAllocEx在remote process上申請空間
- WriteProcessMemory寫入要注入的dll路徑
- GetProcAddress取得LoadLibraryW的地址,這步要確認一下當前的kernel32.dll載入到當前(dll injector.exe)的process跟載入到remote process的virtual address是不是相同,必須要相同,否則當前process的LoadLibraryW的address就不會是remote process中LoadLibraryW的address
- CreateRemoteThread讓remote process新建thread去執行LoadLibraryW注入dll