Page 1 of 2 12 LastLast
Results 1 to 15 of 29
  1. #1
    Hell_Demon's Avatar
    Join Date
    Mar 2008
    Gender
    male
    Location
    I love causing havoc
    Posts
    3,976
    Reputation
    343
    Thanks
    4,320
    My Mood
    Cheeky

    [Source Code]Setting up a vindictus base[Hell_Demon]

    Just a quick tut on how to set up a new project for vindictus.

    What you need
    1) A steam account with Half Life 2: Deathmatch on it(might work with other games that use the old source engine) //edit: got told it doesn't work with just HL2M, you'll need another source engine game to get access to the source SDK
    2) Microsoft Visual Studio(or MS Visual C++ Express edition), preferably 2005 or 2008(I use 2008)
    3) A brain(Can't help with that, sorry)

    Creating the mod project
    Launch the Source SDK and create a new project using the following settings:

    I've set my path to C:\VindictusHax for easy access

    Cleaning up
    Go to C:\VindictusHax(or whatever location you extracted to) and open Game_HL2-2005.sln, if you're using 2008 just click no on the backup part before conversion and have it converted.
    Now on the left in the solution explorer you'll see 2 projects: client_hl2 and server_hl2, we won't need the server part, so just delete it from the solution.
    Expand client_hl2, then expand Source Files, select ALL of the contents and delete it(you can do the same for the header files map, but I recommend leaving those there for easier access)

    Now you should only have this left:


    Configuring the project
    Renaming the output dll

    Removing precompiled headers:

    Removing additional build steps:


    Adding code
    Right click source files, add new file, name it VindictusHack.cpp and do the same thing for sdk.h


    VindictusHack.cpp:
    Code:
    #include <windows.h> //windows header
    #include "sdk.h" //contains the sdk headers that we'll be using.
    
    /**************************
    **	Forward Declarations **
    **	and global variables **
    **************************/
    void HackThread(void);
    bool IsGameReady(void);
    
    IBaseClientDLL		*pBaseClient = NULL;		//a pointer to the IBaseClientDLL interface, initialized as NULL
    IVEngineClient		*pEngineClient = NULL;		//a pointer to the IVEngineClient interface, initialized as NULL
    IClientEntityList	*pClientEntityList = NULL;	//a pointer to the IClientEntityList interface, initialized as NULL
    ICvar				*pCvar = NULL;				//a pointer to the ICvar interface, initialized as NULL
    
    /*
    	Function: BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    	Purpose: Handles events for the current DLL(process/thread attach/detach events)
    	Arguments:
    		HMODULE hModule		- A handle to this module
    		DWORD	dwReason	- The event that occured(DLL_PROCESS_ATTACH, DLL_THREAD_ATTACH, DLL_THREAD_DETACH, DLL_PROCESS_DETACH)
    		LPVOID	lpReserved	- Reserved
    	Returns:
    		TRUE on success
    		FALSE on failure
    */
    BOOL APIENTRY DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpReserved)
    {
    	switch(dwReason) //'switch' to dwReason, could use if's instead
    	{
    	case DLL_PROCESS_ATTACH: //we 'attached' to the process
    		DisableThreadLibraryCalls(hModule); //Disable calls to dllmain for DLL_THREAD_ATTACH and DLL_THREAD_DETACH
    		CreateThread(0, 0, (LPTHREAD_START_ROUTINE)HackThread, 0, 0, 0); //Create a thread that runs our HackThread function
    		break; //break out of the switch statement
    	}
    	return TRUE; //success
    }
    
    /*
    	Function: void HackThread(void)
    	Purpose: The main function for our hack, here is where we have our code
    	Arguments:
    		-
    	Returns:
    		-
    */
    void HackThread(void)
    {
    	HMODULE hEngineModule, hClientModule; //module handles
    	CreateInterfaceFn pEngineFactory, pClientFactory; //CreateInterface function pointers
    
    	while(!IsGameReady())	//while the game isn't ready
    		Sleep(1000);		//wait for a second before checking again
    
    	//Here the game is ready, so we get handles to the dlls
    	hEngineModule = GetModuleHandle("engine.dll"); //Get a handle to the engine dll
    	hClientModule = GetModuleHandle("client.dll"); //Get a handle to the client dll
    
    	//Get the function pointers to the CreateInterface functions
    	pEngineFactory = (CreateInterfaceFn)GetProcAddress(hEngineModule, "CreateInterface"); //Get the address of the CreateInterface function in engine.dll
    	pClientFactory = (CreateInterfaceFn)GetProcAddress(hClientModule, "CreateInterface"); //Get the address of the CreateInterface function in client.dll
    
    	//Nullpointer checks
    	if(pEngineFactory == NULL || pClientFactory == NULL) //if any of the two function pointers is NULL
    	{
    		MessageBox(0, "A CreateInterface pointer was NULL, shutting down!", "Failure", MB_OK); //Warn us about it
    		exit(0); //and exit the game
    	}
    
    	//Get pointers to the existing interfaces in client.dll
    	pBaseClient			= (IBaseClientDLL*)pClientFactory(CLIENT_DLL_INTERFACE_VERSION, 0);				//CLIENT_DLL_INTERFACE_VERSION is defined as "VClient013"
    	pClientEntityList	= (IClientEntityList*)pClientFactory(VCLIENTENTITYLIST_INTERFACE_VERSION, 0);	//VCLIENTENTITYLIST_INTERFACE_VERSION is defined as "VClientEntityList003"
    
    	//Get pointers to the existing interfaces in engine.dll
    	pEngineClient	= (IVEngineClient*)pEngineFactory(VENGINE_CLIENT_INTERFACE_VERSION, 0);	//VENGINE_CLIENT_INTERFACE_VERSION is defined as "VEngineClient012"
    	pCvar			= (ICvar*)pEngineFactory(VENGINE_CVAR_INTERFACE_VERSION, 0);			//VENGINE_CVAR_INTERFACE_VERSION is defined as "VEngineCvar003"
    
    	if(pBaseClient == NULL || pClientEntityList == NULL || pEngineClient == NULL || pCvar == NULL) //if any of the pointers is NULL
    	{
    		MessageBox(0, "One of the interface pointers is NULL, shutting down!", "Failure", MB_OK); //Warn us about it
    		exit(0); //and exit the game
    	}
    
    	while(1) //We passed all the checks, so we can enter an infinite loop
    	{
    		if(GetAsyncKeyState(VK_NUMPAD1)&1) //if the first bit for numpad1 is set(initial press & repeats)
    		{
    			pEngineClient->ClientCmd("monster_attack_bonus_ratio -80"); //enable godmode using ClientCmd
    		}
    		if(GetAsyncKeyState(VK_NUMPAD3)&1) //if the first bit for numpad3 is set(initial press & repeats)
    		{
    			//Disable godmode using ConVars
    			ConVar *pGodmode = pCvar->FindVar("monster_attack_bonus_ratio"); //get a pointer to the ConVar
    			if(pGodmode != NULL) //make sure it isn't a NULL pointer!
    				pGodmode->SetValue(pGodmode->GetDefault()); //Set the convar back to the default value
    		}
    		Sleep(100); //Sleep(pause) the thread for 100 miliseconds
    	}
    }
    
    /*
    	Function: bool IsGameReady(void)
    	Purpose: Checks if the game has loaded the required dll's
    	Arguments:
    		-
    	Returns:
    		true if the required dlls are loaded
    		false if they aren't
    */
    bool IsGameReady(void)
    {
    	if(	GetModuleHandle("client.dll") &&	//Can we get a handle to client.dll
    		GetModuleHandle("engine.dll")		//and engine.dll?
    		)
    	{
    		return true; //we can get handles, so the game is ready
    	}
    	return false; //we missed 1 or more handles, so the game isn't ready yet!
    }
    sdk.h:
    Code:
    #pragma once //prevent the compiler from regenerating symbols for this file(important when included in multiple .cpp files)
    
    #include "cdll_int.h"			//IVEngineClient and IBaseClientDLL interfaces
    #include "icliententitylist.h"	//IClientEntityList interface
    #include "icvar.h"				//ICvar interface
    
    #include "icliententity.h"		//IClientEntity class
    #include "convar.h"				//ConVar and ConCommand classes
    
    //The source engine makes some funny defines, so we have to undefine them or we won't be able to use windows' functions with those names
    #undef CreateThread	
    #undef GetAsyncKeyState
    I hope this will get some of you interested in starting your own projects(and releasing them of course =))
    ~ Hell_Demon
    Last edited by Hell_Demon; 05-10-2011 at 09:14 AM.
    Ah we-a blaze the fyah, make it bun dem!

  2. The Following 21 Users Say Thank You to Hell_Demon For This Useful Post:

    BlakkRaven (08-19-2011),busmokah (05-11-2011),cursing85 (11-11-2011),DanK (05-11-2011),demonangel89 (06-30-2011),gercreed (12-13-2011),[MPGH]Ghost (05-10-2011),gradienz (05-10-2011),gregjonezz (05-10-2011),Jason (05-10-2011),Kumoko (05-10-2011),[MPGH]Liz (05-10-2011),Mad_Scientist (06-21-2011),Mychal89 (05-10-2011),Pie (08-06-2011),powerfear (05-24-2011),quevreauxx (07-03-2011),Reks. (08-31-2011),tempxx01 (07-07-2011),vladimir911 (05-19-2011),Zotarius (07-14-2011)

  3. #2
    Liz's Avatar
    Join Date
    Feb 2009
    Gender
    female
    Location
    179° 56′ 39.4″, +0° 2′ 46.2″, 7,940 ± 420 parsecs
    Posts
    37,183
    Reputation
    5621
    Thanks
    20,746
    My Mood
    Tired
    Nice... GJ HD

    If anyone claims to be me via any other source outside of MPGH private or visitor messages, IT'S NOT ME!
    They are trying to trick or scam you. Report them immediately and PM me here for verification.
    "Don’t confuse my personality with my attitude. My personality is who I am. My attitude depends on who you are." — Frank Ocean
    Moderator: 5/2009-10/2009 | GMod: 10/2009-10/2010 | Staff Administrator: 10/2010-Present
    I
    do not do requests via PM. Post in the appropriate section.
     
    Stupid/Pointless Private messages = SPAM, SPAM = BAN.

  4. The Following User Says Thank You to Liz For This Useful Post:

    Hell_Demon (05-10-2011)

  5. #3
    Jason's Avatar
    Join Date
    Apr 2010
    Gender
    male
    Location
    /dev/null
    Posts
    5,704
    Reputation
    918
    Thanks
    7,676
    My Mood
    Mellow
    NICE ONE HELL_DADDY. Lub the well documented sauce.

    Quote Originally Posted by Jeremy S. Anderson
    There are only two things to come out of Berkley, Unix and LSD,
    and I don’t think this is a coincidence
    You can win the rat race,
    But you're still nothing but a fucking RAT.


    ++Latest Projects++
    [Open Source] Injection Library
    Simple PE Cipher
    FilthyHooker - Simple Hooking Class
    CLR Injector - Inject .NET dlls with ease
    Simple Injection - An in-depth look
    MPGH's .NET SDK
    eJect - Simple Injector
    Basic PE Explorer (BETA)

  6. The Following User Says Thank You to Jason For This Useful Post:

    Hell_Demon (05-10-2011)

  7. #4
    Mythical's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    26
    You'll want to use it in conjunction with this:
    https://www.mpgh.net/forum/423-vindic...tvar-dump.html

    Entities can be traversed like this:
    Code:
    int count = pClientEntityList->GetHighestEntityIndex();
    
    for(int i = 0; i < count; ++i)
    {
    	IClientEntity* pEnt = pClientEntityList->GetClientEntity(i);
    	if(pEnt)
    	{
    		if(!pEnt->IsDormant())
    		{	
    			cout << "[" << i << "] " << pEnt->GetBaseEntity()->GetClientClass()->GetName() << endl;
    		}	
    	}
    }
    Class names of entities are related with the NetVar dump structs.
    An example to get your character's health:

    Code:
    int myid = pEngineClient->GetLocalPlayer();
    
    IClientEntity* pEnt = pClientEntityList->GetClientEntity(myid);
    if(pEnt)
    {
    	if(!pEnt->IsDormant())
    	{
    		GenDT_BaseCombacharacter* MyChar = (GenDT_BaseCombacharacter*)pEnt->GetBaseEntity();
    		cout << "Health: " << *MyChar->iHealth() << endl;
    	}
    }

  8. The Following User Says Thank You to Mythical For This Useful Post:

    Hell_Demon (05-10-2011)

  9. #5
    gradienz's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    51
    Reputation
    17
    Thanks
    47
    Coooooooooooool!!

  10. #6
    busmokah's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    214
    Reputation
    10
    Thanks
    52
    My Mood
    Devilish
    Does this create a console?

  11. #7
    Mythical's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    26
    No, but you could easily do so with this.

  12. #8
    Milanor's Avatar
    Join Date
    Apr 2011
    Gender
    male
    Posts
    111
    Reputation
    10
    Thanks
    19
    My Mood
    Twisted
    Reading this while working = Mindblown.

    Looks like I needa bring back that good old C++ stuff

  13. #9
    Presiden's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    nnjnn
    Posts
    66
    Reputation
    10
    Thanks
    106
    Hell_Demon, i just notice there's CreateInterfaceFn so how come you not include interface.h? o.O

    edit: nvm, its in cdll_int.h :x
    Last edited by Presiden; 05-13-2011 at 01:46 AM.

  14. #10
    Presiden's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    nnjnn
    Posts
    66
    Reputation
    10
    Thanks
    106
    I got trouble with tier0.dll error but i solved it when using vs2005 instead of 2008, maybe because of the sdk i use.. anyway here's how i do it:

    [Highlight=C++]#include "Includes.h"

    IBaseClientDLL* BaseClient;
    IClientEntityList* BaseEntList;
    ICvar* BaseCvarInterface;
    IVEngineClient* BaseEngine;

    bool Godmode = false,
    Speedhack = false,
    NoMobAi = false;

    pCreateInterface Capture( char *pszFactoryModule )
    {
    pCreateInterface dv = NULL;
    while( dv == NULL ){
    HMODULE hFactoryModule = GetModuleHandleA( pszFactoryModule );

    if( hFactoryModule ) dv = reinterpret_cast< pCreateInterface >( GetProcAddress( hFactoryModule, "CreateInterface" ) );
    Sleep( 10 );
    }
    return dv;
    }

    void *CaptureInterface( pCreateInterface dv, char *pszInterfaceName )
    {
    unsigned long *ptr = NULL;
    while( ptr == NULL ) ptr = reinterpret_cast< unsigned long* >( dv( pszInterfaceName, NULL ) ); Sleep( 10 );
    }

    DWORD WINAPI HookThread( LPVOID lpParams )
    {
    while( FindWindowA( "Vindictus", NULL ) == NULL ) Sleep( 100 );
    while( GetModuleHandleA( "engine.dll" ) == NULL || GetModuleHandleA( "client.dll" ) == NULL ) Sleep( 100 );

    pCreateInterface pClient = Capture( "client.dll" );
    pCreateInterface pEngine = Capture( "engine.dll" );
    pCreateInterface pCvar = Capture( "vstdlib.dll" );

    BaseClient = reinterpret_cast< IBaseClientDLL* >( CaptureInterface( pClient, CLIENT_DLL_INTERFACE_VERSION ) );
    BaseEntList = reinterpret_cast< IClientEntityList* >( CaptureInterface( pClient, VCLIENTENTITYLIST_INTERFACE_VERSION ) );
    BaseCvarInterface = reinterpret_cast< ICvar* >( CaptureInterface( pCvar, CVAR_INTERFACE_VERSION ) );
    BaseEngine = reinterpret_cast< IVEngineClient* >( CaptureInterface( pEngine, VENGINE_CLIENT_INTERFACE_VERSION ) );

    while( Ready2Hook() == false ) Sleep( 100 );

    if(GetAsyncKeyState(VK_F1) || GetAsyncKeyState(VK_NUMPAD1) &1) { Godmode =! Godmode; Beep(512, 100); }
    if(GetAsyncKeyState(VK_F2) || GetAsyncKeyState(VK_NUMPAD2) &1) { Speedhack =! Speedhack; Beep(512, 100); }
    if(GetAsyncKeyState(VK_F3) || GetAsyncKeyState(VK_NUMPAD3) &1) { NoMobAi =! NoMobAi; Beep(512, 100); }

    if(Godmode)
    BaseEngine->ClientCmd("monster_attack_bonus_ratio -80");
    else {
    ConVar *pGodmode = BaseCvarInterface->FindVar("monster_attack_bonus_ratio");
    if(pGodmode != NULL)
    pGodmode->SetValue(pGodmode->GetDefault());
    }

    if(Speedhack)
    BaseEngine->ClientCmd("plr_move_speed_sprint 1000");
    else {
    ConVar *pSpeedhack = BaseCvarInterface->FindVar("plr_move_speed_sprint");
    if(pSpeedhack != NULL)
    pSpeedhack->SetValue(pSpeedhack->GetDefault());
    }

    if(NoMobAi)
    BaseEngine->ClientCmd("ai_reaction_delay_idle 99999");
    else {
    ConVar *pNoMobAi = BaseCvarInterface->FindVar("ai_reaction_delay_idle");
    if(pNoMobAi != NULL)
    pNoMobAi->SetValue(pNoMobAi->GetDefault());
    }
    return 0;
    }

    BOOL APIENTRY DllMain( HMODULE hModule, DWORD dwReason, LPVOID lpReserved )
    {
    if( dwReason == DLL_PROCESS_ATTACH ){
    GApp.BaseUponModule( hModule );
    CreateThread( 0, 0, HookThread, 0, 0, 0 );
    }
    return TRUE;
    }[/Highlight]

  15. #11
    Nico's Avatar
    Join Date
    Jan 2011
    Gender
    male
    Location
    Germany :D
    Posts
    15,918
    Reputation
    1121
    Thanks
    8,617
    The SDK is always the same and it should work fine with VS2008. What error was that?

  16. #12
    Mythical's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    26
    Oh yes, you'll need to remove the *.lib files from your project as well, otherwise it'll try to statically link the libraries and cause DLL load errors.

    Also, there's no need to do this:
    Code:
    while( FindWindowA( "Vindictus", NULL ) == NULL ) Sleep( 100 );
    and,
    Code:
        if(GetAsyncKeyState(VK_F1) || GetAsyncKeyState(VK_NUMPAD1) &1) { Godmode =! Godmode; Beep(512, 100); }
        if(GetAsyncKeyState(VK_F2) || GetAsyncKeyState(VK_NUMPAD2) &1) { Speedhack =! Speedhack; Beep(512, 100); }
        if(GetAsyncKeyState(VK_F3) || GetAsyncKeyState(VK_NUMPAD3) &1) { NoMobAi =! NoMobAi; Beep(512, 100); }
    Will break for F1, F2 and F3 because you don't check for the LSB being set.
    Last edited by Mythical; 05-14-2011 at 07:36 AM.

  17. #13
    Presiden's Avatar
    Join Date
    Mar 2011
    Gender
    male
    Location
    nnjnn
    Posts
    66
    Reputation
    10
    Thanks
    106
    Quote Originally Posted by Mythical View Post
    Oh yes, you'll need to remove the *.lib files from your project as well, otherwise it'll try to statically link the libraries and cause DLL load errors.

    Also, there's no need to do this:
    Code:
    while( FindWindowA( "Vindictus", NULL ) == NULL ) Sleep( 100 );
    and,
    Code:
        if(GetAsyncKeyState(VK_F1) || GetAsyncKeyState(VK_NUMPAD1) &1) { Godmode =! Godmode; Beep(512, 100); }
        if(GetAsyncKeyState(VK_F2) || GetAsyncKeyState(VK_NUMPAD2) &1) { Speedhack =! Speedhack; Beep(512, 100); }
        if(GetAsyncKeyState(VK_F3) || GetAsyncKeyState(VK_NUMPAD3) &1) { NoMobAi =! NoMobAi; Beep(512, 100); }
    Will break for F1, F2 and F3 because you don't check for the LSB being set.
    I need it for something else so i just leave it there & the hotkeys r working just fine.

  18. #14
    Mythical's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    19
    Reputation
    10
    Thanks
    26
    It may cause some strange behaviour if you hold down F1.
    Take a look:
    GetAsyncKeyState Function (Windows)

    edit: actually the original code is also incorrect as it should be checking for the MSB.
    Last edited by Mythical; 05-15-2011 at 05:52 AM.

  19. #15
    stigyo's Avatar
    Join Date
    May 2011
    Gender
    male
    Posts
    3
    Reputation
    10
    Thanks
    0
    My Mood
    Doh

    Post

    off topic...
    this game looks very hackable ....
    i wonder if anyone could make a private server of Vindictus since they wont release any EU server anytime soon(or at all) it could be a nice alternative for NA/Canada outsiders,rather than laggy proxy with 20 min dc ...

Page 1 of 2 12 LastLast

Similar Threads

  1. [Tutorial] [Source Code]Setting up a vindictus base[Hell_Demon]
    By Hell_Demon in forum C++/C Programming
    Replies: 13
    Last Post: 03-11-2015, 11:46 AM
  2. [Release] [Source Code] Simple Game Base with Special FX
    By supercarz1991 in forum Combat Arms Hack Coding / Programming / Source Code
    Replies: 23
    Last Post: 03-09-2011, 05:49 PM
  3. Working Base Source Code
    By CrossFireAccountGenerator in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 5
    Last Post: 02-23-2011, 12:51 PM
  4. [Request] Working d3d base (source code)
    By ii LeDgEnz x in forum CrossFire Hack Coding / Programming / Source Code
    Replies: 5
    Last Post: 11-23-2010, 12:46 PM
  5. Sudden Attack NA Base Source Code tut (:
    By AznPwnage in forum Programming Tutorial Requests
    Replies: 0
    Last Post: 07-23-2010, 01:54 PM