.::SCHiM::. (02-13-2011),Auxilium (02-10-2011),Hassan (02-11-2011),Jason (02-10-2011),mookamoka3 (02-16-2011),Nightmare (11-28-2011),why06jz (02-10-2011),_Fk127_ (07-14-2011)

205
This is the ugliest injector you'll ever see.
Try to prove me wrong.
Here's the code, fools.
Globals.inc
[Highlight=ASM]
;'************************
;Main function globals
;***********************
.data
AppName db "Void's Ugly Injector",0
ClassName db "Injector",0
hwnd HWND ?
msg MSG <>
wnd WNDCLASSEX <>
hInst HINSTANCE ?
snapshot HANDLE ?
pHandle HANDLE ?
pEntry PROCESSENTRY32 <>
allocMem dd 0
processBuffer db 1024 DUP(0)
kernel32dll db "kernel32.dll",0
floadlibrary db "LoadLibraryA",0
error db "Error",0
error_1 db "Process not found!",0
;********************
;controls
;********************
buttonClass db "button",0
editClass db "edit",0
staticClass db "static",0
button1 HWND ?
button1Text db "Inject",0
button2 HWND ?
button2Text db "Browse",0
textbox1 HWND ?
textbox1Text db 0
textbox2 HWND ?
textbox2Text db 0
label1 HWND ?
label1Text db "Process: ",0
label2 HWND ?
label2Text db "DLL: ",0
fileDialog OPENFILENAME <>
filter db "DLL",0,"*.DLL"
buffer db 1024 DUP ( 0 )
[/Highlight]
Injector.asm
[Highlight=ASM]
.386
.model flat,stdcall
option casemap:none
WinMain protoWORD,
WORD,
WORD,
WORD
Inject protoWORD,
WORD
include\masm32\include\windows.inc
include\masm32\include\kernel32.inc
include\masm32\include\user32.inc
include\masm32\include\comdlg32.inc
include Globals.inc
includelib\masm32\lib\kernel32.lib
includelib\masm32\lib\user32.lib
includelib\masm32\lib\comdlg32.lib
.data
.code
start:
push NULL
call GetModuleHandle
mov hInst,eax
invoke WinMain,eax,NULL,NULL,SW_SHOWDEFAULT
invoke ExitProcess,0
WinMain proc hInstance:HINSTANCE, hPrevInstance:HINSTANCE, cmdLine:LPSTR, cmdShowWORD
mov wnd.cbSize,sizeof WNDCLASSEX
mov ebx,CS_HREDRAW
or ebx,CS_VREDRAW
mov wnd.style, ebx
mov wnd.lpfnWndProc, offset WndProc
mov ebx,hInstance
mov wnd.hInstance,ebx
mov wnd.hbrBackground,COLOR_BTNSHADOW
mov wnd.lpszClassName, offset ClassName
push IDC_ARROW
push NULL
call LoadCursor
mov wnd.hCursor,eax
invoke RegisterClassEx,addr wnd
invoke CreateWindowEx, NULL,addr ClassName,addr AppName,WS_OVERLAPPEDWINDOW,300,300,300,150,NULL,N ULL,hInstance,NULL
mov hwnd,eax
invoke ShowWindow,eax,cmdShow
;FILL OPENFILENAME STRUCT
mov fileDialog.lStructSize,sizeof fileDialog
push hwnd
pop fileDialog.hwndOwner
push hInstance
pop fileDialog.hInstance
mov fileDialog.lpstrFile,offset buffer
mov fileDialog.lpstrFilter,offset filter
mov fileDialog.nMaxFile,1024
.while TRUE
invoke GetMessage,addr msg,NULL,NULL,NULL
.break .if eax==NULL
invoke TranslateMessage, addr msg
invoke DispatchMessage, addr msg
.endw
mov eax,msg.wParam
Ret
WinMain endp
WndProc proc hWnd:HWND, Msg:UINT ,wParam:WPARAM, lParam:LPARAM
.if Msg==WM_CREATE
mov ebx,WS_CHILD
or ebx,WS_VISIBLE
or ebx, WS_BORDER
or ebx,ES_AUTOHSCROLL
invoke CreateWindowEx,NULL,addr editClass,NULL,ebx,70,30,100,20,hWnd,0,hInst,NULL ;DLL textbox
mov textbox1,eax
mov ebx,WS_CHILD
or ebx,WS_VISIBLE
or ebx, BS_DEFPUSHBUTTON
invoke CreateWindowEx,NULL,addr buttonClass,addr button2Text,ebx,190,30,60,20,hWnd,1,hInst,NULL ;browse button
mov ebx,WS_CHILD
or ebx,WS_VISIBLE
or ebx, WS_BORDER
or ebx,ES_AUTOHSCROLL
invoke CreateWindowEx,NULL,addr editClass,NULL,ebx,70,60,100,20,hWnd,0,hInst,NULL ;process textbox
mov textbox2,eax
mov ebx,WS_CHILD
or ebx,WS_VISIBLE
or ebx, BS_DEFPUSHBUTTON
invoke CreateWindowEx,NULL,addr buttonClass,addr button1Text,ebx,190,60,60,20,hWnd,2,hInst,NULL ;inject button
mov ebx,WS_CHILD
or ebx,WS_VISIBLE
invoke CreateWindowEx,NULL,addr staticClass,addr label1Text,ebx,5,60,60,20,hWnd,0,hInst,NULL ; process label
mov ebx,WS_CHILD
or ebx,WS_VISIBLE
invoke CreateWindowEx,NULL,addr staticClass,addr label2Text,ebx,35,30,30,20,hWnd,0,hInst,NULL ; DLL label
.endif
.if Msg==WM_COMMAND
mov eax,wParam
.if eax==1
invoke GetOpenFileName, addr fileDialog
.if eax != NULL
invoke SendMessage,textbox1,WM_SETTEXT,0,addr buffer
.endif
.endif
.if eax==2
invoke GetWindowText,textbox2,addr processBuffer,1024
invoke Inject, addr buffer,addr processBuffer
.endif
.endif
.if Msg==WM_CLOSE
invoke PostQuitMessage,0
.endif
invoke DefWindowProc,hWnd,Msg,wParam,lParam
Ret
WndProc EndP
Inject proc dllpathWORD,processName
WORD
mov pEntry.dwSize,sizeof pEntry
invoke CreateToolhelp32Snapshot,TH32CS_SNAPALL,0
.if eax
mov snapshot,eax
invoke Process32First,snapshot,addr pEntry
.while eax != NULL
mov ebx,offset pEntry.szExeFile
invoke lstrcmpi ,processName,ebx
.if eax==0
jmp processFound
.endif
invoke Process32Next,snapshot,addr pEntry
.endw
invoke MessageBox,NULL,addr error_1,addr error,MB_OK
Ret
processFound:
mov ebx,pEntry.th32ProcessID
invoke OpenProcess,PROCESS_ALL_ACCESS,0,ebx
mov pHandle,eax
.if eax != NULL
invoke GetModuleHandle,addr kernel32dll
invoke GetProcAddress,eax,addr floadlibrary
.if eax != NULL
mov ebx,eax
invoke VirtualAllocEx,pHandle,0,sizeof dllpath,MEM_COMMIT,PAGE_EXECUTE_READWRITE
mov allocMem,eax
invoke lstrlen,dllpath
mov edx,eax
invoke WriteProcessMemory, pHandle,allocMem,dllpath,edx,0
.if eax != NULL
mov ecx,allocMem
invoke CreateRemoteThread,pHandle,0,0,ebx,ecx,0,0
.endif
.endif
.endif
.endif
Ret
Inject EndP
end start
[/Highlight]
I used macros this time 'cause I'm lazy..
Last edited by Void; 02-11-2011 at 01:16 PM.
.::SCHiM::. (02-13-2011),Auxilium (02-10-2011),Hassan (02-11-2011),Jason (02-10-2011),mookamoka3 (02-16-2011),Nightmare (11-28-2011),why06jz (02-10-2011),_Fk127_ (07-14-2011)
Not bad i like how it looks
i like alota ugly gui's but ppl hate em
~Mohandas GandhiA man is but the product of his thoughts what he thinks, he becomes.
~ ImmortalA Genius is nothing with out an idea, An idea is always an idea even without a genius.

205
When I first assembled it and ran it, I almost cried.
Noice. No exceptions.
Wow that's nice man!!
I figure now it's my turn to go and release something tough![]()
I'm SCHiM
Morals derive from the instinct to survive. Moral behavior is survival behavior above the individual level.
Polymorphic engine
Interprocess callback class
SIN
Infinite-precision arithmetic
Hooking dynamic linkage
(sloppy)Kernel mode Disassembler!!!
Semi debugger
I like ASM so much
It's awesome.
Also you chose the best game: "WarRock.exe"![]()
Last edited by TheCamels8; 02-14-2011 at 12:14 PM.

205
Hey I post code in this section.
Here:
Code:Using System; public class Program { static void Main() { Console.WriteLine("Hello C#"); } }
"Every gun that is made, every warship launched, every rocket fired signifies, in the final sense, a theft from those who hunger and are not fed, those who are cold and are not clothed. This world in arms is not spending money alone. It is spending the sweat of its laborers, the genius of its scientists, the hopes of its children. The cost of one modern heavy bomber is this: a modern brick school in more than 30 cities. It is two electric power plants, each serving a town of 60,000 population. It is two fine, fully equipped hospitals. It is some fifty miles of concrete pavement. We pay for a single fighter plane with a half million bushels of wheat. We pay for a single destroyer with new homes that could have housed more than 8,000 people. This is, I repeat, the best way of life to be found on the road the world has been taking. This is not a way of life at all, in any true sense. Under the cloud of threatening war, it is humanity hanging from a cross of iron."- Dwight D. Eisenhower

205
Whoa. Thank you so much for posting this. I was always fascinated in low-level coding. I am, however, so confused about this memory management that you usually HAVE to use while coding in ASM. So, I have a couple of questions. Where did you start to accumulate such knowledge in memory management and Assembly? I would really love to start learning to develop low-level binaries so I can exploit hardware for piracy. ( PS3, iPhone ) Thank you so much for your time, Void!
Please organize into Code snippets, it's impossible to tell where it begins and ends. Thanks if you can.
LEGiiTxCHAOTiiC (12-09-2011)