From 03cada92bb7cd3914882704953b6f786fe557cfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Franti=C5=A1ek=20Boh=C3=A1=C4=8Dek?= Date: Sat, 15 Jan 2022 20:11:34 +0100 Subject: [PATCH] feat!: remove nossmooth core --- Local/NosSmooth.LocalCore/Character.cpp | 28 --- Local/NosSmooth.LocalCore/Character.h | 37 ---- .../CharacterUnmanaged.cpp | 119 ----------- .../NosSmooth.LocalCore/CharacterUnmanaged.h | 56 ----- Local/NosSmooth.LocalCore/ModuleHook.cpp | 49 ----- Local/NosSmooth.LocalCore/ModuleHook.h | 19 -- Local/NosSmooth.LocalCore/ModuleHook.ixx | 3 - Local/NosSmooth.LocalCore/Network.cpp | 43 ---- Local/NosSmooth.LocalCore/Network.h | 46 ---- .../NosSmooth.LocalCore/NetworkUnmanaged.cpp | 171 --------------- Local/NosSmooth.LocalCore/NetworkUnmanaged.h | 62 ------ .../NosSmooth.LocalCore.vcxproj | 198 ------------------ .../NosSmooth.LocalCore.vcxproj.filters | 64 ------ Local/NosSmooth.LocalCore/NosSmoothCore.cpp | 34 --- Local/NosSmooth.LocalCore/NosSmoothCore.h | 24 --- Local/NosSmooth.LocalCore/NostaleString.h | 104 --------- Local/NosSmooth.LocalCore/packages.config | 4 - 17 files changed, 1061 deletions(-) delete mode 100644 Local/NosSmooth.LocalCore/Character.cpp delete mode 100644 Local/NosSmooth.LocalCore/Character.h delete mode 100644 Local/NosSmooth.LocalCore/CharacterUnmanaged.cpp delete mode 100644 Local/NosSmooth.LocalCore/CharacterUnmanaged.h delete mode 100644 Local/NosSmooth.LocalCore/ModuleHook.cpp delete mode 100644 Local/NosSmooth.LocalCore/ModuleHook.h delete mode 100644 Local/NosSmooth.LocalCore/ModuleHook.ixx delete mode 100644 Local/NosSmooth.LocalCore/Network.cpp delete mode 100644 Local/NosSmooth.LocalCore/Network.h delete mode 100644 Local/NosSmooth.LocalCore/NetworkUnmanaged.cpp delete mode 100644 Local/NosSmooth.LocalCore/NetworkUnmanaged.h delete mode 100644 Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj delete mode 100644 Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj.filters delete mode 100644 Local/NosSmooth.LocalCore/NosSmoothCore.cpp delete mode 100644 Local/NosSmooth.LocalCore/NosSmoothCore.h delete mode 100644 Local/NosSmooth.LocalCore/NostaleString.h delete mode 100644 Local/NosSmooth.LocalCore/packages.config diff --git a/Local/NosSmooth.LocalCore/Character.cpp b/Local/NosSmooth.LocalCore/Character.cpp deleted file mode 100644 index b0e678a..0000000 --- a/Local/NosSmooth.LocalCore/Character.cpp +++ /dev/null @@ -1,28 +0,0 @@ -#include "Character.h" -#include -using namespace NosSmoothCore; -using namespace System; -using namespace System::Runtime::InteropServices; - -Character::Character(ModuleHook moduleHook) -{ - CharacterUnmanaged::GetInstance()->Setup(moduleHook); -} - -void Character::Walk(int x, int y) -{ - DWORD position = (y << 16) | x; - CharacterUnmanaged::GetInstance()->Walk(position); -} - -void Character::SetWalkCallback(WalkCallback^ walkCallback) -{ - _walkCallback = walkCallback; - IntPtr functionPointer = Marshal::GetFunctionPointerForDelegate(walkCallback); - CharacterUnmanaged::GetInstance()->SetWalkCallback(static_cast(functionPointer.ToPointer())); -} - -void NosSmoothCore::Character::ResetHooks() -{ - CharacterUnmanaged::GetInstance()->ResetHooks(); -} diff --git a/Local/NosSmooth.LocalCore/Character.h b/Local/NosSmooth.LocalCore/Character.h deleted file mode 100644 index d0366df..0000000 --- a/Local/NosSmooth.LocalCore/Character.h +++ /dev/null @@ -1,37 +0,0 @@ -#pragma once -#include "ModuleHook.h" -#include "CharacterUnmanaged.h" - -namespace NosSmoothCore -{ - public ref class Character - { - public: - /// - /// Creates new instance of Character. - /// - /// The hooking module holding the information about NostaleX.dat - Character(NosSmoothCore::ModuleHook moduleHook); - - /// - /// Starts walking to the specified x, y position - /// - /// The x coordinate to walk to. - /// The y coordinate to walk to. - void Walk(int x, int y); - - /// - /// Registers the callback for walk function. - /// - /// The callback to call. - void SetWalkCallback(WalkCallback^ walkCallback); - - /// - /// Reset the registered hooks. - /// - void ResetHooks(); - private: - WalkCallback^ _walkCallback; - }; -} - diff --git a/Local/NosSmooth.LocalCore/CharacterUnmanaged.cpp b/Local/NosSmooth.LocalCore/CharacterUnmanaged.cpp deleted file mode 100644 index 7ac6d8c..0000000 --- a/Local/NosSmooth.LocalCore/CharacterUnmanaged.cpp +++ /dev/null @@ -1,119 +0,0 @@ -#include "CharacterUnmanaged.h" -#include - -using namespace NosSmoothCore; - -const BYTE WALK_OBJECT_PATTERN[] = { 0x33, 0xC9, 0x8B, 0x55, 0xFC, 0xA1, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00 }; -const BYTE WALK_FUNCTION_PATTERN[] = { 0x55, 0x8B, 0xEC, 0x83, 0xC4, 0xEC, 0x53, 0x56, 0x57, 0x66, 0x89, 0x4D, 0xFA }; - -LPCSTR WALK_OBJECT_MASK = "xxxxxx????x????"; -LPCSTR WALK_FUNCTION_MASK = "xxxxxxxxxxxxx"; - -void CharacterWalkDetourIn() -{ - DWORD position = 0; - - __asm - { - pushad - pushfd - - mov position, edx - } - - bool isAccepted = CharacterUnmanaged::GetInstance()->ExecuteWalkCallback(position); - - __asm - { - popfd - popad - } - - if (isAccepted) { - CharacterUnmanaged::GetInstance()->Walk(position); - } -} - -// Detour entrypoint -// declspec naked to not mess up the stack -void __declspec(naked) CharacterWalkDetour() -{ - unsigned int returnPush; - __asm { - pop eax - pop ebx - mov returnPush, eax // we have to push this value on the stack before returning - } - - CharacterWalkDetourIn(); - - __asm { - push returnPush - ret - } -} - -CharacterUnmanaged::CharacterUnmanaged() -{ -} - -void CharacterUnmanaged::Setup(ModuleHook moduleHook) -{ - auto walkFunction = moduleHook.FindPattern(WALK_FUNCTION_PATTERN, WALK_FUNCTION_MASK); - auto walkObject = *(unsigned int*)(moduleHook.FindPattern(WALK_OBJECT_PATTERN, WALK_OBJECT_MASK) + 0x6); - - if (walkFunction == 0) - { - throw "Could not find walk function."; - } - - if (walkObject == 0) - { - throw "Could not find player object."; - } - - _walkFunctionAddress = walkFunction; - _characterObjectAddress = walkObject; -} - -void CharacterUnmanaged::SetWalkCallback(NativeWalkCallback walkCallback) -{ - _walkCallback = walkCallback; - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - DetourAttach(&(PVOID&)_walkFunctionAddress, CharacterWalkDetour); - DetourTransactionCommit(); -} - -void CharacterUnmanaged::Walk(DWORD position) -{ - unsigned int walkFunction = _walkFunctionAddress; - unsigned int characterObject = _characterObjectAddress; - - __asm - { - push 1 - xor ecx, ecx - mov edx, position - mov eax, dword ptr ds : [characterObject] - mov eax, dword ptr ds : [eax] - call walkFunction - } -} - -void CharacterUnmanaged::ResetHooks() -{ - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - DetourDetach(&(PVOID&)_walkFunctionAddress, CharacterWalkDetour); - DetourTransactionCommit(); -} - -bool CharacterUnmanaged::ExecuteWalkCallback(const DWORD position) -{ - if (_walkCallback != nullptr) { - return _walkCallback(position); - } - - return true; -} \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/CharacterUnmanaged.h b/Local/NosSmooth.LocalCore/CharacterUnmanaged.h deleted file mode 100644 index b497682..0000000 --- a/Local/NosSmooth.LocalCore/CharacterUnmanaged.h +++ /dev/null @@ -1,56 +0,0 @@ -#pragma once -#include "ModuleHook.h" - -namespace NosSmoothCore -{ - public delegate bool WalkCallback(int position); - typedef bool(__stdcall* NativeWalkCallback)(int position); - - class CharacterUnmanaged - { - public: - /// - /// Set ups the addresses of objects. - /// - /// The hooking module holding the information about NostaleX.dat - void Setup(NosSmoothCore::ModuleHook moduleHook); - - /// - /// Starts walking to the specified x, y position - /// - /// The coordinate to walk to. - void Walk(DWORD position); - - /// - /// Registers the callback for walk function. - /// - /// The callback to call. - void SetWalkCallback(NativeWalkCallback walkCallback); - - /// - /// Reset the registered hooks. - /// - void ResetHooks(); - - /// - /// Executes the walk callback. - /// - /// The coordinate the user wants to walk to. - /// Whether to accept the walk. - bool ExecuteWalkCallback(const DWORD position); - - static CharacterUnmanaged* GetInstance() - { - static CharacterUnmanaged instance; - return reinterpret_cast(&instance); - } - unsigned int _walkFunctionAddress; - unsigned int _characterObjectAddress; - private: - CharacterUnmanaged(); - - - NativeWalkCallback _walkCallback; - }; -} - diff --git a/Local/NosSmooth.LocalCore/ModuleHook.cpp b/Local/NosSmooth.LocalCore/ModuleHook.cpp deleted file mode 100644 index bed4ba1..0000000 --- a/Local/NosSmooth.LocalCore/ModuleHook.cpp +++ /dev/null @@ -1,49 +0,0 @@ -#include "ModuleHook.h" -#include -using namespace NosSmoothCore; - -ModuleHook ModuleHook::CreateNostaleXDatModule() -{ - auto moduleHandle = GetModuleHandleA(nullptr); - if (moduleHandle == nullptr) - { - throw "Could not obtain NostaleX.dat module handle"; - } - - MODULEINFO moduleInfo = {}; - if (!GetModuleInformation(GetCurrentProcess(), moduleHandle, &moduleInfo, sizeof(moduleInfo))) - { - throw "Could not get module handle information"; - } - unsigned int moduleBase = reinterpret_cast(moduleInfo.lpBaseOfDll); - unsigned int moduleSize = moduleInfo.SizeOfImage; - - return ModuleHook(moduleBase, moduleSize); -} - -ModuleHook::ModuleHook(unsigned int baseAddress, unsigned int moduleSize) - : _baseAddress(baseAddress), _moduleSize(moduleSize) -{ -} - -unsigned int ModuleHook::FindPattern(const BYTE* lpPattern, LPCSTR szMask) -{ - DWORD dwLength = strlen(szMask); - DWORD dwImageEnd = _baseAddress + _moduleSize - dwLength; - DWORD_PTR i, j; - - // Scan the whole image for the pattern - for (j = _baseAddress; j < dwImageEnd; ++j) - { - // If the pattern is found, return the address at which it begins - for (i = 0; i < dwLength && (szMask[i] == '?' || *(BYTE*)(j + i) == lpPattern[i]); ++i); - if (i == dwLength) return j; - } - - return NULL; -} - -unsigned int ModuleHook::GetModuleBaseAddress() -{ - return _baseAddress; -} \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/ModuleHook.h b/Local/NosSmooth.LocalCore/ModuleHook.h deleted file mode 100644 index c32db6e..0000000 --- a/Local/NosSmooth.LocalCore/ModuleHook.h +++ /dev/null @@ -1,19 +0,0 @@ -#pragma once -#include - -namespace NosSmoothCore -{ - class ModuleHook - { - public: - static ModuleHook CreateNostaleXDatModule(); - ModuleHook(unsigned int baseAddress, unsigned int moduleSize); - - unsigned int GetModuleBaseAddress(); - unsigned int FindPattern(const BYTE* lpPattern, LPCSTR szMask); - private: - unsigned int _baseAddress; - unsigned int _moduleSize; - }; -} - diff --git a/Local/NosSmooth.LocalCore/ModuleHook.ixx b/Local/NosSmooth.LocalCore/ModuleHook.ixx deleted file mode 100644 index e5b5d4e..0000000 --- a/Local/NosSmooth.LocalCore/ModuleHook.ixx +++ /dev/null @@ -1,3 +0,0 @@ -export module ModuleHook; - -export void MyFunc(); \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/Network.cpp b/Local/NosSmooth.LocalCore/Network.cpp deleted file mode 100644 index a6317b7..0000000 --- a/Local/NosSmooth.LocalCore/Network.cpp +++ /dev/null @@ -1,43 +0,0 @@ -#include "Network.h" -#include "NostaleString.h" - -using namespace NosSmoothCore; -using namespace System::Runtime::InteropServices; -using namespace System; - -Network::Network(ModuleHook moduleHook) -{ - _networkUnmanaged = NetworkUnmanaged::GetInstance(); - _networkUnmanaged->Setup(moduleHook); -} - -void Network::ResetHooks() -{ - NetworkUnmanaged::GetInstance()->ResetHooks(); -} - -void Network::SendPacket(System::String^ packet) -{ - char* str = (char*)(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(packet)).ToPointer(); - NetworkUnmanaged::GetInstance()->SendPacket(NostaleStringA(str).get()); -} - -void Network::ReceivePacket(System::String^ packet) -{ - char* str = (char*)(System::Runtime::InteropServices::Marshal::StringToHGlobalAnsi(packet)).ToPointer(); - NetworkUnmanaged::GetInstance()->ReceivePacket(NostaleStringA(str).get()); -} - -void Network::SetReceiveCallback(NetworkCallback^ callback) -{ - IntPtr functionPointer = Marshal::GetFunctionPointerForDelegate(callback); - _receiveCallback = callback; - NetworkUnmanaged::GetInstance()->SetReceiveCallback(static_cast(functionPointer.ToPointer())); -} - -void Network::SetSendCallback(NetworkCallback^ callback) -{ - IntPtr functionPointer = Marshal::GetFunctionPointerForDelegate(callback); - _sendCallback = callback; - NetworkUnmanaged::GetInstance()->SetSendCallback(static_cast(functionPointer.ToPointer())); -} \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/Network.h b/Local/NosSmooth.LocalCore/Network.h deleted file mode 100644 index d10cf95..0000000 --- a/Local/NosSmooth.LocalCore/Network.h +++ /dev/null @@ -1,46 +0,0 @@ -#pragma once -#include "ModuleHook.h" -#include "NetworkUnmanaged.h" - -namespace NosSmoothCore -{ - public ref class Network - { - public: - Network(NosSmoothCore::ModuleHook moduleHook); - - /// - /// Send the given packet to the server. - /// - /// The packed to send. - void SendPacket(System::String^ packet); - - /// - /// Receive the given packet on the client. - /// - /// The packet to receive. - void ReceivePacket(System::String^ packet); - - /// - /// Sets the receive callback delegate to be called when packet is received. - /// - /// - void SetReceiveCallback(NetworkCallback^ callback); - - /// - /// Sets the send callback delegate to be called when the packet is sent. - /// - /// - void SetSendCallback(NetworkCallback^ callback); - - /// - /// Resets all the function hooks. - /// - void ResetHooks(); - private: - NetworkUnmanaged* _networkUnmanaged; - NetworkCallback^ _sendCallback; - NetworkCallback^ _receiveCallback; - }; -} - diff --git a/Local/NosSmooth.LocalCore/NetworkUnmanaged.cpp b/Local/NosSmooth.LocalCore/NetworkUnmanaged.cpp deleted file mode 100644 index 5b1cb87..0000000 --- a/Local/NosSmooth.LocalCore/NetworkUnmanaged.cpp +++ /dev/null @@ -1,171 +0,0 @@ -#include "NetworkUnmanaged.h" -#include -#include -#include -#include - -using namespace NosSmoothCore; - -const BYTE SEND_PATTERN[] = { 0x53, 0x56, 0x8B, 0xF2, 0x8B, 0xD8, 0xEB, 0x04 }; -const BYTE RECV_PATTERN[] = { 0x55, 0x8B, 0xEC, 0x83, 0xC4, 0xF4, 0x53, 0x56, 0x57, 0x33, 0xC9, 0x89, 0x4D, 0xF4, 0x89, 0x55, 0xFC, 0x8B, 0xD8, 0x8B, 0x45, 0xFC }; -const BYTE PACKET_CALLER_PATTERN[] = { 0xA1, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x00, 0xE8, 0x00, 0x00, 0x00, 0x00, 0xE9, 0x00, 0x00, 0x00, 0x00, 0xA1, 0x00, 0x00, 0x00, 0x00, 0x8B, 0x00, 0x8B, 0x40, 0x40 }; - -LPCSTR SEND_MASK = "xxxxxxxx"; -LPCSTR RECV_MASK = "xxxxxxxxxxxxxxxxxxxxxx"; -LPCSTR PACKET_CALLER_MASK = "x????xxx????x????x????x????xxxxx"; - -NetworkUnmanaged::NetworkUnmanaged() -{ -} - -void PacketSendDetour() -{ - const char* packet = nullptr; - - __asm - { - pushad - pushfd - - mov packet, edx - } - - bool isAccepted = NetworkUnmanaged::GetInstance()->ExecuteSendCallback(packet); - - __asm - { - popfd - popad - } - - if (isAccepted) { - NetworkUnmanaged::GetInstance()->SendPacket(packet); - } -} - -void PacketReceiveDetour() -{ - const char* packet = nullptr; - - __asm - { - pushad - pushfd - - mov packet, edx - } - - bool isAccepted = NetworkUnmanaged::GetInstance()->ExecuteReceiveCallback(packet); - - __asm - { - popfd - popad - } - - if (isAccepted) { - NetworkUnmanaged::GetInstance()->ReceivePacket(packet); - } -} - -void NetworkUnmanaged::Setup(ModuleHook moduleHook) -{ - auto sendFunction = moduleHook.FindPattern(SEND_PATTERN, SEND_MASK); - auto receiveFunction = moduleHook.FindPattern(RECV_PATTERN, RECV_MASK); - auto callerObject = *reinterpret_cast((DWORD_PTR)moduleHook.FindPattern(PACKET_CALLER_PATTERN, PACKET_CALLER_MASK) + 1); - - if (sendFunction == 0) - { - throw "Could not find send packet function."; - } - - if (receiveFunction == 0) - { - throw "Could not find receive packet function."; - } - - if (callerObject == 0) - { - throw "Could not find packet caller object."; - } - - _sendPacketAddress = sendFunction; - _receivePacketAddress = receiveFunction; - _callerObject = callerObject; - - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - DetourAttach(&(PVOID&)_receivePacketAddress, PacketReceiveDetour); - DetourAttach(&reinterpret_cast(_sendPacketAddress), PacketSendDetour); - DetourTransactionCommit(); -} - -void NetworkUnmanaged::SendPacket(const char *packet) -{ - __asm - { - mov esi, this - mov eax, dword ptr ds : [esi]._callerObject - mov eax, dword ptr ds : [eax] - mov eax, dword ptr ds : [eax] - mov edx, packet - call[esi]._sendPacketAddress - } -} - -void NetworkUnmanaged::ReceivePacket(const char* packet) -{ - __asm - { - mov esi, this - mov eax, dword ptr ds : [esi]._callerObject - mov eax, dword ptr ds : [eax] - mov eax, dword ptr ds : [eax] - mov eax, dword ptr ds : [eax + 0x34] - mov edx, packet - call[esi]._receivePacketAddress - } -} - -void NetworkUnmanaged::ResetHooks() -{ - DetourTransactionBegin(); - DetourUpdateThread(GetCurrentThread()); - if (_sendCallback != nullptr) { - DetourDetach(&reinterpret_cast(_sendPacketAddress), PacketSendDetour); - } - - if (_receiveCallback != nullptr) { - DetourDetach(&(PVOID&)_receivePacketAddress, PacketReceiveDetour); - } - - DetourTransactionCommit(); -} - -void NetworkUnmanaged::SetReceiveCallback(PacketCallback callback) -{ - _receiveCallback = callback; -} - -void NetworkUnmanaged::SetSendCallback(PacketCallback callback) -{ - _sendCallback = callback; -} - -bool NetworkUnmanaged::ExecuteReceiveCallback(const char *packet) -{ - if (_receiveCallback != nullptr) { - return _receiveCallback(packet); - } - - return true; -} - -bool NetworkUnmanaged::ExecuteSendCallback(const char* packet) -{ - if (_sendCallback != nullptr) { - return _sendCallback(packet); - } - - return true; -} \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/NetworkUnmanaged.h b/Local/NosSmooth.LocalCore/NetworkUnmanaged.h deleted file mode 100644 index b1282da..0000000 --- a/Local/NosSmooth.LocalCore/NetworkUnmanaged.h +++ /dev/null @@ -1,62 +0,0 @@ -#pragma once -#include "ModuleHook.h" - -namespace NosSmoothCore -{ - public delegate bool NetworkCallback(System::String^ packet); - typedef bool(__stdcall* PacketCallback)(const char* packet); - - class NetworkUnmanaged - { - public: - void Setup(NosSmoothCore::ModuleHook moduleHook); - - /// - /// Send the given packet to the server. - /// - /// The packed to send. - void SendPacket(const char * packet); - - /// - /// Receive the given packet on the client. - /// - /// The packet to receive. - void ReceivePacket(const char * packet); - - /// - /// Sets the receive callback delegate to be called when packet is received. - /// - /// - void SetReceiveCallback(PacketCallback callback); - - /// - /// Sets the send callback delegate to be called when the packet is sent. - /// - /// - void SetSendCallback(PacketCallback callback); - - /// - /// Resets all the function hooks. - /// - void ResetHooks(); - - bool ExecuteSendCallback(const char *packet); - - bool ExecuteReceiveCallback(const char *packet); - - static NetworkUnmanaged* GetInstance() - { - static NetworkUnmanaged instance; - return reinterpret_cast(&instance); - } - private: - NetworkUnmanaged(); - unsigned int _callerObject; - unsigned int _receivePacketAddress; - unsigned int _sendPacketAddress; - - PacketCallback _sendCallback; - PacketCallback _receiveCallback; - }; -} - diff --git a/Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj b/Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj deleted file mode 100644 index 91a2d44..0000000 --- a/Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj +++ /dev/null @@ -1,198 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {63e97ff3-7e40-44de-9e91-f5dee79af95f} - NosSmoothLocalCore - 10.0 - - - - - - DynamicLibrary - true - v143 - Unicode - true - - - DynamicLibrary - false - v143 - true - Unicode - true - - - DynamicLibrary - true - v143 - Unicode - true - - - DynamicLibrary - false - v143 - true - Unicode - true - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;NOSSMOOTHLOCALCORE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - NotUsing - pch.h - /Zc:twoPhase- %(AdditionalOptions) - - - Windows - true - false - detours.lib;%(AdditionalDependencies) - - - - - Level3 - true - true - true - WIN32;NDEBUG;NOSSMOOTHLOCALCORE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - NotUsing - pch.h - /Zc:twoPhase- %(AdditionalOptions) - - - Windows - true - true - true - false - - - - - Level3 - true - _DEBUG;NOSSMOOTHLOCALCORE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - false - - - - - Level3 - true - true - true - NDEBUG;NOSSMOOTHLOCALCORE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) - true - Use - pch.h - - - Windows - true - true - true - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj.filters b/Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj.filters deleted file mode 100644 index 582018b..0000000 --- a/Local/NosSmooth.LocalCore/NosSmooth.LocalCore.vcxproj.filters +++ /dev/null @@ -1,64 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - Header Files - - - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - Source Files - - - - - - - \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/NosSmoothCore.cpp b/Local/NosSmooth.LocalCore/NosSmoothCore.cpp deleted file mode 100644 index 6ebf238..0000000 --- a/Local/NosSmooth.LocalCore/NosSmoothCore.cpp +++ /dev/null @@ -1,34 +0,0 @@ -#include "NosSmoothCore.h" -using namespace NosSmoothCore; - -NosClient::NosClient() -{ - ModuleHook _moduleHook = ModuleHook::CreateNostaleXDatModule(); - _character = gcnew Character(_moduleHook); - _network = gcnew Network(_moduleHook); -} - -NosClient::~NosClient() -{ - delete _network; - delete _character; - - _network = nullptr; - _character = nullptr; -} - -Character^ NosClient::GetCharacter() -{ - return _character; -} - -Network^ NosClient::GetNetwork() -{ - return _network; -} - -void NosClient::ResetHooks() -{ - _network->ResetHooks(); - _character->ResetHooks(); -} \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/NosSmoothCore.h b/Local/NosSmooth.LocalCore/NosSmoothCore.h deleted file mode 100644 index 313bdfb..0000000 --- a/Local/NosSmooth.LocalCore/NosSmoothCore.h +++ /dev/null @@ -1,24 +0,0 @@ -#pragma once -#using // to use Console::WriteLine - -#include "Character.h" -#include "ModuleHook.h" -#include "Network.h" -#include "NostaleString.h" -#include // to printf() - -namespace NosSmoothCore -{ - public ref class NosClient - { - public: - NosClient(); - ~NosClient(); - Character^ GetCharacter(); - Network^ GetNetwork(); - void ResetHooks(); - private: - Network^ _network; - Character^ _character; - }; -} \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/NostaleString.h b/Local/NosSmooth.LocalCore/NostaleString.h deleted file mode 100644 index 647de9e..0000000 --- a/Local/NosSmooth.LocalCore/NostaleString.h +++ /dev/null @@ -1,104 +0,0 @@ -// Thanks to atom0s -// https://atom0s.com/forums/viewtopic.php?f=21&t=151&sid=d2fd50008534f41bbc3ab1a8b1ef6a6e - -#pragma once - -struct NostaleStringA -{ - char* m_Buffer; - size_t m_Length; - - NostaleStringA(void) - : m_Buffer(nullptr) - , m_Length(0) - { } - NostaleStringA(const char* str) - : m_Buffer(nullptr) - , m_Length(0) - { - this->set(str); - } - ~NostaleStringA(void) - { - if (this->m_Buffer != nullptr) - delete[] this->m_Buffer; - this->m_Buffer = nullptr; - } - - // Returns the size of the string. - size_t len(void) - { - return (this->m_Buffer != nullptr) ? this->m_Length : 0; - } - - // Returns the string within the buffer. - char* get(void) - { - return (this->m_Buffer != nullptr) ? (char*)(this->m_Buffer + 0x08) : nullptr; - } - - // Sets the string buffer. - void set(const char* str) - { - if (this->m_Buffer != nullptr) - delete[] this->m_Buffer; - - this->m_Length = strlen(str); - this->m_Buffer = new char[this->m_Length + 8 + 1]; - - *(unsigned int*)(this->m_Buffer + 0x00) = 1; // Reference Count - *(unsigned int*)(this->m_Buffer + 0x04) = this->m_Length; // Length - memcpy(this->m_Buffer + 0x08, str, this->m_Length); - this->m_Buffer[this->m_Length + 0x08] = '\0'; - } -}; - -struct NostaleStringW -{ - wchar_t* m_Buffer; - size_t m_Length; - - NostaleStringW(void) - : m_Buffer(nullptr) - , m_Length(0) - { } - NostaleStringW(const wchar_t* str) - : m_Buffer(nullptr) - , m_Length(0) - { - this->set(str); - } - ~NostaleStringW(void) - { - if (this->m_Buffer != nullptr) - delete[] this->m_Buffer; - this->m_Buffer = nullptr; - } - - // Returns the size of the string. - size_t len(void) - { - return (this->m_Buffer != nullptr) ? this->m_Length : 0; - } - - // Returns the string within the buffer. - wchar_t* get(void) - { - return (this->m_Buffer != nullptr) ? (wchar_t*)((char*)this->m_Buffer + 0x08) : nullptr; - } - - // Sets the string buffer. - void set(const wchar_t* str) - { - if (this->m_Buffer != nullptr) - delete[] this->m_Buffer; - - this->m_Length = wcslen(str) * 2; - this->m_Buffer = new wchar_t[this->m_Length + 8 + 1]; - - *(unsigned int*)((char*)this->m_Buffer + 0x00) = 1; // Reference Count - *(unsigned int*)((char*)this->m_Buffer + 0x04) = this->m_Length; // Length - memcpy((char*)this->m_Buffer + 0x08, str, this->m_Length); - *(wchar_t*)((char*)this->m_Buffer + this->m_Length + 0x08) = L'\0'; - } -}; \ No newline at end of file diff --git a/Local/NosSmooth.LocalCore/packages.config b/Local/NosSmooth.LocalCore/packages.config deleted file mode 100644 index 7b19a9c..0000000 --- a/Local/NosSmooth.LocalCore/packages.config +++ /dev/null @@ -1,4 +0,0 @@ - - - - \ No newline at end of file -- 2.48.1