Hello everyone, today i want to share my NostaleString class with the community..
It will be especially useful to those who want to write a tool using game packets.. Have fun with it !
It will be especially useful to those who want to write a tool using game packets.. Have fun with it !
NostaleString
Code:
/* NostaleString class written by SystemX64 - 07/06/2015 32bit | string weight 32bit | string length 8bit* | string buffer */ class NostaleString { private: CHAR* _i8_string; DWORD _i32_length; public: NostaleString(CHAR* _i8_string) { this->_i32_length = strlen(_i8_string); this->_i8_string = (CHAR*)malloc(this->_i32_length + 8 + 1); *(DWORD*)(this->_i8_string + 0x00) = 1; *(DWORD*)(this->_i8_string + 0x04) = this->_i32_length; memcpy(this->_i8_string + 0x08, _i8_string, this->_i32_length); *(this->_i8_string + this->_i32_length + 8) = '\0'; } CHAR* get() { return this->_i8_string + 0x08; } DWORD length() { return this->_i32_length; } };
Example
Code:
#include <windows.h> /* NostaleString class written by SystemX64 - 07/06/2015 32bit | string weight 32bit | string length 8bit* | string buffer */ class NostaleString { private: CHAR* _i8_string; DWORD _i32_length; public: NostaleString(CHAR* _i8_string) { this->_i32_length = strlen(_i8_string); this->_i8_string = (CHAR*)malloc(this->_i32_length + 8 + 1); *(DWORD*)(this->_i8_string + 0x00) = 1; *(DWORD*)(this->_i8_string + 0x04) = this->_i32_length; memcpy(this->_i8_string + 0x08, _i8_string, this->_i32_length); *(this->_i8_string + this->_i32_length + 8) = '\0'; } CHAR* get() { return this->_i8_string + 0x08; } DWORD length() { return this->_i32_length; } }; VOID SendPacket(CHAR* _i8_packet) { DWORD _i32_SendPacketFunc = 0x52AC58; __asm { mov eax, dword ptr ds : [0x6771B8] mov eax, dword ptr ds : [eax] mov edx, _i8_packet call _i32_SendPacketFunc } } VOID pInjector() { NostaleString _nt_nosbazar = "c_skill"; NostaleString _nt_shopping = "shopping 0 0 2 1819"; while (true) { if (GetAsyncKeyState(VK_F2) == -32767) SendPacket(_nt_nosbazar.get()); if (GetAsyncKeyState(VK_F3) == -32767) SendPacket(_nt_shopping.get()); Sleep(1); } } INT WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpvReserved) { switch (dwReason) { case DLL_PROCESS_ATTACH: DisableThreadLibraryCalls(hInstance); CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)pInjector, NULL, NULL, NULL); } return TRUE; }