mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
Fix Windows build errors in warden and CharCreateResult
warden_emulator.cpp: guard unicorn include + entire implementation with HAVE_UNICORN; provide stub implementations for platforms without Unicorn (Windows ARM64 which has no unicorn MSYS2 package) warden_module.cpp: include <windows.h> for VirtualAlloc/HMODULE/etc on Windows; always include warden_emulator.hpp so unique_ptr destructor compiles regardless of HAVE_UNICORN world_packets.hpp + game_handler.cpp: rename CharCreateResult::ERROR to CharCreateResult::CHAR_ERROR to avoid wingdi.h #define ERROR 0 collision
This commit is contained in:
parent
fbb0b76362
commit
c0c0210b66
4 changed files with 40 additions and 6 deletions
|
|
@ -3,12 +3,16 @@
|
|||
#include <cstring>
|
||||
#include <chrono>
|
||||
|
||||
#ifdef HAVE_UNICORN
|
||||
// Unicorn Engine headers
|
||||
#include <unicorn/unicorn.h>
|
||||
#endif
|
||||
|
||||
namespace wowee {
|
||||
namespace game {
|
||||
|
||||
#ifdef HAVE_UNICORN
|
||||
|
||||
// Memory layout for emulated environment
|
||||
constexpr uint32_t STACK_BASE = 0x00100000; // 1MB
|
||||
constexpr uint32_t STACK_SIZE = 0x00100000; // 1MB stack
|
||||
|
|
@ -396,5 +400,31 @@ void WardenEmulator::hookMemInvalid(uc_engine* uc, int type, uint64_t address, i
|
|||
<< " (size=" << size << ")" << std::endl;
|
||||
}
|
||||
|
||||
#else // !HAVE_UNICORN
|
||||
// Stub implementations — Unicorn Engine not available on this platform.
|
||||
WardenEmulator::WardenEmulator()
|
||||
: uc_(nullptr), moduleBase_(0), moduleSize_(0)
|
||||
, stackBase_(0), stackSize_(0)
|
||||
, heapBase_(0), heapSize_(0)
|
||||
, apiStubBase_(0), nextHeapAddr_(0) {}
|
||||
WardenEmulator::~WardenEmulator() {}
|
||||
bool WardenEmulator::initialize(const void*, size_t, uint32_t) { return false; }
|
||||
uint32_t WardenEmulator::hookAPI(const std::string&, const std::string&,
|
||||
std::function<uint32_t(WardenEmulator&, const std::vector<uint32_t>&)>) { return 0; }
|
||||
uint32_t WardenEmulator::callFunction(uint32_t, const std::vector<uint32_t>&) { return 0; }
|
||||
bool WardenEmulator::readMemory(uint32_t, void*, size_t) { return false; }
|
||||
bool WardenEmulator::writeMemory(uint32_t, const void*, size_t) { return false; }
|
||||
std::string WardenEmulator::readString(uint32_t, size_t) { return {}; }
|
||||
uint32_t WardenEmulator::allocateMemory(size_t, uint32_t) { return 0; }
|
||||
bool WardenEmulator::freeMemory(uint32_t) { return false; }
|
||||
uint32_t WardenEmulator::getRegister(int) { return 0; }
|
||||
void WardenEmulator::setRegister(int, uint32_t) {}
|
||||
void WardenEmulator::setupCommonAPIHooks() {}
|
||||
uint32_t WardenEmulator::writeData(const void*, size_t) { return 0; }
|
||||
std::vector<uint8_t> WardenEmulator::readData(uint32_t, size_t) { return {}; }
|
||||
void WardenEmulator::hookCode(uc_engine*, uint64_t, uint32_t, void*) {}
|
||||
void WardenEmulator::hookMemInvalid(uc_engine*, int, uint64_t, int, int64_t, void*) {}
|
||||
#endif // HAVE_UNICORN
|
||||
|
||||
} // namespace game
|
||||
} // namespace wowee
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue