Not sure if i should publish the whole code as some idiots might abuse it...
Code: Select all
;PatchStub v.alpha (x64)
;by Mijikai
;tested on Win 10
DataSection
Shellcode:
!db 0EBh,058h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
!db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
!db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
!db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
!db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,000h
!db 000h,000h,000h,000h,000h,000h,000h,000h,000h,000h,048h,083h,0ECh,028h,048h,0C7h
!db 0C1h,00Ah,000h,000h,000h,0FFh,015h,0B7h,0FFh,0FFh,0FFh,048h,083h,0C4h,028h,048h
!db 083h,0ECh,058h,048h,08Bh,00Dh,0B0h,0FFh,0FFh,0FFh,048h,0BAh,000h,000h,000h,0C0h
!db 000h,000h,000h,000h,04Dh,031h,0C0h,04Dh,031h,0C9h,048h,0C7h,044h,024h,020h,003h
!db 000h,000h,000h,048h,0C7h,044h,024h,028h,080h,000h,000h,000h,0FFh,015h,060h,0FFh
!db 0FFh,0FFh,048h,083h,0C4h,058h,048h,083h,0F8h,0FFh,074h,0AEh,048h,089h,005h,097h
!db 0FFh,0FFh,0FFh,048h,083h,0ECh,040h,048h,08Bh,00Dh,08Ch,0FFh,0FFh,0FFh,048h,08Bh
!db 015h,07Dh,0FFh,0FFh,0FFh,04Dh,031h,0C0h,04Dh,031h,0C9h,0FFh,015h,039h,0FFh,0FFh
!db 0FFh,048h,083h,0C4h,040h,048h,083h,0F8h,0FFh,074h,02Fh,048h,083h,0ECh,048h,048h
!db 08Bh,00Dh,064h,0FFh,0FFh,0FFh,048h,08Bh,015h,045h,0FFh,0FFh,0FFh,04Ch,08Bh,005h
!db 046h,0FFh,0FFh,0FFh,04Dh,031h,0C9h,048h,0C7h,044h,024h,020h,000h,000h,000h,000h
!db 0FFh,015h,00Ch,0FFh,0FFh,0FFh,048h,083h,0C4h,048h,048h,083h,0ECh,028h,048h,08Bh
!db 00Dh,035h,0FFh,0FFh,0FFh,0FFh,015h,0FFh,0FEh,0FFh,0FFh,048h,083h,0C4h,028h,0C3h
EndDataSection
- open the "Host.exe" that should run the shellcode.
- allocate remote memory (remotebuffer) -> stringbytesize (full path to you exe) + patchbuffersize + shellcodesize
- prepare the shellcode by patching it (starting at shellode + 2 each entry is 8 Bytes!)
- copy everything into the remotebuffer -> order: string (exe full path) | patchbuffer | shellcode
Once the shellocode is injected into the "Host.exe" it waits for your application to close.
If your application is closed it will patch your application at the offset specified in the shellcode.
The remote thread will terminate when the patching is done.