Skip to content

Commit

Permalink
fix #94: support for D2R 1.1.67554
Browse files Browse the repository at this point in the history
  • Loading branch information
soarqin committed Dec 15, 2021
1 parent 640286b commit 35cb1ce
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 19 deletions.
3 changes: 3 additions & 0 deletions doc/ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v0.9.4
* fix support for D2R 1.1.67554

# v0.9.3
* d2mapapi_mod: add support for Diablo II Legacy 1.11b, 1.12 and 1.13d, now there are 4 versions supported: 1.11b, 1.12, 1.13c and 1.13d
* (#44) show players on map even out of sight
Expand Down
34 changes: 15 additions & 19 deletions src/d2rprocess.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,21 +298,17 @@ void loadEncText(wchar_t *output, const std::wstring &input) {
static uint8_t statsMapping[size_t(StatId::TotalCount)] = {};

enum {
/* These 2 offsets are no more used, use memory search now
HashTableBase = 0x20AF660,
UIBaseAddr = 0x20BF310,
*/
InventoryPanelOffset = 0x09,
CharacterPanelOffset = 0x0A,
SkillFloatSelOffset = 0x0B,
SkillTreePanelOffset = 0x0C,
ChatMenuOffset = 0x10,
SystemMenuOffset = 0x11,
InGameMapOffset = 0x12,
QuestPanelOffset = 0x16,
WaypointPanelOffset = 0x1B,
PartyPanelOffset = 0x1D,
MercenaryOffset = 0x26,
InventoryPanelOffset = 0x01,
CharacterPanelOffset = 0x02,
SkillFloatSelOffset = 0x03,
SkillTreePanelOffset = 0x04,
ChatMenuOffset = 0x08,
SystemMenuOffset = 0x09,
InGameMapOffset = 0x0A,
QuestPanelOffset = 0x0E,
WaypointPanelOffset = 0x13,
PartyPanelOffset = 0x15,
MercenaryOffset = 0x1E,
};

struct handle_data {
Expand Down Expand Up @@ -677,13 +673,13 @@ void D2RProcess::updateOffset() {
}
}

const uint8_t search1[] = {0x0F, 0x84, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x05, 0x00, 0x00, 0x00, 0x00, 0x48, 0x8B};
const uint8_t mask1[] = {0xFF, 0xFF, 0, 0, 0, 0, 0xFF, 0xFF, 0, 0, 0, 0, 0xFF, 0xFF};
const uint8_t search1[] = {0x41, 0x0F, 0xB6, 0xAC, 0x3F, 0x00, 0x00, 0x00, 0x00};
const uint8_t mask1[] = {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0, 0, 0, 0};
off = searchMem(mem, size_t(currProcess->baseSize), search1, mask1, sizeof(search1));
if (off != size_t(-1)) {
int32_t rel;
if (READ(currProcess->baseAddr + off + 8, rel)) {
currProcess->uiBaseAddr = currProcess->baseAddr + off + 12 + rel;
if (READ(currProcess->baseAddr + off + 5, rel)) {
currProcess->uiBaseAddr = currProcess->baseAddr + rel;
}
}

Expand Down

0 comments on commit 35cb1ce

Please sign in to comment.