diff --git a/DragonBurn/DragonBurn.vcxproj b/DragonBurn/DragonBurn.vcxproj index 01750f6..20627fb 100644 --- a/DragonBurn/DragonBurn.vcxproj +++ b/DragonBurn/DragonBurn.vcxproj @@ -242,7 +242,6 @@ - @@ -258,7 +257,6 @@ - diff --git a/DragonBurn/DragonBurn.vcxproj.filters b/DragonBurn/DragonBurn.vcxproj.filters index 018c992..f3c4548 100644 --- a/DragonBurn/DragonBurn.vcxproj.filters +++ b/DragonBurn/DragonBurn.vcxproj.filters @@ -218,12 +218,6 @@ Cheats\Data - - Cheats\Offsets - - - Utils - Cheats\Radar diff --git a/DragonBurn/Offsets.cpp b/DragonBurn/Offsets.cpp deleted file mode 100644 index 85bb111..0000000 --- a/DragonBurn/Offsets.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include "Offsets.h" - -bool Offset::UpdateOffsets() -{ - return true; -} \ No newline at end of file diff --git a/DragonBurn/Offsets.h b/DragonBurn/Offsets.h index fafb111..0ea4497 100644 --- a/DragonBurn/Offsets.h +++ b/DragonBurn/Offsets.h @@ -4,7 +4,7 @@ namespace Offset { - + inline long long CS2ver = 8926190; inline DWORD EntityList = 26882856; inline DWORD Matrix = 27284176; inline DWORD ViewAngle = 27337880; @@ -98,6 +98,4 @@ namespace Offset DWORD m_flDefuseCountDown = 0xF28; DWORD m_nBombSite = 0xEDC; } C4; - - bool UpdateOffsets(); } \ No newline at end of file diff --git a/DragonBurn/Utils/MemorySearch.cpp b/DragonBurn/Utils/MemorySearch.cpp deleted file mode 100644 index e7e2787..0000000 --- a/DragonBurn/Utils/MemorySearch.cpp +++ /dev/null @@ -1,103 +0,0 @@ -#include "ProcessManager.hpp" -#include - -inline const DWORD BLOCKMAXSIZE = 409600; - - -int GetSignatureArray(const std::string& Signature, std::vector& SignatureArray) -{ - std::string Sig = Signature; - Sig.erase(std::remove(Sig.begin(), Sig.end(), ' '), Sig.end()); - - std::size_t Size = Sig.size(); - - if (Size % 2 != 0) - return 0; - - for (int i = 0; i < Size; i += 2) - { - std::string ByteString = Sig.substr(i, 2); - WORD Byte = (ByteString == "??") ? 256 : std::stoi(ByteString, nullptr, 16); - SignatureArray.push_back(Byte); - } - return SignatureArray.size(); -} - -void GetNextArray(std::vector& NextArray, const std::vector& SignatureArray) -{ - std::size_t Size = SignatureArray.size(); - for (int i = 0; i < Size; i++) - NextArray[SignatureArray[i]] = i; -} - -void SearchMemoryBlock(byte* MemoryBuffer, const std::vector& NextArray, const std::vector& SignatureArray, DWORD64 StartAddress, DWORD Size, std::vector& ResultArray) -{ - if (!ProcessMgr.ReadMemory(StartAddress, *MemoryBuffer, Size)) - return; - - int SignatureLength = SignatureArray.size(); - - for (int i = 0, j, k; i < Size;) - { - j = i; k = 0; - - for (; k < SignatureLength && j < Size && (SignatureArray[k] == MemoryBuffer[j] || SignatureArray[k] == 256); k++, j++); - - if (k == SignatureLength) - ResultArray.push_back(StartAddress + i); - - if ((i + SignatureLength) >= Size) - return; - - int Num = NextArray[MemoryBuffer[i + SignatureLength]]; - if (Num == -1) - i += (SignatureLength - NextArray[256]); - else - i += (SignatureLength - Num); - } -} - -std::vector ProcessManager::SearchMemory(const std::string& Signature, DWORD64 StartAddress, DWORD64 EndAddress, int SearchNum) -{ - std::vector ResultArray; - std::vector SignatureArray; - std::vector NextArray(260, -1); - - byte* MemoryBuffer = new byte[BLOCKMAXSIZE]; - - if (GetSignatureArray(Signature, SignatureArray) <= 0) - return ResultArray; - - GetNextArray(NextArray, SignatureArray); - - MEMORY_BASIC_INFORMATION mbi; - int Count; - while (VirtualQueryEx(hProcess, reinterpret_cast(StartAddress), &mbi, sizeof(mbi)) != 0) - { - Count = 0; - auto BlockSize = mbi.RegionSize; - - while (BlockSize >= BLOCKMAXSIZE) - { - if (ResultArray.size() >= SearchNum) - goto END; - - SearchMemoryBlock(MemoryBuffer, NextArray, SignatureArray, StartAddress + (BLOCKMAXSIZE * Count), BLOCKMAXSIZE, ResultArray); - - BlockSize -= BLOCKMAXSIZE; - Count++; - } - - SearchMemoryBlock(MemoryBuffer, NextArray, SignatureArray, StartAddress + (BLOCKMAXSIZE * Count), BlockSize, ResultArray); - - StartAddress += mbi.RegionSize; - - if (ResultArray.size() >= SearchNum || EndAddress != 0 && StartAddress > EndAddress) - break; - } - -END: - - delete[] MemoryBuffer; - return ResultArray; -} \ No newline at end of file diff --git a/DragonBurn/Utils/ProcessManager.hpp b/DragonBurn/Utils/ProcessManager.hpp index 1b84336..e494c04 100644 --- a/DragonBurn/Utils/ProcessManager.hpp +++ b/DragonBurn/Utils/ProcessManager.hpp @@ -222,9 +222,6 @@ class ProcessManager return false; } - - std::vector SearchMemory(const std::string& Signature, DWORD64 StartAddress, DWORD64 EndAddress, int SearchNum = 1); - DWORD64 TraceAddress(DWORD64 BaseAddress, std::vector Offsets) { _is_invalid(hProcess,0);