Ir para conteúdo

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

Ridley Ramos

Cannot open include file: 'Detours.h': No such file or directo

Recommended Posts

To com um erro ao compilar um um anti hacker para um jogo aqui.

 

código que da o erro.

 

/////////Created by WarXWar Elitepvpers - Edited by Pasha37 \\\\\\\\\\\\

#define _CRT_SECURE_NO_DEPRECATE

#include "Stdafx.h"
#include <Iostream>
#include <Fstream>
#include <String>
#include <Sstream>
#include <Locale>
#include <Vector>
#include <Array>
#include <Ctime>
#include <Csignal>
#include <Sys/types.h>
#include <Sys/stat.h>
#include <Windows.h>
#include <Aclapi.h>
#include <Detours.h>
#include <Direct.h>
#include <WinSock2.h>
#include <MMSystem.h>
#include <ShellAPI.h>
#include <Windows.h>
#include <TlHelp32.h>
#include <cstdlib>
#include <iostream>
#include <TlHelp32.h>
#include <tchar.h>
#include <strsafe.h>
#include <sddl.h>
#include <cstdio>
#include <stdio.h>

#pragma comment(lib, "Detours.lib")
#pragma comment(lib, "Advapi32.lib")
#pragma comment(lib, "User32.lib")
#pragma comment(lib, "Ws2_32.lib")
#pragma comment(lib, "winmm.lib")

using namespace std;

#define MakePtr( cast, ptr, addValue ) (cast)( (DWORD)(ptr) + (addValue) )
#define MYDLL extern "C" __declspec(dllexport)

std::vector<int> Offset = { 0x34c518, 0x34c520, 0x340c5c, 0x3b2c6c, 0x340a38 };
std::string Endl = "\n";
std::string Key = \

".EPK=2E 65 69 78" + Endl + \
".EIX=2E 65 70 6B" + Endl + \
"ROOT=72 6F 6F 74" + Endl + \
"LZO1=B9 9E B0 02 6F 69 81 05 63 98 9B 28 79 18 1A 00" + Endl + \
"PONG=22 B8 B4 04 64 B2 6E 1F AE EA 18 00 A6 F6 FB 1C" + Endl;

//Baslatici Ayarlari
std::string exeLauncherName = "metin2client.exe"; //Exe Adi
std::string dllProtectionName = "Win32Project2.dll"; //Dll Adi


std::string APP_TITLE = "Metin2Client ";


////Ýþlevsiz
char *ipaddress = "46.28.204.24";
//OLD PORT
const unsigned int oldloginport = 11002;
const unsigned int oldchan1port = 13070;
const unsigned int oldchan2port = 13071;
//NEW PORT
unsigned int newloginport = 11002;
unsigned int newchan1port = 15000;
unsigned int newchan2port = 15001;
////

HANDLE ProcessHandle = GetCurrentProcess();
DWORD ProcessId = GetCurrentProcessId();
BYTE Keys[5][16];

HMODULE(__stdcall *_LoadLibraryA)(LPCSTR);
HMODULE(__stdcall *_LoadLibraryW)(LPCTSTR);

int(__stdcall *_connect)(SOCKET, const struct sockaddr*, int);

std::vector<std::string> dll = { "ntdll.dll", "NDLDL", "NTDLL.DLL", "nvinit.dll", "winmm.dll", "igdumdim32.dll", "Codex.dll", "SHFolder.dll", "PSAPI.dll", "IPHLPAPI.dll", "msacm32.drv", "wdmaud.drv", "QUARTZ.dll", "quartz.dll", "mciqtz32.dll", "nvumdshim.dll", "kernel32.dll", "kernelbase.dll", "advapi32.dll", "msvcrt.dll", "sechost.dll", "rpcrt4.dll", "dinput8.dll", "user32.dll", "gdi32.dll", "lpk.dll", "usp10.dll", "devil.dll", "imm32.dll", "msctf.dll", "oleaut32.dll", "ole32.dll", "shell32.dll", "shlwapi.dll", "speedtreert.dll", "msvcp60.dll", "version.dll", "winmm.dll", "ws2_32.dll", "nsi.dll", "d3d8.dll", "d3d8thk.dll", "dwmapi.dll", "granny2.dll", "imagehlp.dll", "mss32.dll", "python22.dll", "apphelp.dll", "aclayers.dll", "sspicli.dll", "userenv.dll", "profapi.dll", "winspool.drv", "mpr.dll", "cryptbase.dll", "uxtheme.dll", "2014clienthelper_by_therock.dll", "msvcp120d.dll", "msvcr120d.dll", "ntmarta.dll", "wldap32.dll", "mssmp3.asi", "mssvoice.asi", "mssa3d.m3d", "mssds3d.m3d", "mssdx7.m3d", "msseax.m3d", "mssrsx.m3d", "msacm32.dll", "msssoft.m3d", "mssdsp.flt", "dsound.dll", "powrprof.dll", "setupapi.dll", "cfgmgr32.dll", "devobj.dll", "clbcatq.dll", "mmdevapi.dll", "propsys.dll", "audioses.dll", "avrt.dll", "psapi.dll", "nvscpapi.dll", "nvapi.dll", "wintrust.dll", "crypt32.dll", "msasn1.dll", "nvd3dum.dll", "hid.dll", "mswsock.dll", "wshtcpip.dll", "nvspcap.dll", "secur32.dll", "comctl32.dll", "MFC42LOC.dll", "hnetdfg.dll", "urlmon.dll", "mshtml.dll", "Msimtf.dll", "d3dref8.dll" };
std::vector<std::string> dll_ext = { ".m3d", ".flt", ".asi", ".mix", "logininfo.py" };


void SignalHandler(int signum) {
ExitProcess(0);
}

int HexToDec(std::string tok2){
int Dec;
std::istringstream iss3("0x" + tok2);
iss3 >> std::hex >> Dec;
return Dec;
}

std::string strtoupper(std::string String){
std::locale Locale;
std::string StrIng = String;
for (unsigned int i = 0; i<String.length(); i++) {
StrIng = std::toupper(String, Locale);
}
return StrIng;
}

std::string strtolower(std::string String){
std::locale Locale;
std::string StrIng = String;
for (unsigned int i = 0; i<String.length(); i++) {
StrIng = std::tolower(String, Locale);
}
return StrIng;
}

std::string zerofill(int mon){
if (mon < 10) {
return "0" + std::to_string(mon);
}
else{
return std::to_string(mon);
}
}

void AddToLog(std::string lptext){
time_t t = time(NULL);
struct tm TM;
localtime_s(&TM, &t);
std::ofstream f("GamesTools/log1.txt", std::ofstream::out | std::ofstream::app);
f << "<" << 1900 + TM.tm_year << "-" << zerofill(1 + TM.tm_mon) << "-" << zerofill(TM.tm_mday) << " " \
<< zerofill(TM.tm_hour) << ":" << zerofill(TM.tm_min) << ":" << zerofill(TM.tm_sec);
f << "> - " << lptext << "." << std::endl;
f.close();
}

void ExitProc(std::string lptext){
AddToLog(lptext);
raise(SIGINT);
}

void GetKeys(){
std::istringstream iss(Key);
std::string tok;
int is;
while (std::getline(iss, tok, '\n')) {
std::istringstream iss2(tok);
std::string tok2;
int i = 0;
while (iss2 >> tok2) {
if (tok2.find("=") != std::string::npos) {
if (tok2[0] == '.' && tok2[1] == 'E' && tok2[2] == 'P' && tok2[3] == 'K') {
is = 0;
}
else if (tok2[0] == '.' && tok2[1] == 'E' && tok2[2] == 'I' && tok2[3] == 'X') {
is = 1;
}
else if (tok2[0] == 'R' && tok2[1] == 'O' && tok2[2] == 'O' && tok2[3] == 'T') {
is = 2;
}
else if (tok2[0] == 'L' && tok2[1] == 'Z' && tok2[2] == 'O' && tok2[3] == '1') {
is = 3;
}
else if (tok2[0] == 'P' && tok2[1] == 'O' && tok2[2] == 'N' && tok2[3] == 'G') {
is = 4;
}
tok2.erase(0, 5);
}
Keys[is] = HexToDec(tok2);
i++;
}
}
}

void SetPong(){
PONG:
if (!WriteProcessMemory(ProcessHandle, (LPVOID)(Offset[4] + 0x400000), Keys[4], sizeof(Keys[4]), NULL)) {
goto PONG;
}
Sleep(1000);
for (unsigned int i = 0; i<16; i++) {
int value = 0;
ReadProcessMemory(ProcessHandle, (void*)((int)(Offset[4] + 0x400000) + i), &value, sizeof(value), 0);
if ((char)value != (char)Keys[4]) {
goto PONG;
}
}
}

//IN QUESTO MODO IL CLIENT NON DA PROBLEMI
//QUESTO SETTAGGIO DELLE CHIAVI FUNZIONA COSI: SE LA CHIAVE NON VIENE SCRITTA LA RISCRIVE
void SetKeys(){
Eix:
if (!WriteProcessMemory(ProcessHandle, (LPVOID)(Offset[0] + 0x400000), Keys[0], sizeof(Keys[0]), NULL)) {
goto Eix;
}
Epk:
if (!WriteProcessMemory(ProcessHandle, (LPVOID)(Offset[1] + 0x400000), Keys[1], sizeof(Keys[1]), NULL)) {
goto Epk;
}
Root:
if (!WriteProcessMemory(ProcessHandle, (LPVOID)(Offset[2] + 0x400000), Keys[2], sizeof(Keys[2]), NULL)) {
goto Root;
}
LZO:
if (!WriteProcessMemory(ProcessHandle, (LPVOID)(Offset[3] + 0x400000), Keys[3], sizeof(Keys[3]), NULL)) {
goto LZO;
}
}

std::vector<std::string> SplitA(char Divisore, std::string StriNg){
std::istringstream Iss(StriNg);
std::string Tok;
std::vector<std::string>Vettore;
while (getline(Iss, Tok, Divisore))Vettore.push_back(Tok);
return Vettore;
}

std::vector<std::string> SplitW(char Divisore, std::wstring StriNg){
std::string STriNg(StriNg.begin(), StriNg.end());
std::istringstream Iss(STriNg);
std::string Tok;
std::vector<std::string>Vettore;
while (getline(Iss, Tok, Divisore))Vettore.push_back(Tok);
return Vettore;
}

bool Check_Element(std::string coso, std::vector<std::string> coso2){
for (unsigned int i = 0; i<coso2.size(); i++) {
if (coso2.compare(coso) == 0) {
return true;
}
}
return false;
}


BOOL CALLBACK CheckWindow(HWND hWnd, LPARAM lParam) {

char WindowName[200];
char ClassName[200];
GetWindowTextA(hWnd, WindowName, 200);
GetClassNameA(hWnd, ClassName, 200);

if (strstr(strtolower(WindowName).c_str(), "hack") \
|| strstr(strtolower(WindowName).c_str(), "cheat") \
|| strstr(strtolower(WindowName).c_str(), "ch347") \
|| strstr(strtolower(WindowName).c_str(), "3ng1n3") \
|| strstr(strtolower(WindowName).c_str(), "actool") \
|| strstr(strtolower(WindowName).c_str(), "Python Loader") \
|| strstr(strtolower(WindowName).c_str(), "Bypass") \
|| strstr(strtolower(WindowName).c_str(), "m2bob") \
|| strstr(strtolower(WindowName).c_str(), "switch-bot") \
|| strstr(strtolower(WindowName).c_str(), "switchbot")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Hile Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

if (strstr(strtolower(WindowName).c_str(), "padmak") \
|| strstr(strtolower(WindowName).c_str(), "kamer") \
|| strstr(strtolower(WindowName).c_str(), "realfreak") \
|| strstr(strtolower(WindowName).c_str(), "unpublished") \
|| strstr(strtolower(WindowName).c_str(), "musicinstructor") \
|| strstr(strtolower(WindowName).c_str(), "m2pythonloader") \
|| strstr(strtolower(WindowName).c_str(), "inject")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Uygunsuz Pencere Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

if (strstr(strtolower(WindowName).c_str(), "olly") \
|| strstr(strtolower(WindowName).c_str(), "dbg") \
|| strstr(strtolower(WindowName).c_str(), "softice") \
|| strstr(strtolower(WindowName).c_str(), "debugger") \
|| strstr(strtolower(WindowName).c_str(), "ally")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Debugger Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

if (strstr(strtolower(ClassName).c_str(), "hack") \
|| strstr(strtolower(ClassName).c_str(), "cheat") \
|| strstr(strtolower(ClassName).c_str(), "ch347") \
|| strstr(strtolower(ClassName).c_str(), "3ng1n3") \
|| strstr(strtolower(ClassName).c_str(), "actool") \
|| strstr(strtolower(ClassName).c_str(), "SysListView32") \
|| strstr(strtolower(ClassName).c_str(), "TMemoryBrowser") \
|| strstr(strtolower(ClassName).c_str(), "PROCEXPL") \
|| strstr(strtolower(ClassName).c_str(), "TreeListWindowClass") \
|| strstr(strtolower(ClassName).c_str(), "TMemoryBrowser") \
|| strstr(strtolower(ClassName).c_str(), "m2bob") \
|| strstr(strtolower(ClassName).c_str(), "switch-bot") \
|| strstr(strtolower(ClassName).c_str(), "switchbot")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Hile Tespit Edildi..");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

if (strstr(strtolower(ClassName).c_str(), "padmak") \
|| strstr(strtolower(ClassName).c_str(), "kamer") \
|| strstr(strtolower(ClassName).c_str(), "realfreak") \
|| strstr(strtolower(ClassName).c_str(), "unpublished") \
|| strstr(strtolower(ClassName).c_str(), "musicinstructor") \
|| strstr(strtolower(ClassName).c_str(), "m2pythonloader") \
|| strstr(strtolower(ClassName).c_str(), "inject")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Injector Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

if (strstr(strtolower(ClassName).c_str(), "olly") \
|| strstr(strtolower(ClassName).c_str(), "dbg") \
|| strstr(strtolower(ClassName).c_str(), "softice") \
|| strstr(strtolower(ClassName).c_str(), "debugger") \
|| strstr(strtolower(ClassName).c_str(), "ally")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Debugger Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

if (strstr(strtolower(ClassName).c_str(), "treelistwindow") \
|| strstr(strtolower(ClassName).c_str(), "syslistview") \
|| strstr(strtolower(ClassName).c_str(), "procexpl") \
|| strstr(strtolower(ClassName).c_str(), "phtree") \
|| strstr(strtolower(ClassName).c_str(), "kernel detective") \
|| strstr(strtolower(ClassName).c_str(), "detector")) {
EnableWindow(FindWindowA(NULL, APP_TITLE.c_str()), FALSE);
AddToLog("Uygunsuz Klasor Yada Dosya Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
}

return TRUE;
}

void Checkwindow() {
checkwindow:
EnumWindows(CheckWindow, 0);
Sleep(2000);
goto checkwindow;
}

HMODULE CheckLoadA(std::string lpfilename){
std::vector<std::string> casaofcoso = SplitA('\\', lpfilename);
for (std::string &i : dll) {
if (strtolower(dllProtectionName).compare(strtolower(casaofcoso[casaofcoso.size() - 1])) != 0 && strtolower(exeLauncherName).compare(strtolower(casaofcoso[casaofcoso.size() - 1])) != 0) {
if (!Check_Element(strtolower(casaofcoso[casaofcoso.size() - 1]), dll)) {
AddToLog("DLL Inject tespit edildi1: " + casaofcoso[casaofcoso.size() - 1]);
//ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
//ExitProcess(0);
return (HMODULE)0;
}
}
}
return _LoadLibraryA(lpfilename.c_str());
}


HMODULE CheckLoadW(std::wstring lptfilename){
std::string lpfilename(lptfilename.begin(), lptfilename.end());
std::vector<std::string> casaofcoso = SplitA('\\', lpfilename);
for (std::string &i : dll) {
if (strtolower(dllProtectionName).compare(strtolower(casaofcoso[casaofcoso.size() - 1])) != 0 && strtolower(exeLauncherName).compare(strtolower(casaofcoso[casaofcoso.size() - 1])) != 0) {
if (!Check_Element(strtolower(casaofcoso[casaofcoso.size() - 1]), dll)) {
AddToLog("DLL Inject tespit edildi!: " + casaofcoso[casaofcoso.size() - 1]);
//ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
//ExitProcess(0);
return (HMODULE)0;
}
}
}
return _LoadLibraryW(lptfilename.c_str());
}

int __stdcall _connectHook(SOCKET s, const struct sockaddr*name, int namelen){
unsigned int porta = ntohs((*(unsigned int*)name->sa_data));
switch (porta) {
case oldloginport:
porta = newloginport;
break;
case oldchan1port:
porta = newchan1port;
break;
case oldchan2port:
porta = newchan2port;
break;
}
sockaddr_in *coso = (sockaddr_in*)name;
coso->sin_addr.S_un.S_addr = inet_addr(ipaddress);
coso->sin_port = htons(porta);
return _connect(s, name, namelen);
}

HMODULE __stdcall _LoadLibraryHookA(LPCSTR lpfilename){
return CheckLoadA(std::string(lpfilename));
}

HMODULE __stdcall _LoadLibraryHookW(LPCTSTR lptfilename){
return CheckLoadW(std::wstring(lptfilename));
}

long CRCFILE(std::string Filename) {
FILE *f;
if ((f = fopen(Filename.c_str(), "rb")) == NULL) {
if ((f = fopen(strtoupper(Filename).c_str(), "rb")) == NULL) {
if ((f = fopen(strtolower(Filename).c_str(), "rb")) == NULL) {
return 0;
}
}
}
unsigned long size;
fseek(f, 0, SEEK_END);
size = ftell(f);
fseek(f, 0, SEEK_SET);
unsigned char *File = new unsigned char;
fread(File, 1, size, f);
fclose(f);
unsigned long crc[256];
for (unsigned int i = 0; i <= 0xFF; i++) {
unsigned long coso = 0;
unsigned long I = i;
for (unsigned int b = 1; b<9; b++) {
if (I & 1) coso |= 1 << (8 - B);
I >>= 1;
}
crc = coso << 24;
for (unsigned int c = 0; c<8; c++) crc = (crc << 1) ^ (crc & (1 << 31) ? 0x04c11db7 : 0);
unsigned long coso2 = 0;
unsigned long Ii = crc;
for (unsigned int d = 1; d<33; d++) {
if (Ii & 1) coso2 |= 1 << (32 - d);
Ii >>= 1;
}
crc = coso2;
}
unsigned long Crc = 0xffffffff;
for (unsigned int i = 0; i<size; i++) Crc = (Crc >> 8) ^ crc[(Crc & 0xFF) ^ File];
delete[] File;
return Crc ^ 0xffffffff;
}

inline void Control(){
unsigned long Flags = 0;
__asm{
mov eax, fs:[30h]
mov eax, [eax + 68h]
mov Flags, eax
}
if (Flags & 0x70) ExitProc("Debugger");
char p = 0;
__asm{
mov eax, fs:[30h]
mov al, [eax + 2h]
mov p, al
}
if (p) ExitProc("Debugger");
}

void SetPermissions(HANDLE ProcessHandle) {
EXPLICIT_ACCESS denyAccess = { 0 };
DWORD dwAccessPermissions = GENERIC_WRITE | PROCESS_ALL_ACCESS | WRITE_DAC | DELETE | WRITE_OWNER | READ_CONTROL;
BuildExplicitAccessWithName(&denyAccess, TEXT("CURRENT_USER"), dwAccessPermissions, DENY_ACCESS, NO_INHERITANCE);
PACL Pacl = NULL;
SetEntriesInAcl(1, &denyAccess, NULL, &Pacl);
SetSecurityInfo(ProcessHandle, SE_KERNEL_OBJECT, DACL_SECURITY_INFORMATION, NULL, NULL, Pacl, NULL);
LocalFree(Pacl);
CloseHandle(ProcessHandle);
SetPriorityClass(ProcessHandle, REALTIME_PRIORITY_CLASS);
}

void Mp3() {
srand((unsigned int)time(0));
int v1 = rand() % 4 + 1;
std::string mp3 = std::to_string(v1) + ".mp3";
mciSendStringA(std::string("play BGM\\" + mp3).c_str(), NULL, 0, 0);
}

void AntiPause() // By Yuri-BR
{
DWORD TimeTest1 = 0, TimeTest2 = 0;
while (true)
{
TimeTest1 = TimeTest2;
TimeTest2 = GetTickCount();
if (TimeTest1 != 0)
{
Sleep(1000);
if ((TimeTest2 - TimeTest1) > 3000)
{
AddToLog("Suspend Tespit Edildi");
ShellExecute(0, 0, L"GamesTools\\Log1.txt", 0, 0, SW_SHOW);
ExitProcess(0);
TerminateProcess(GetCurrentProcess(), 0);
}
}
}
}


void ErasePEHeaderFromMemory()
{
DWORD OldProtect = 0;

// Change memory protection - AntiRE
VirtualProtect(LPVOID(0x400000), 4096, PAGE_NOACCESS, &OldProtect);
}

void ChangeSizeOfImage(DWORD NewSize)
{

__asm
{
mov eax, fs:[0x30]
mov eax, [eax + 0x0c]
mov eax, [eax + 0x0c]
MOV DWORD PTR SS : [EAX + 0x20], 0x10000000
}

}

void AntiAttachMsg()
{

MessageBoxA(NULL, "Debugger detected", "AntiAttach", MB_OK | MB_ICONERROR);
TerminateProcess(GetCurrentProcess(), 0);

}

void AntiAttach()
{

DWORD oldProtect;
void(*dbgaddr)() = (void(*)()) GetProcAddress(GetModuleHandleA("ntdll.dll"), "DbgUiRemoteBreakin");
void(*quitaddr)() = AntiAttachMsg;
char hook[] = "\xb8\x90\x90\x90\x90\xff\xe0";



memcpy(hook + 1, &quitaddr, sizeof(quitaddr));

if (VirtualProtect(dbgaddr, sizeof(hook), PAGE_EXECUTE_READWRITE, &oldProtect)){

memcpy(dbgaddr, hook, sizeof(hook));
VirtualProtect(dbgaddr, sizeof(hook), oldProtect, &oldProtect);
}


}

void BlockInject(HANDLE hProcess, LPCWSTR libName, CHAR* apiName)
{
DWORD pRet[] = { 0xC3 };
WriteProcessMemory(hProcess, (LPVOID)(VOID*)GetProcAddress(LoadLibrary(libName), apiName), (LPVOID)pRet, sizeof(pRet), 0);
}

void StartDefending()
{
BlockInject(GetCurrentProcess(), (LPCWSTR)"NTDLL.DLL", "LdrLoadDll");
}

inline bool IsDbgPresentPrefixCheck()
{
__try
{
__asm __emit 0xF3 // 0xF3 0x64 disassembles as PREFIX REP:
__asm __emit 0x64
__asm __emit 0xF1 // One byte INT 1
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return false;
}

return true;
}

inline bool CheckDbgPresentCloseHandle()
{
HANDLE Handle = (HANDLE)0x8000;
__try
{
CloseHandle(Handle);
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return true;
}

return false;
}

inline bool Int2DCheck()
{
__try
{
__asm
{
int 0x2d
xor eax, eax
add eax, 2
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
return false;
}

return true;
}

bool BlockAccess()
{
HANDLE hProcess = OpenProcess(PROCESS_ALL_ACCESS, true, GetCurrentProcessId());
SECURITY_ATTRIBUTES sa;
TCHAR * szSD = TEXT("D:P");
TEXT("(D;OICI;GA;;;BG)");
TEXT("(D;OICI;GA;;;AN)");
sa.nLength = sizeof(SECURITY_ATTRIBUTES);
sa.bInheritHandle = false;

if (!ConvertStringSecurityDescriptorToSecurityDescriptor(szSD, SDDL_REVISION_1, &(sa.lpSecurityDescriptor), NULL))
return false;

if (!SetKernelObjectSecurity(hProcess, DACL_SECURITY_INFORMATION, sa.lpSecurityDescriptor))
return true;

return true;
}
// IsInsideVPC's exception filter
DWORD __forceinline IsInsideVPC_exceptionFilter(LPEXCEPTION_POINTERS ep)
{
PCONTEXT ctx = ep->ContextRecord;

ctx->Ebx = -1; // Not running VPC
ctx->Eip += 4; // skip past the "call VPC" opcodes
return EXCEPTION_CONTINUE_EXECUTION;
// we can safely resume execution since we skipped faulty instruction
}

// High level language friendly version of IsInsideVPC()
bool IsInsideVPC()
{
bool rc = false;

__try
{
_asm push ebx
_asm mov ebx, 0 // It will stay ZERO if VPC is running
_asm mov eax, 1 // VPC function number

// call VPC
_asm __emit 0Fh
_asm __emit 3Fh
_asm __emit 07h
_asm __emit 0Bh

_asm test ebx, ebx
_asm setz[rc]
_asm pop ebx
}
// The except block shouldn't get triggered if VPC is running!!
__except (IsInsideVPC_exceptionFilter(GetExceptionInformation()))
{
}

return rc;
}

bool IsInsideVMWare()
{
bool rc = true;

__try
{
__asm
{
push edx
push ecx
push ebx

mov eax, 'VMXh'
mov ebx, 0 // any value but not the MAGIC VALUE
mov ecx, 10 // get VMWare version
mov edx, 'VX' // port number

in eax, dx // read port
// on return EAX returns the VERSION
cmp ebx, 'VMXh' // is it a reply from VMWare?
setz[rc] // set return value

pop ebx
pop ecx
pop edx
}
}
__except (EXCEPTION_EXECUTE_HANDLER)
{
rc = false;
}

return rc;
}

bool Inject(DWORD dwPid, LPTHREAD_START_ROUTINE lpStartProc, LPVOID lpParam)
{
HMODULE hModule, hNewModule;
DWORD dwSize;
HANDLE hProcess;

PIMAGE_DOS_HEADER pDH;
PIMAGE_NT_HEADERS pPE;

if ((hProcess = OpenProcess(PROCESS_ALL_ACCESS, FALSE, dwPid)) == NULL)
return FALSE;

hModule = GetModuleHandle(NULL);

pDH = (PIMAGE_DOS_HEADER)hModule;
pPE = (PIMAGE_NT_HEADERS)((LPSTR)pDH + pDH->e_lfanew);

dwSize = pPE->OptionalHeader.SizeOfImage;

LPVOID lpNewAddr = VirtualAlloc(NULL, dwSize, MEM_COMMIT, PAGE_READWRITE);
if (lpNewAddr == NULL)
return FALSE;

CopyMemory(lpNewAddr, hModule, dwSize);

hNewModule = (struct HINSTANCE__ *)VirtualAllocEx(hProcess, NULL, dwSize, MEM_COMMIT, PAGE_EXECUTE_READWRITE);
if (hNewModule == NULL)
return FALSE;

if (WriteProcessMemory(hProcess, hNewModule, lpNewAddr, dwSize, NULL) == 0)
return FALSE;

DWORD dwThread = (DWORD)lpStartProc - (DWORD)hModule + (DWORD)hNewModule;

if (CreateRemoteThread(hProcess, 0, 0, (LPTHREAD_START_ROUTINE)dwThread, lpParam, 0, NULL) == NULL)
return FALSE;

return TRUE;
}



MYDLL void Main(){
__asm{
push ss
pop ss
mov eax, 9
xor edx, edx
}
/////////////---------Ayarlar
//GetKeys();
//SetPong();
//SetKeys();

Control();
OutputDebugString(TEXT("%s%s%s%s%s%s%s%s%s%s%s")TEXT("%s%s%s%s%s%s%s%s%s%s%s%s%s")TEXT("%s%s%s%s%s%s%s%s%s%s%s%s%s")TEXT("%s%s%s%s%s%s%s%s%s%s%s%s%s"));
void ErasePEHeaderFromMemory();
ChangeSizeOfImage(0x100000);
void AntiAttachMsg();
void AntiAttach();
bool Inject();
bool IsDbgPresentPrefixCheck(); //Instruction Prefixes
bool CheckDbgPresentCloseHandle(); //CheckCloseHandle
bool Int2DCheck();
bool BlockAccess();
bool IsInsideVPC();
bool IsInsideVMWare();

SetPermissions(ProcessHandle);
signal(SIGINT, SignalHandler);
std::ofstream f("GamesTools/Log1.txt", std::ofstream::out);
f << "Games-Tools V4 Baslatildi: " << __DATE__ << " " << __TIME__ << std::endl;
f.close();
_LoadLibraryA = (HMODULE(__stdcall*)(LPCSTR))DetourFunction((PBYTE)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "LoadLibraryA"), (PBYTE)_LoadLibraryHookA);
_LoadLibraryW = (HMODULE(__stdcall*)(LPCTSTR))DetourFunction((PBYTE)GetProcAddress(GetModuleHandleA("Kernel32.dll"), "LoadLibraryW"), (PBYTE)_LoadLibraryHookW);
//_connect = (int(__stdcall*)(SOCKET, const struct sockaddr*, int))DetourFunction((PBYTE)GetProcAddress(GetModuleHandleA("Ws2_32.dll"), "connect"), (PBYTE)_connectHook);
HANDLE Thread = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Checkwindow, 0, 0, 0);
HANDLE Thread2 = CreateThread(0, 0, (LPTHREAD_START_ROUTINE)Mp3, 0, 0, 0);
HANDLE Thread3 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)AntiPause, NULL, 0, NULL); // By Yuri-BR
HANDLE Thread4 = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)StartDefending, NULL, 0, NULL);
SetThreadPriority(Thread, THREAD_PRIORITY_HIGHEST);
SetThreadPriority(Thread2, THREAD_PRIORITY_NORMAL);
SetThreadPriority(Thread3, THREAD_PRIORITY_NORMAL);
SetThreadPriority(Thread4, THREAD_PRIORITY_NORMAL);
}



BOOL APIENTRY DllMain(HMODULE hModule, DWORD ul, LPVOID lpReserved) {
if (ul == DLL_PROCESS_ATTACH) {
Main();
}
return TRUE;
}

erro

 

1>------ Rebuild All started: Project: Win32Project2, Configuration: Release Win32 ------
1> dllmain.cpp
1>dllmain.cpp(19): fatal error C1083: Cannot open include file: 'Detours.h': No such file or directory
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

 

 

 

NOVO ERRO

dllmain.cpp(397): error C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings
1>          C:\Program Files (x86)\Windows Kits\8.1\Include\um\WinSock2.h(1850) : see declaration of 'inet_addr'
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Alguém sabe como posso resolver isso? to usando o Visual Studio 2013.

Compartilhar este post


Link para o post
Compartilhar em outros sites


NOVO ERRO

 

dllmain.cpp(397): error C4996: 'inet_addr': Use inet_pton() or InetPton() instead or define _WINSOCK_DEPRECATED_NO_WARNINGS to disable deprecated API warnings

1> C:\Program Files (x86)\Windows Kits\8.1\Include\um\WinSock2.h(1850) : see declaration of 'inet_addr'

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.