need 0.3.dl SAMP_INFO_SETTINGS_OFFSET

murakami

Известный
Автор темы
131
13
0x3c5 based on 0.3.7
curious about the offset address of SAMP_INFO_SETTINGS_OFFSET 0.3.dl.

i need 0.3.dl nametag hack


global SAMP_INFO_SETTINGS_OFFSET := 0x3C5 ; v0.3.7

getTagNameCurrentDistance() {
if(!checkHandles())
return -1

dwSAMPInfo := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET[sampVersion])
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return -1
}

dwSAMPInfoSettings := readDWORD(hGTA, dwSAMPInfo + SAMP_INFO_SETTINGS_OFFSET)
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return -1
}

distance := readFloat(hGTA, dwSAMPInfoSettings + 0x27)
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return -1
}

ErrorLevel := ERROR_OK
return distance
}

setTagNameDistance(status, distance) {
if(!checkHandles())
return -1

status := status ? 1 : 0

dwSAMPInfo := readDWORD(hGTA, dwSAMP + SAMP_INFO_OFFSET[sampVersion])
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return -1
}

dwSAMPInfoSettings := readDWORD(hGTA, dwSAMPInfo + SAMP_INFO_SETTINGS_OFFSET)
if(ErrorLevel) {
ErrorLevel := ERROR_READ_MEMORY
return -1
}

writeByte(hGTA, dwSAMPInfoSettings + 0x38, 1)
if(ErrorLevel) {
ErrorLevel := ERROR_WRITE_MEMORY
return -1
}

writeByte(hGTA, dwSAMPInfoSettings + 0x2F, status)
if(ErrorLevel) {
ErrorLevel := ERROR_WRITE_MEMORY
return -1
}

writeFloat(hGTA, dwSAMPInfoSettings + 0x27, distance)
if(ErrorLevel) {
ErrorLevel := ERROR_WRITE_MEMORY
return -1
}

ErrorLevel := ERROR_OK
return
}
 
Последнее редактирование:
Решение
Offset is 0x3D5.
39414

index

Известный
126
82
You just need to calculate pSettings offset of stSAMP structure. Its in samp.h file of 0.3dl sobeit sources.
C++:
#pragma pack(push, 1)
struct stSAMP
{
    uint8_t                      _pad0[20];
    void                *pUnk0;
    struct stServerInfo        *pServerInfo;
    uint8_t                _pad1[16];
    void                *pRakClientInterface;
    char                szIP[256 + 1];
    char                szHostname[256 + 1];
    uint8_t                     _pad2;
    bool                        m_bUpdateCameraTarget;
    bool                m_bNoNameTagStatus;
    uint32_t            ulPort;
    BOOL                m_bLanMode;
    uint32_t            ulMapIcons[SAMP_MAX_MAPICONS];  
    Gamestate            iGameState;
    uint32_t            ulConnectTick;
    struct stServerPresets        *pSettings;
    uint8_t                     _pad3[5];
    struct stSAMPPools        *pPools;
};
#pragma pack(pop)
 
  • Нравится
Реакции: murakami и ШPEK

murakami

Известный
Автор темы
131
13
You just need to calculate pSettings offset of stSAMP structure. Its in samp.h file of 0.3dl sobeit sources.
C++:
#pragma pack(push, 1)
struct stSAMP
{
    uint8_t                      _pad0[20];
    void                *pUnk0;
    struct stServerInfo        *pServerInfo;
    uint8_t                _pad1[16];
    void                *pRakClientInterface;
    char                szIP[256 + 1];
    char                szHostname[256 + 1];
    uint8_t                     _pad2;
    bool                        m_bUpdateCameraTarget;
    bool                m_bNoNameTagStatus;
    uint32_t            ulPort;
    BOOL                m_bLanMode;
    uint32_t            ulMapIcons[SAMP_MAX_MAPICONS];
    Gamestate            iGameState;
    uint32_t            ulConnectTick;
    struct stServerPresets        *pSettings;
    uint8_t                     _pad3[5];
    struct stSAMPPools        *pPools;
};
#pragma pack(pop)
good. yes. I just have already checked this. but I don't know how to calculate it. can you help me? because I can't use cpp, I only use ahk.
bool m_bNoNameTagStatus;
You just need to calculate pSettings offset of stSAMP structure. Its in samp.h file of 0.3dl sobeit sources.
C++:
#pragma pack(push, 1)
struct stSAMP
{
    uint8_t                      _pad0[20];
    void                *pUnk0;
    struct stServerInfo        *pServerInfo;
    uint8_t                _pad1[16];
    void                *pRakClientInterface;
    char                szIP[256 + 1];
    char                szHostname[256 + 1];
    uint8_t                     _pad2;
    bool                        m_bUpdateCameraTarget;
    bool                m_bNoNameTagStatus;
    uint32_t            ulPort;
    BOOL                m_bLanMode;
    uint32_t            ulMapIcons[SAMP_MAX_MAPICONS]; 
    Gamestate            iGameState;
    uint32_t            ulConnectTick;
    struct stServerPresets        *pSettings;
    uint8_t                     _pad3[5];
    struct stSAMPPools        *pPools;
};
#pragma pack(pop)

39409

I dont know how to use ida. but I found the above address. what should I do more?
 
Последнее редактирование:

index

Известный
126
82
good. yes. I just have already checked this. but I don't know how to calculate it. can you help me? because I can't use cpp, I only use ahk.
You can use this structure calculator, but sometimes it works incorrectly ( or I did something wrong :D ).
Just add up the dimensions of the elements taking into account the alignment and you will get the necessary offset.
https://stackoverflow.com/questions/4306186/structure-padding-and-packing
https://docs.microsoft.com/en-us/cpp/preprocessor/pack?view=vs-2017
 

murakami

Известный
Автор темы
131
13
You can use this structure calculator, but sometimes it works incorrectly ( or I did something wrong :D ).
Just add up the dimensions of the elements taking into account the alignment and you will get the necessary offset.
https://stackoverflow.com/questions/4306186/structure-padding-and-packing
https://docs.microsoft.com/en-us/cpp/preprocessor/pack?view=vs-2017
thank you for the reply. But I have no ability to carry it out. hope someone helps me directly.

39410
 
Последнее редактирование:

index

Известный
126
82
Последнее редактирование:

murakami

Известный
Автор темы
131
13
Use C types, not C++. Also, this program cannot know the size of types that were not previously defined, such as BOOL and GameState. You can replace the BOOL and bool with a char and replace the GameState with int.

Offset: 48
and I tried as below
samp.dll + SAMP_INFO_OFFSET(0.3.DL 0x2ACA24) + SAMP_INFO_SETTINGS_OFFSET (48)
but it output 0. not a valid address did I get the wrong offset?

I did not learn c. I only use ahk.

39411

using samp udf
 
Последнее редактирование: