Solved CSGO How to Print text in console?

  • CSGO recently moved logic from 'client_panorama.dll' to 'client.dll', you must update all code that uses 'client_panorama.dll' and replace it with 'client.dll' or the code will not work.
Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

Lolita1

Newbie
Jun 8, 2015
32
438
2
Hello guys,
nice tutorial : https://guidedhacking.com/showthread.php?5679-Hooking-Source-SDK-functions-CSS
Anyway i'm wondering how to do this in C#?
I have come so far but now i'm stuck.

C++:
                Process pc = Process.GetProcesses().Where(x => x.ProcessName == "").FirstOrDefault();
                ProcessModule vstdlib = null;
                foreach (ProcessModule p in pc.Modules)
                {
                    if (p.ModuleName == "vstdlib.dll")
                    {
                        vstdlib = p;
                        break;
                    }
                }
                IntPtr vstdlibDll = LoadLibraryEx(vstdlib.FileName, IntPtr.Zero, LoadLibraryFlags.DONT_RESOLVE_DLL_REFERENCES);
                IntPtr createInterfaceFn = GetProcAddress(vstdlibDll, "CreateInterface");

                IntPtr interfaces = createInterfaceFn;
                interfaces = IntPtr.Add(interfaces, 5);
                interfaces = IntPtr.Add(interfaces, Marshal.ReadInt32(interfaces) + 4);
                interfaces = IntPtr.Add(interfaces, 6);

                interfaces = new IntPtr(Marshal.ReadInt32(interfaces) - vstdlibDll.ToInt32());

                IntPtr vstdlibInterface = ReadIntPtr(dota, IntPtr.Add(interfaces, vstdlib.BaseAddress.ToInt32()));

                IntPtr engineCVar = IntPtr.Zero;

                while (vstdlibInterface != IntPtr.Zero)
                {
                    string interfaceName = ReadString(dota, ReadIntPtr(dota, IntPtr.Add(vstdlibInterface, 0x04)));

                    if (interfaceName == "VEngineCvar007")
                    {
                        engineCVar = ReadIntPtr(dota, IntPtr.Add(ReadIntPtr(dota, vstdlibInterface), 1));
                        break;
                    }

                    vstdlibInterface = ReadIntPtr(dota, IntPtr.Add(vstdlibInterface, 0x08));
                }
It did find me VEngineCvar007
if anyone could help me
-> what i'm trying to achieve to print something into console without using sdk i could transfer it into C#
also tried to find address of that function and type something in . I was playing with ollydbg and searching for address of that fucntion and it almost worked

C++:
#include "stdafx.h"
#include <windows.h>

DWORD WINAPI MyThread(LPVOID);
DWORD g_threadID;
HMODULE g_hModule;
void __stdcall CallFunction(void);

INT APIENTRY DllMain(HMODULE hDLL, DWORD Reason, LPVOID Reserved)
{
	switch (Reason)
	{
	case DLL_PROCESS_ATTACH:
		g_hModule = hDLL;
		DisableThreadLibraryCalls(hDLL);
		CreateThread(NULL, NULL, &MyThread, NULL, NULL, &g_threadID);
		break;
	case DLL_THREAD_ATTACH:
	case DLL_PROCESS_DETACH:
	case DLL_THREAD_DETACH:
		break;
	}
	return TRUE;
}

DWORD WINAPI MyThread(LPVOID)
{
	while (true)
	{
		if (GetAsyncKeyState(VK_F3) & 1)
		{
			CallFunction();
		}
		else if (GetAsyncKeyState(VK_F4) & 1)
			break;
		Sleep(100);
	}
	FreeLibraryAndExitThread(g_hModule, 0);
	return 0;
}

void __stdcall CallFunction(void)
{
	typedef void(__thiscall *pFunctionAddress)(const char *);
	pFunctionAddress Function = (pFunctionAddress)(0x589F3DC0);
	Function("TEST");
}
it almost did work out it typed into console : Unknown command (some very strange symbol)
 

Lolita1

Newbie
Jun 8, 2015
32
438
2
https://en.m.wikipedia.org/wiki/X86_calling_conventions

Go into Olly/Ida and figure out which one it's using.
Well i dont need to, it took me a while but i have figured this shit up in C# how i wanted it on the first place. So you can close this thread.

C#:
              if (interfaceName == "VEngineClient018")
                    break;

                vstdlibInterface = ReadIntPtr(dota, IntPtr.Add(vstdlibInterface, 0x08));
            }
            
            Console.WriteLine("pEngine 0x" + (vstdlibInterface - 0x04).ToString("X"));
            IntPtr Temp = vstdlibInterface - 0x04;
            Temp = ReadIntPtr(dota, Temp);
            Temp = ReadIntPtr(dota, Temp + 0x1B4);

            Memory[Temp, false].Execute("testttt");
 

Lolita1

Newbie
Jun 8, 2015
32
438
2
You simply called a wrong function = wrong address was used.
Try to execute: Function("say");
See if that does something, if it does, you might have used a function that executes stuff in console instead of printing.

EDIT: My suggestion might not work since you might have declared wrong parameters for that function, thus your "test" value gets corrupted.
Well it shows this when i call that function, so i believe i have a right address so my code for calling it is wrong. That's why i asked for help. If you can help me to create correct calling fuction for it.

inje.jpg
 
Last edited:

Szaka

Coder
Full Member
Nobleman
Mar 14, 2013
161
718
3
So u claim to have proper address - go and confirm it in disassembler. Put BP to see the function stack and convention. That all for now. Aha and its risky to use thiscall pointers, use fastcall (because u cant call thiscall inside hook)
 

Lolita1

Newbie
Jun 8, 2015
32
438
2
So u claim to have proper address - go and confirm it in disassembler. Put BP to see the function stack and convention. That all for now. Aha and its risky to use thiscall pointers, use fastcall (because u cant call thiscall inside hook)
I'm sure i have correct address, because i can always call inject dll call LogToFile("g_pEngine->ClientCmd_Unrestricted 0x%X", getvfunc<OriginalFn>(this, 109)); and i will get correct address. But all i need help with creating that calling function.
 
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods