NosTale hook

02/27/2021 18:14 NosLuna#1
Hi i watched videos and tutorials etc to call game functions and i trying so don't work anyone can help me?

Screen ( Function Rest Founded ) [Only registered and activated users can see links. Click Here To Register...]

Code -> "Internal Dll"
Code:
#include "Memory.h"
#include <Windows.h>
#include <stdio.h>
#include <fcntl.h> // for the console stuff
#include <io.h> //
#include <TlHelp32.h> // for the module operations

typedef void(__cdecl * _FuncA)();
_FuncA FuncA;

typedef void(__cdecl * _FuncB)(char * string);
_FuncB FuncB;

HANDLE CreateConsole(); 

DWORD WINAPI MainThread(LPVOID param)
{
	DWORD base = (DWORD)GetModuleHandle(NULL);

	FuncA = (_FuncA)(base + 0x310C2);
	FuncA();

	AllocConsole();
	FILE* fp;
	freopen_s(&fp, "CONOUT$", "w", stdout);
	
	//Set up
	

	while (true) 
	{
		Sleep(500);
		FuncA();
		printf("H %x \n" , base);

	}
		
	FreeLibraryAndExitThread((HMODULE)param, 0);
	return 0;
}

BOOL WINAPI DllMain(HINSTANCE hModule, DWORD dwReason, LPVOID lpReserved)
{
	switch (dwReason)
	{
	case DLL_PROCESS_ATTACH:
		CreateThread(0, 0, MainThread, hModule, 0, 0);
		break;
	default:
		break;
	}
	return TRUE;
}
Ty :handsdown:
02/27/2021 23:42 WalrossGreat#2
Everything is wrong

a) The most importantly, it isn't sit function
b) The "DWORD base" is the base of main module, but...
c) ...this address isn't in the game(base) module
d) This address is in the middle of a function, but you call it like it would be at the beginning of a function
03/01/2021 10:02 NosLuna#3
Thanks WalrossGreat for help me i continue learning
03/01/2021 23:15 Hatz~#4
The rest function for this patch is at adress: NostaleClientX.exe + 0x2A557C and it takes a pointer to TNTUnitManager as first parameter. To find it you can try to search for an on/off byte for rest status (like 1 for resting, 0 for not or something like this) then search what instructions write to that memory adress and trace back.

Image from cheat engine:

For calling game functions you can also use the x86 inline assembly if you're building your dll in x86 mode. To do so you can do it this way:
03/02/2021 20:33 NosLuna#5
Thanks @[Only registered and activated users can see links. Click Here To Register...] i try :p:D