Mafia Coderz
Gusto mo bang maexperience ang isang napaka LUPIT na hideout ng mga cheaters and buggers? Dito mo lang yan matatagpuan sa IntensityPros! Smile Gusto mo din bang maka acquire ng mga gusto mo in cyber for FREE? Register ka lang! Kaya ano pang hinihintay mo? Join us Now!
Mafia Coderz
Gusto mo bang maexperience ang isang napaka LUPIT na hideout ng mga cheaters and buggers? Dito mo lang yan matatagpuan sa IntensityPros! Smile Gusto mo din bang maka acquire ng mga gusto mo in cyber for FREE? Register ka lang! Kaya ano pang hinihintay mo? Join us Now!
Mafia Coderz
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Mafia Coderz

Where gaming don't need skills.
 
HomeSearchLatest imagesRegisterLog in
DMCA.com
Log in
Username:
Password:
Log in automatically: 
:: I forgot my password
Who is online?
In total there is 1 user online :: 0 Registered, 0 Hidden and 1 Guest

None

Most users ever online was 12 on Sat Aug 17, 2013 1:09 pm
Latest topics
» PHO SF DFI PUBLIC HACK 1.20
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptyThu Oct 31, 2013 4:08 pm by banaykazuki01

» MafiaCoderz Cf Hack
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptyThu Sep 05, 2013 4:25 pm by Heneral2010

»  TOPIC: [MOD]POP CORN MOD (READ 4830 TIMES)
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptyThu Sep 05, 2013 8:07 am by Heneral2010

» Read Before Applying!
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptySun Sep 01, 2013 10:12 am by j@cKaZzz 143

» Coding Tutorials
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptySun Sep 01, 2013 10:08 am by j@cKaZzz 143

» READ BEFORE YOU POST
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptySun Sep 01, 2013 10:08 am by j@cKaZzz 143

» [MOD]DFI SF MOD, KILLMARK, SOUND ETC (READ 5623 TIMES)
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptyMon Aug 26, 2013 11:31 am by j@cKaZzz 143

»  LNL LOADER WALLHACK LOADER! V7
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptyMon Aug 26, 2013 11:28 am by j@cKaZzz 143

» OneHitCf By:TheMvT
[SOURCECODE] KILLHACK CODE  By:TheMvT EmptyMon Aug 26, 2013 11:28 am by j@cKaZzz 143


 

 [SOURCECODE] KILLHACK CODE By:TheMvT

Go down 
AuthorMessage
TheMvT
Administrators
Administrators
TheMvT


Posts : 56
Join date : 16/08/2013
Age : 26
Location : MafiaCoderz

[SOURCECODE] KILLHACK CODE  By:TheMvT Empty
PostSubject: [SOURCECODE] KILLHACK CODE By:TheMvT   [SOURCECODE] KILLHACK CODE  By:TheMvT EmptyFri Aug 16, 2013 1:16 pm

Code:
#include <windows.h>
#include <fstream>
#include <cstdarg>
#include <string>

// Comment the line below to not use voice
#define USE_VOICE
// I hate doing this but it makes it clear what needs to be updated
#define KILL_HACK_ADDRESS 0x4C6F80
#define MAIN_BASE_ADDRESS 0xB6716C

// If USE_VOICE is defined we will speak player names
#ifdef USE_VOICE
#include <sapi.h>
#endif

void __cdecl Log(const char *format, ...);

void Speak(std::wstring text)
{
// This function does nothing if USE_VOICE is not defined
#ifdef USE_VOICE
static ISpVoice *voice = NULL;
// Only initialize our voice object if it has not been initialized
// Static is okay here since we are not multi threading
if (!voice)
{
// Initialize COM
HRESULT hr = CoInitialize(NULL);
if (FAILED(hr))
{
Log("CoInitialize failed! Speech is unavailable! (0x%08X)", hr);
return;
}
// Create an instance of our voice object
hr = CoCreateInstance(CLSID_SpVoice, NULL, CLSCTX_ALL, IID_ISpVoice, (void**)&voice);
if (FAILED(hr))
{
Log("CoCreateInstance failed! Speech is unavailable! (0x%08X)", hr);
return;
}
// Set the voice of the volume
voice->SetVolume(100);
}
// Speak our text asnychronously, interrupting anything currently being spoken
voice->Speak(text.c_str(), SPF_ASYNC | SPF_PURGEBEFORESPEAK, NULL);
#endif
}

// killer = the user index of the killer
// victim = the user index of the victim
// gun = the id of the gun that the killer will use to kill victim
// not_headshot = false if it is a headshot, true if it is not a headshot
void KillPlayer(int killer, int victim, int gun, int not_headshot)
{
// Set up a function pointer to the kill player function
typedef void (__stdcall *lpKillPlayer)(int killer, int victim, int gun, int not_headshot);
lpKillPlayer kill_player = (lpKillPlayer)KILL_HACK_ADDRESS;
// Call the function pointer (make killer kill victim with gun and headshot)
// Just in case anything goes wrong we wrap it in try except
__try
{
kill_player(killer, victim, gun, not_headshot);
}
__except(EXCEPTION_EXECUTE_HANDLER)
{

}
}

// Reverse engineered structures
// Stripped Smile

struct PlayerInfo //size 0x94
{
char Name[12]; //0x0
unsigned char Unknown[0x88]; //0xC
};


struct Pointer_11
{
unsigned char Unknown[0x129C]; //0x0
PlayerInfo Players[16]; // 0x129C
};

struct Pointer_10
{
unsigned char Unknown[0x14]; //0x0
Pointer_11 *P11; //0x14
};

struct Pointer_9
{
unsigned char Unknown[0x24]; //0x0
Pointer_10 *P10; //0x24
};

bool GetPlayerName(int index, std::wstring &out)
{
// Point our Pointer_9 structure to the address defined at the top
// of the source file
Pointer_9 **main_base = (Pointer_9**)MAIN_BASE_ADDRESS;
__try
{
// Check to make sure all pointers are valid
// Wrapped in try except to do our best to prevent crashes
if (main_base)
if (*main_base)
if ((*main_base)->P10)
if ((*main_base)->P10->P11)
{
// Temporaries
const char *ascii_player_name = &(*main_base)->P10->P11->Players[index].Name[0];
int player_name_length = strlen(ascii_player_name);
// Resize player name to length wchar_ts
out.resize(player_name_length);
// Hackish way to convert ascii to unicode, dont do it
for (int i = 0; i < player_name_length; ++i)
{
char *temp = (char*)&out[i];
temp[0] = ascii_player_name[i];
temp[1] = 0;
}
return true;
}
}
__except(EXCEPTION_EXECUTE_HANDLER)
{
return false;
}
return false;
}

void SpeakIndex(int index)
{
std::wstring player_name;
// Try to get the player name
if (!GetPlayerName(index, player_name))
return;
// Speak name
Speak(player_name);
}

// For lack of a better function name
int ModifyIndex(int &index, bool increase)
{
if (increase)
{
// No wrap around, indexes cannot go past 15
if (index == 15)
return 15;
return ++index;
}
else
{
// No wrap around, indexes cannot go below 0
if (index == 0)
return 0;
return --index;
}
}

DWORD WINAPI KillHackThread(void*)
{
// Infinite loop, check hotkeys
int killer = 1;
int victim = 10;
while (true)
{
// Make the killer kill the victim using a glock headshot
if (GetAsyncKeyState(VK_F2)&1)
{
KillPlayer(killer, victim, 1, 0);
}
// If numpad 4 is hit, decrease the victim user index and speak it
if (GetAsyncKeyState(VK_NUMPAD4)&1)
{
SpeakIndex(ModifyIndex(victim, false));
}
// If numpad 6 is hit, increase the victim user index and speak it
if (GetAsyncKeyState(VK_NUMPAD6)&1)
{
SpeakIndex(ModifyIndex(victim, true));
}
// If numpad 2 is hit, decrease the killer user index and speak it
if (GetAsyncKeyState(VK_NUMPAD2)&1)
{
SpeakIndex(ModifyIndex(killer, false));
}
// If numpad 8 is hit, increase the killer user index and speak it
if (GetAsyncKeyState(VK_NUMPAD8)&1)
{
SpeakIndex(ModifyIndex(killer, true));
}
// If numpad 1 is hit, suicide the room
if (GetAsyncKeyState(VK_NUMPAD1)&1)
{
for (int i = 0; i < 16; ++i)
{
KillPlayer(i, i, 1, 0);
}
}
// Arbitrary sleep time, prevents disconnection due to too many packets
Sleep(50);
}

}

// Formatted logging function, supports variable number of args
// logs to Log.txt
void __cdecl Log(const char *format, ...)
{
char buffer[257];
std::ofstream file("Log.txt", std::ios::app);
if (file.is_open())
{
va_list list;
va_start(list, format);
vsnprintf_s(buffer, sizeof(buffer), sizeof(buffer) - 1, format, list);
file << buffer << "\n";
file.close();
va_end(list);
}
}

BOOL APIENTRY DllMain(HMODULE module, DWORD reason, LPVOID reserved)
{
if (reason == DLL_PROCESS_ATTACH)
{
// Create the kill hack thread only if the dll is being loaded
HANDLE thread_handle = CreateThread(NULL, NULL, KillHackThread, NULL, NULL, NULL);
MessageBoxA(NULL,"Coded by: CodeCatcher404","GE",MB_OK);
if (thread_handle == NULL)
{
Log("Failed to create kill hack thread");
}
else
{
CloseHandle(thread_handle);
Log("Successfully created kill hack thread Coded by: CodeCatcher404 ");
}
}
return TRUE;
}
Learn in C++
Code:
#define ADDR_CLOSE 0x3772
void start()
{
while(1)
{
if (GetKeysState(VK_Esc) <0)
{            
*(DWORD*)ADDR_CLOSE = true;
}
Sleep(1)
}
}
By:TheMvT
Back to top Go down
 
[SOURCECODE] KILLHACK CODE By:TheMvT
Back to top 
Page 1 of 1
 Similar topics
-
» OneHitCf By:TheMvT
» CF PH Assorted Log-in Background Mod Made by me (TheMvT)
» C++ : Code a Taj Mahal ( with graphics )
» C++ : Code a 3D Car Handling ( with Graphics )
» C : Code a Moving Ball in Rain ( with graphics )

Permissions in this forum:You cannot reply to topics in this forum
Mafia Coderz :: Programming Zone :: C & C++ Programming-
Jump to: