Reverse engineering Diablo v1.09b (last patch)
#9
Hello!

This is what I have so far (I feel as if I'm missing a myriad of information (even on the player structure's header portion)):
Code:
struct sPlayer {
    DWORD base = 0x00686448;

struct sPlayer {
    DWORD base = 0x00686448;

    struct item {
        // 23 * 4 = 92 bytes (QWORD) per item
        DWORD base = 0x006867C4; // Beginning of first item

        // base += (16C * item.slot)

        // 40 empty slots in inventory
        // 7 items to wear
        // 8 belt slots
        // 55 slots total

        int* getBeltSlot(const int slot) { return *(base += (slot * 0x16C)); };
    };

    // When you right click to cast a spell: It is copied here
    int rightClickX = 0x00686448 + 0x28;
    int rightClickY = 0x00686448 + 0x2C;

    DWORD dungeonLevel = 0x00686448 = 0x34;

    char* name = 0x00686448 + 0x140; // Null-terminated

    struct cTile {
        DWORD currentX = 0x00686448 + 0x38;
        DWORD currentY = 0x00686448 + 0x3C;

        DWORD previousX = 0x00686448 + 0x40;
        DWORD previousY = 0x00686448 + 0x44;

        DWORD futureX = 0x00686448 + 0x48;
        DWORD futureY = 0x00686448 + 0x4C;

        DWORD departingX = 0x00686448 + 0x50;
        DWORD departingY = 0x00686448 + 0x54;

        DWORD endingX = 0x00686448 + 0x58;
        DWORD endingY = 0x00686448 + 0x5C;
    };

    DWORD facing = 0x00686448 + 0x70; // 0-8 facing (up, down, left, right + (two angles * 2))
    DWORD idleFlag = 0x00686448 + 0x80; // 03 = idle, 00 = active

    DWORD level = 0x00686448 + 0x1B8;
    DWORD experience = 0x00686448 + 0x1BC;
    DWORD reqExperience = 0x00686448 + 0x1C4;

    struct cStat {
        DWORD STR = 0x00686448 + 0x164;
        DWORD baseSTR = 0x00686448 + 0x168;

        DWORD MAG = 0x00686448 + 0x16C;
        DWORD baseMAG = 0x00686448 + 0x170;

        DWORD DEX = 0x00686448 + 0x174;
        DWORD baseDEX = 0x00686448 + 0x178;

        DWORD VIT = 0x00686448 + 0x17C;
        DWORD baseVIT = 0x00686448 + 0x180;

        DWORD points = 0x00686448 + 0x184;

        /////////////////////////////////////////////////////////////////////
        // NOTE
        //     How to calculate health in Diablo:
        //     Multiply your desired HP/MP by 4
        //     Multiply that sum by 16
        //     View the value in a base-16 format
        //     Copy the first two digits (MSB to LSB) to the 2nd byte address
        //
        //     EXAMPLE
        //         500 * 4
        //         2000 * 16
        //         7D00 (32,000) | 7D = MSB, 00 = LSB
        //         (0x00686448 + 0x19C) = 0x00 0x7D 0x00 0x00
        /////////////////////////////////////////////////////////////////////

        DWORD baseHP = 0x00686448 + 0x190; // Before items are applied
        DWORD baseMaxHP = 0x00686448 + 0x194; // Before items are applied

        DWORD HP = 0x00686448 + 0x198; // Effective HP (100 / XXX)
        DWORD maxHP = 0x00686448 + 0x19C; // Effective maximum HP (XXX / 500)

        DWORD orb_HP = 0x00686448 + 0x1A0; // Percentage of HP orb to display(?)

        DWORD baseMP = 0x00686448 + 0x1A4; // Before items are applied
        DWORD baseMaxMP = 0x00686448 + 0x1A8; // Before items are applied

        DWORD MP = 0x00686448 + 0x1AC; // Effective HP (100 / XXX)
        DWORD maxMP = 0x00686448 + 0x1B0; // Effective maximum HP (XXX / 500)

        DWORD orb_MP = 0x00686448 + 0x1B4; // Percentage of HP orb to display(?)
        
        DWORD gold = 0x00686448 + 0x1CC; // Player's total gold
    };

    int spell_rightClickX = 0x00686448 + 0x1D4;
    int spell_rightClickY = 0x00686448 + 0x1D8;

    int FLAG_isCastingSpell = 0x00686448 + 0x1E0; // 0 = Not casting, 0x0F = casting
    int spell_is_casting_UNKNOWN = 0x00686448 + 1F0; // No idea what this is for; Values change when casting spells

    DWORD FLAG_traveledToLevel = 0x00686448 + 1F4; // 01 01 01 01 = First four stairs used; 20 bytes used
};

If anyone has anything else to add: That'd be awesome! Smile

Reverse engineering Diablo is quite the thrill for me. I'm not even sure why. What a great game.

I am sure it's full of errors (especially since I'm using "DWORD" as a place-holder for now and am aiming towards using only C).
It's just a general concept to help find/locate addresses / offsets / what they're used for in the video game.
Reply


Messages In This Thread
RE: Reverse engineering Diablo v1.09b (last patch) - by TheKillerVortex - 01-31-2018, 02:03 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)