Page 1 of 1

Global extern with Base Pointer ???

PostPosted: Sat Aug 11, 2007 10:30 pm
by xplorexxx
Hi bro,

How can i initialize a global extern variable at Base Add Pointer + Offset.For ex:

Code: Select all
extern struct NPC Player = {"", [0x00DC9988] + 0xABCD};


This code doesn't work.

Help me please.

PostPosted: Sun Aug 12, 2007 10:13 am
by L. Spiro
Because it is gobal you have to make a structure and initialize as a pointer to that structure.
If it was not global, you would have other options, but this is still the correct solution anyway.



Code: Select all
extern struct BASE {
    BYTE bOffset[0xABCD];
    NPC Player;
} * e_pbBase = { "", 0x00DC9988 };




The BASE structure fills in the offset for you, cleanly putting your NPC structure 0xABCD bytes after the location where 0x00DC9988 points.



L. Spiro

PostPosted: Sun Aug 12, 2007 11:44 am
by xplorexxx
Thank bro.

PostPosted: Mon Sep 03, 2007 7:43 pm
by xplorexxx
Hi bro,
How can I initialize a global extern with baseAdd 0x5A60A0 like this:
Code: Select all
[[[[[0x5A60A0]+0x3C]+0x3C]+0x48]+0x4]


Thanks

PostPosted: Mon Sep 03, 2007 10:20 pm
by L. Spiro
Code: Select all
extern struct {
    BYTE    bBuffer[0x3C];
    struct {
        BYTE    bBuffer[0x3C];
        struct {
            BYTE    bBuffer[0x48];
            struct {
                BYTE    bBuffer[0x4];
                PDWORD   pdwVal;
            } * s;
        } * s;
    } * s;
} * e_sObject = { "", 0x5A60A0 };


Accessed via:
Code: Select all
e_sObject->s->s->s->pdwVal;



L. Spiro

PostPosted: Tue Sep 04, 2007 9:00 am
by xplorexxx
Thank man very much