Skip to content
MPGHThe Dark Arts
/
RegisterLog in
Forum
Community
What's NewLatest posts across the boardTrendingHottest threads right nowSubscribedThreads you follow
Discussion
GeneralIntroductionsEntertainmentDebate FortFlaming & Rage
Board
News & AnnouncementsMPGH TimesSuggestions & HelpGiveaways
More Sections
Art & Graphic DesignProgrammingHackingCryptocurrency
Hacks & Cheats
Games
ValorantCS2 / CS:GOCall of Duty / WarzoneFortniteApex LegendsEscape From Tarkov
+14 moreLeague of LegendsGTA VMinecraftRustROTMGBattlefieldTroveBattleOnCombat ArmsCrossFireBlackshotRuneScapeDayZDead by Daylight
Resources
Game Hacking TutorialsReverse EngineeringGeneral Game HackingAnti-CheatConsole Game Hacking
Tools
Game Hacking ToolsTrainers & CheatsHack/Release NewsNew
Submit a release →Share your cheat, tool, or config with the community.
AINEW
AI Tools
General & DiscussionPrompt EngineeringLLM JailbreaksHotAI Agents & AutomationLocal / Open Models
AI × Gaming
AI Aimbots & VisionML Anti-CheatGame Bots & Automation
Create
AI Coding / Vibe CodingAI Art & MediaAI Voice & TTS
The AI frontier →Where game hacking meets modern machine learning. Jump in.
Marketplace
Buy & Sell
SellingBuyingTradingUser Services
Trust & Safety
Middleman LoungeMarketplace TalkVouch Copy Profiles
Money
Cryptocurrency TalkCurrency ExchangeWork & Job Offers
Start selling →List accounts, services, and goods. Use the middleman to trade safe.
MPGH The Dark Arts

A community for offensive security research, reverse engineering, and AI.

Community

ForumMarketplaceSearch

Account

RegisterLog in

Legal

Privacy PolicyForum RulesHelp & FAQ
© 2026 MPGH · All rights reserved.Built by the community, for the community. For educational purposes onlyContent is shared for security research and education — we don't condone illegal use. You're responsible for complying with applicable laws. Use at your own risk.
Home › Forum › Programming › Other Programming › Assembly › [MASM]Injector.

[MASM]Injector.

Posts 1–15 of 15 · Page 1 of 1
Void
Void
[MASM]Injector.
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 proto WORD,WORD,WORD,WORD
Inject proto WORD,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,processNameWORD

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..
#1 · edited 15y ago · 15y ago
cosconub
cosconub
Not bad i like how it looks

i like alota ugly gui's but ppl hate em
#2 · 15y ago
Void
Void
When I first assembled it and ran it, I almost cried.
#3 · 15y ago
Auxilium
Auxilium
Noice. No exceptions.
#4 · 15y ago
.::SCHiM::.
.::SCHiM::.
Wow that's nice man!!
I figure now it's my turn to go and release something tough
#5 · 15y ago
TheCamels8
TheCamels8
I like ASM so much
It's awesome.
Also you chose the best game: "WarRock.exe"
#6 · edited 15y ago · 15y ago
Void
Void
Quote Originally Posted by .::SCHiM::. View Post
Wow that's nice man!!
I figure now it's my turn to go and release something tough
I was hoping someone other than me would post code in this section.

Can't wait for your release of whatever it is you're working on.
#7 · 15y ago
why06
why06
Hey I post code in this section.

Here:
Code:
Using System;
public class Program
{
static void Main()
{
Console.WriteLine("Hello C#");
}
}
#8 · 15y ago
Void
Void
Quote Originally Posted by why06 View Post
Hey I post code in this section.

Here:
Code:
Using System;
public class Program
{
static void Main()
{
Console.WriteLine("Hello C#");
}
}
yeah, sure you do. ):
#9 · 15y ago
graysonmanolov
graysonmanolov
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!
#10 · 15y ago
LEGiiTxCHAOTiiC
LEGiiTxCHAOTiiC
Please organize into Code snippets, it's impossible to tell where it begins and ends. Thanks if you can.
#11 · 14y ago
'Bruno
'Bruno
Quote Originally Posted by LEGiiTxCHAOTiiC View Post
Please organize into Code snippets, it's impossible to tell where it begins and ends. Thanks if you can.
Obviously random that don't know what happens/happened in this section.. /facepalm
#12 · 14y ago
LEGiiTxCHAOTiiC
LEGiiTxCHAOTiiC
Quote Originally Posted by Brinuz View Post
Obviously random that don't know what happens/happened in this section.. /facepalm
You're right about me not knowing what happened, please explain. I'm not new to the forums however.
#13 · 14y ago
'Bruno
'Bruno
Quote Originally Posted by LEGiiTxCHAOTiiC View Post
You're right about me not knowing what happened, please explain. I'm not new to the forums however.
check his post and you will find in there [Highlight=ASM]
It was the old tags that this forum had.. for code.
So, thats why the code looks so messy now..
#14 · 14y ago
LEGiiTxCHAOTiiC
LEGiiTxCHAOTiiC
Quote Originally Posted by Brinuz View Post
check his post and you will find in there [Highlight=ASM]
It was the old tags that this forum had.. for code.
So, thats why the code looks so messy now..
Oh ok, I'm still getting used to the new look and everything, thanks for telling me.
#15 · 14y ago
Posts 1–15 of 15 · Page 1 of 1

Post a Reply

Tags for this Thread

None