Results 1 to 13 of 13
  1. #1
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep

    Internal not working

    I am working on an internal right now. It's not finished, it's messy and pasted, but it compiles and with no errors. When I inject, nothing happens. So I commented out some of the lines in the starting function. When I do this, the console shows up, and then the game crashes.

    Code:
    void Initialize()
    	{
    		Indexes::Init();
    		Modules::InitModules();
    		Interfaces::InitInterfaces();
    		Utilities::OpenConsole("CoBRa");
    		NetVar.RetrieveClasses();
    This is run when the DLL is injected. When I inject normally, the console does not open. When I comment InitModules and InitInterfaces, the console opens and my game crashes. Any help would be appreciated.

  2. #2
    WildAssassinz's Avatar
    Join Date
    May 2016
    Gender
    male
    Posts
    502
    Reputation
    30
    Thanks
    467
    My Mood
    Angry
    Quote Originally Posted by KappaMang View Post
    I am working on an internal right now. It's not finished, it's messy and pasted, but it compiles and with no errors. When I inject, nothing happens. So I commented out some of the lines in the starting function. When I do this, the console shows up, and then the game crashes.

    Code:
    void Initialize()
    	{
    		Indexes::Init();
    		Modules::InitModules();
    		Interfaces::InitInterfaces();
    		Utilities::OpenConsole("CoBRa");
    		NetVar.RetrieveClasses();
    This is run when the DLL is injected. When I inject normally, the console does not open. When I comment InitModules and InitInterfaces, the console opens and my game crashes. Any help would be appreciated.
    did ya hook interfaces/ and call menu func?
    Current Projects:
    TurtleCheat GlowESP BunnyHop
    HelixGlow (With Permission from nullptr_t)

  3. #3
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    Quote Originally Posted by WildAssassinz View Post
    did ya hook interfaces/ and call menu func?
    Yes, "Interfaces::InitInterfaces();" should be hooking interfaces unless that's something else. The menu comes later on in the function.

    Code:
    void Initialize()
    	{
    		Indexes::Init();
    		Modules::InitModules();
    		Interfaces::InitInterfaces();
    		Utilities::OpenConsole(XorStr("CoBRa"));
    		NetVar.RetrieveClasses();
    
    		//Finds the D3D9 Device pointer
    		auto dwDevice = **(uint32_t**)(Utilities::FindSignature(XorStr("shaderapidx9.dll"), XorStr("A1 ? ? ? ? 50 8B 08 FF 51 0C")) + 1);
    
    		//Create the virtual table hooks
    		g_pD3DDevice9Hook = make_unique<VFTableHook>((PPDWORD)dwDevice, true);
    		g_pClientModeHook = make_unique<VFTableHook>((PPDWORD)Interfaces::ClientMode, true);
    		g_pMatSurfaceHook = make_unique<VFTableHook>((PPDWORD)Interfaces::Surface, true);
    
    		//Find CSGO main window
    		while (!(g_hWindow = FindWindowA(XorStr("Valve001"), NULL))) Sleep(200);
    
    		//Replace the WindowProc with our own to capture user input
    		if (g_hWindow)
    			g_pOldWindowProc = (WNDPROC)SetWindowLongPtr(g_hWindow, GWLP_WNDPROC, (LONG_PTR)Hooked_WndProc);
    
    		g_fnOriginalReset =      g_pD3DDevice9Hook->Hook(16, Hooked_Reset);                      //Hooks IDirect3DDevice9::EndScene
    		g_fnOriginalEndScene =   g_pD3DDevice9Hook->Hook(42, Hooked_EndScene);                   //Hooks IDirect3DDevice9::Reset
    
    		g_fnOriginalPlaySound =  g_pMatSurfaceHook->Hook(82, (PlaySound_t)Hooked_PlaySound);     //Hooks ISurface::PlaySound
    		g_fnOriginalCreateMove = g_pClientModeHook->Hook(24, (CreateMove_t)Hooked_CreateMove);   //Hooks IClientMode::CreateMove
    	}
    Most of which comes from MarkHC's source. I think the problem is in InitInterfaces because when I comment that it crashes with the console (so Module and Index inits run fine), but when I comment InitModules it crashes without the console (so it must be crashing inside of the initinterfaces because Modules aren't initialized.) But when nothing is commented, it doesn't crash, but no console opens.

  4. #4
    WildAssassinz's Avatar
    Join Date
    May 2016
    Gender
    male
    Posts
    502
    Reputation
    30
    Thanks
    467
    My Mood
    Angry
    Quote Originally Posted by KappaMang View Post
    Yes, "Interfaces::InitInterfaces();" should be hooking interfaces unless that's something else. The menu comes later on in the function.

    Code:
    void Initialize()
    	{
    		Indexes::Init();
    		Modules::InitModules();
    		Interfaces::InitInterfaces();
    		Utilities::OpenConsole(XorStr("CoBRa"));
    		NetVar.RetrieveClasses();
    
    		//Finds the D3D9 Device pointer
    		auto dwDevice = **(uint32_t**)(Utilities::FindSignature(XorStr("shaderapidx9.dll"), XorStr("A1 ? ? ? ? 50 8B 08 FF 51 0C")) + 1);
    
    		//Create the virtual table hooks
    		g_pD3DDevice9Hook = make_unique<VFTableHook>((PPDWORD)dwDevice, true);
    		g_pClientModeHook = make_unique<VFTableHook>((PPDWORD)Interfaces::ClientMode, true);
    		g_pMatSurfaceHook = make_unique<VFTableHook>((PPDWORD)Interfaces::Surface, true);
    
    		//Find CSGO main window
    		while (!(g_hWindow = FindWindowA(XorStr("Valve001"), NULL))) Sleep(200);
    
    		//Replace the WindowProc with our own to capture user input
    		if (g_hWindow)
    			g_pOldWindowProc = (WNDPROC)SetWindowLongPtr(g_hWindow, GWLP_WNDPROC, (LONG_PTR)Hooked_WndProc);
    
    		g_fnOriginalReset =      g_pD3DDevice9Hook->Hook(16, Hooked_Reset);                      //Hooks IDirect3DDevice9::EndScene
    		g_fnOriginalEndScene =   g_pD3DDevice9Hook->Hook(42, Hooked_EndScene);                   //Hooks IDirect3DDevice9::Reset
    
    		g_fnOriginalPlaySound =  g_pMatSurfaceHook->Hook(82, (PlaySound_t)Hooked_PlaySound);     //Hooks ISurface::PlaySound
    		g_fnOriginalCreateMove = g_pClientModeHook->Hook(24, (CreateMove_t)Hooked_CreateMove);   //Hooks IClientMode::CreateMove
    	}
    Most of which comes from MarkHC's source. I think the problem is in InitInterfaces because when I comment that it crashes with the console (so Module and Index inits run fine), but when I comment InitModules it crashes without the console (so it must be crashing inside of the initinterfaces because Modules aren't initialized.) But when nothing is commented, it doesn't crash, but no console opens.
    can i see your init interfaces?
    Current Projects:
    TurtleCheat GlowESP BunnyHop
    HelixGlow (With Permission from nullptr_t)

  5. #5
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    Quote Originally Posted by WildAssassinz View Post
    can i see your init interfaces?
    Code:
    void Interfaces::InitFactories()
    {
    	Interfaces::ClientFactory = Interfaces::GetFactory(Modules::Client);
    	Interfaces::EngineFactory = Interfaces::GetFactory(Modules::Engine);
    	Interfaces::VGUI2Factory = Interfaces::GetFactory(Modules::VGUI2);
    	Interfaces::VGUISurfaceFactory = Interfaces::GetFactory(Modules::VGUISurface);
    	Interfaces::MatFactory = Interfaces::GetFactory(Modules::Material);
    	Interfaces::PhysFactory = Interfaces::GetFactory(Modules::VPhysics);
    	Interfaces::StdFactory = Interfaces::GetFactory(Modules::Stdlib);
    }
    
    void Interfaces::InitInterfaces()
    {
    	Interfaces::InitFactories();
    	Interfaces::Client = (IBaseClientDLL*)Interfaces::ClientFactory((char*)Utilities::FindTextPattern(XorStr("client.dll"), XorStr("VClient0")), NULL);
    	Interfaces::Engine = (IVEngineClient*)Interfaces::EngineFactory((char*)Utilities::FindTextPattern(XorStr("engine.dll"), XorStr("VEngineClient0")), NULL);
    	Interfaces::Panels = (IPanel*)Interfaces::VGUI2Factory((char*)Utilities::FindTextPattern(XorStr("vgui2.dll"), XorStr("VGUI_Panel0")), NULL);
    	Interfaces::Surface = (ISurface*)Interfaces::VGUISurfaceFactory((char*)Utilities::FindTextPattern(XorStr("vguimatsurface.dll"), XorStr("VGUI_Surface0")), NULL);
    	Interfaces::EntList = (IClientEntityList*)Interfaces::ClientFactory((char*)Utilities::FindTextPattern(XorStr("client.dll"), XorStr("VClientEntityList0")), NULL);
    	Interfaces::DebugOverlay = (IVDebugOverlay*)Interfaces::EngineFactory((char*)Utilities::FindTextPattern(XorStr("engine.dll"), XorStr("VDebugOverlay0")), NULL);
    	Interfaces::Prediction = (DWORD*)Interfaces::ClientFactory((char*)Utilities::FindTextPattern(XorStr("client.dll"), XorStr("VClientPrediction0")), NULL);
    	Interfaces::MaterialSystem = (CMaterialSystem*)Interfaces::MatFactory((char*)Utilities::FindTextPattern(XorStr("materialsystem.dll"), XorStr("VMaterialSystem0")), NULL);
    	Interfaces::RenderView = (CVRenderView*)Interfaces::EngineFactory((char*)Utilities::FindTextPattern(XorStr("engine.dll"), XorStr("VEngineRenderView0")), NULL);
    	Interfaces::ModelRender = (IVModelRender*)Interfaces::EngineFactory((char*)Utilities::FindTextPattern(XorStr("engine.dll"), XorStr("VEngineModel0")), NULL);
    	Interfaces::ModelInfo = (CModelInfo*)Interfaces::EngineFactory((char*)Utilities::FindTextPattern(XorStr("engine.dll"), XorStr("VModelInfoClient0")), NULL);
    	Interfaces::Trace = (IEngineTrace*)Interfaces::EngineFactory((char*)Utilities::FindTextPattern(XorStr("engine.dll"), XorStr("EngineTraceClient0")), NULL);
    	Interfaces::PhysProps = (IPhysicsSurfaceProps*)Interfaces::PhysFactory((char*)Utilities::FindTextPattern(XorStr("vphysics.dll"), XorStr("VPhysicsSurfaceProps0")), NULL);
    	Interfaces::CVar = (ICVar*)Interfaces::StdFactory((char*)Utilities::FindTextPattern(XorStr("stdlib.dll"), XorStr("VEngineCvar00")), NULL);
    
    	// Get ClientMode Pointer
    	DWORD* ppClientMode;
    	ppClientMode = nullptr; // before "scripts/vgui_screens.txt"
    	DWORD p = Utilities::FindSignature("client.dll", "8B 35 ? ? ? ? 85 FF 74 73");
    	if (p)
    	{
    		ppClientMode = **(DWORD***)(p + 2);
    		Interfaces::ClientMode = ppClientMode;
    	}
    
    	auto uAddress = Utilities::FindSignature(XorStr("client.dll"), XorStr("A1 ? ? ? ? 5F 8B 40 10"));
    	uint32_t g_dwGlobalVarsBase = *(uint32_t*)(uAddress + 0x1);
    	Interfaces::Globals = *(CGlobalVarsBase**)(g_dwGlobalVarsBase);
    
    	
    
    	Utilities::Log(XorStr("Interfaces Ready"));
    }
    I noticed that the initinterfaces uses the log function, so I put the open console before the initinterfaces, but it still does not work. Also, it never logs,so it has to be freezing at InitFactories or somewhere else.
    Last edited by KappaMang; 02-09-2017 at 09:30 PM.

  6. #6
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    After some debugging and editing the initinterfaces, I found that it stops working when I try to get the interface.

  7. #7
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    update:
    I've got it working up until the VFTableHooks.
    it stops here
    Code:
    uint32_t CalculateLength()
    		{
    			uint32_t dwIndex = 0;
    			if (!m_pOriginalVMTable) return 0;
    			for (dwIndex = 0; m_pOriginalVMTable[dwIndex]; dwIndex++) {
    				if (IsBadCodePtr((FARPROC)m_pOriginalVMTable[dwIndex])) {  //THIS LINE
    					break; 
    				}
    			}
    			return dwIndex;
    		}
    but only for the Interface hooks; it works fine for the D3D hook.

  8. #8
    Epik's Avatar
    Join Date
    Sep 2010
    Gender
    male
    Posts
    1,144
    Reputation
    263
    Thanks
    12,120
    My Mood
    Amused
    Quote Originally Posted by KappaMang View Post
    update:
    I've got it working up until the VFTableHooks.
    it stops here
    Code:
    uint32_t CalculateLength()
    		{
    			uint32_t dwIndex = 0;
    			if (!m_pOriginalVMTable) return 0;
    			for (dwIndex = 0; m_pOriginalVMTable[dwIndex]; dwIndex++) {
    				if (IsBadCodePtr((FARPROC)m_pOriginalVMTable[dwIndex])) {  //THIS LINE
    					break; 
    				}
    			}
    			return dwIndex;
    		}
    but only for the Interface hooks; it works fine for the D3D hook.
    DID YA HOOK UR INTERFACES?

  9. The Following User Says Thank You to Epik For This Useful Post:

    antep2727 (02-14-2017)

  10. #9
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    Quote Originally Posted by Epik View Post


    DID YA HOOK UR INTERFACES?
    Yes?
    Code:
                    g_pD3DDevice9Hook.Initialise((DWORD*)dwDevice);
    		g_pClientModeHook.Initialise((DWORD*)Interfaces::ClientMode());
    		g_pMatSurfaceHook.Initialise((DWORD*)Interfaces::Surface());
    
    		g_fnOriginalReset = (Reset_t)g_pD3DDevice9Hook.HookMethod((DWORD)&Hooked_Reset, 16);
    		g_fnOriginalEndScene = (EndScene_t)g_pD3DDevice9Hook.HookMethod((DWORD)&Hooked_Reset, 42);
    
    		g_fnOriginalPlaySound = (PlaySound_t)g_pMatSurfaceHook.HookMethod((DWORD)&Hooked_PlaySound, 82);
    		g_fnOriginalCreateMove = (CreateMove_t)g_pClientModeHook.HookMethod((DWORD)&Hooked_CreateMove, 24);
    My program now gets through all my breakpoints but it crashes afterwards if I go into csgo. Sorry if I sound nooby I'm just trying to learn what does and does not work

  11. #10
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    Now I'm confused because my createmove hook never runs.

  12. #11
    antep2727's Avatar
    Join Date
    Feb 2015
    Gender
    male
    Posts
    744
    Reputation
    10
    Thanks
    4,606
    My Mood
    Inspired
    brainless paste gj

  13. #12
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    Quote Originally Posted by antep2727 View Post
    brainless paste gj
    Ik it's paste I'm trying to understand it

  14. #13
    KappaMang's Avatar
    Join Date
    Mar 2016
    Gender
    male
    Posts
    242
    Reputation
    10
    Thanks
    16
    My Mood
    Asleep
    /bump, I really want to learn and understand internals. I'm not even getting errors from the code it just doesn't hook but obviously the hooks should work if they come from working sources.

Similar Threads

  1. [Help] C++ internal bhop not working [NEWBIE]
    By sirfartman in forum Counter-Strike 2 Coding & Resources
    Replies: 6
    Last Post: 10-30-2016, 05:15 PM
  2. [Help] glow esp internal not working.
    By s0m8t in forum Counter-Strike 2 Coding & Resources
    Replies: 3
    Last Post: 10-26-2016, 07:31 PM
  3. [Help] GlowESP Internal (No SDK pls) not working
    By SilentWarp in forum Counter-Strike 2 Coding & Resources
    Replies: 10
    Last Post: 09-29-2016, 03:34 PM
  4. why warrock not working now??
    By tolik13 in forum WarRock - International Hacks
    Replies: 4
    Last Post: 07-09-2006, 03:27 PM