Simple python script to automate the menial task of thinking about random hexadecimal digits and if they are 100% random from the ones used before.
Instructions:
1). Download python2.7 from the official website. Install it.
2). Double click on the file given below called Auto_Injector.py and you will get 2 files if all went well.
3). todelete.cpp and Main.cpp, pretty self explanatory, delete the one that says todelete, and main.cpp is your injector source, ready to be compiled. Don't worry about the todelete file, its just needed until I figure out a way to randomize better. (Delete your Main.cpp and todelete.cpp everytime you want to get a new source file.)
Thanks if you liked it!
Source code:
Code:
import os,binascii
import random
import re
import sys
#############################################
# Making shit easier and faster. #
#############################################
code = """
#include <iostream>
#include <Windows.h>
#include <TlHelp32.h>
// Change "MY_DLL_NAME.dll" to your dll name
#define DLL_NAME "cheat.dll"
// And you need:
// 1. change all bytes(0x00, 0x01, 0x03....) in define "JUNKS" to random bytes
// 2. change size this block by add new bytes
#define JUNKS \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
__asm _emit 0x{} \
// Don't change this!
#define _JUNK_BLOCK(s) __asm jmp s JUNKS __asm s:
/////////////////////////////////////////////////////////////////////////////////////
// INJECTOR CODE //
/////////////////////////////////////////////////////////////////////////////////////
DWORD Process(char* ProcessName)
{
_JUNK_BLOCK(jmp_label1)
HANDLE hPID = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, NULL);
_JUNK_BLOCK(jmp_label2)
PROCESSENTRY32 ProcEntry;
_JUNK_BLOCK(jmp_label3)
ProcEntry.dwSize = sizeof(ProcEntry);
_JUNK_BLOCK(jmp_label4)
do
{
_JUNK_BLOCK(jmp_label5)
if (!strcmp(ProcEntry.szExeFile, ProcessName))
{
_JUNK_BLOCK(jmp_label6)
DWORD dwPID = ProcEntry.th32ProcessID;
_JUNK_BLOCK(jmp_label7)
CloseHandle(hPID);
_JUNK_BLOCK(jmp_label8)
return dwPID;
}
_JUNK_BLOCK(jmp_label9)
}
while (Process32Next(hPID, &ProcEntry));
_JUNK_BLOCK(jmp_label10)
}
int main()
{
_JUNK_BLOCK(jmp_label11)
DWORD dwProcess;
_JUNK_BLOCK(jmp_label12)
char myDLL[MAX_PATH];
_JUNK_BLOCK(jmp_label13)
GetFullPathName(DLL_NAME, MAX_PATH, myDLL, 0);
_JUNK_BLOCK(jmp_label4)
dwProcess = Process("csgo.exe");
_JUNK_BLOCK(jmp_label15)
HANDLE hProcess = OpenProcess(PROCESS_CREATE_THREAD | PROCESS_QUERY_INFORMATION | PROCESS_VM_READ | PROCESS_VM_WRITE | PROCESS_VM_OPERATION, FALSE, dwProcess);
_JUNK_BLOCK(jmp_label16)
LPVOID allocatedMem = VirtualAllocEx(hProcess, NULL, sizeof(myDLL), MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE);
_JUNK_BLOCK(jmp_label17)
WriteProcessMemory(hProcess, allocatedMem, myDLL, sizeof(myDLL), NULL);
_JUNK_BLOCK(jmp_label18)
CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)LoadLibrary, allocatedMem, 0, 0);
_JUNK_BLOCK(jmp_label19)
CloseHandle(hProcess);
_JUNK_BLOCK(jmp_label20)
return 0;
_JUNK_BLOCK(jmp_label21)
}
"""
f2 = re.sub('{}', lambda _: binascii.b2a_hex(os.urandom(1)) + ' \\' + '\n', code)
f1=open('./todelete.cpp', 'a+')
f1.write(str(f2))
f1.close()
def uniquelines(lineslist):
unique = {}
result = []
for item in lineslist:
if item.strip() in unique: continue
unique[item.strip()] = 1
result.append(item)
return result
file1 = open("todelete.cpp","r")
filelines = file1.readlines()[0:50]
file1.close()
output = open("Main.cpp","w")
output.writelines(uniquelines(filelines))
output.close()
file2 = open("todelete.cpp","r")
filelines2 = file2.readlines()[51:129]
yo = open("Main.cpp.","a")
yo.writelines(filelines2)
yo.close()
file2.close()
~ Virus scans:
https://www.virustotal.com/#/file/6a...5153/detection
https://virusscan.jotti.org/en-US/fi...job/70b357wj64