[SNIPPET] GetChatEntryText (without SF)

Code:
const
SAMP_CHAT_INFO_OFFSET = 0x212A6C //0.3z
end

:getChatEntryText
// 0AB1: call @getChatEntryText 1 id 0@ to 1@
{ In 0@ - number of chat line. 99 line is last.
Out 1@ - line text }
0AB1: call @GetSampBase 0 1@
1@ += SAMP_CHAT_INFO_OFFSET
0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0
1@ += 0x136
0@ *= 252 // size of stChatEntry
005A: 1@ += 0@ // (int)
1@ += 28
0AB2: ret 1 1@

:GetSampBase
0AA2: 31@ = load_library "kernel32.dll" // IF and SET
0AA4: 30@ = get_proc_address "GetModuleHandleA" library 31@ // IF and SET
0AA7: call_function 30@ num_params 1 pop 0 "samp.dll" 0@
0ab2: ret 1 0@

0.3.7
Code:
:getChatEntryText
IF 0AA2: 1@ = "samp.dll"
THEN
    1@ += 0x21A0E4
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@ 
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 

PopandaulX

Active member
Joined
Jul 15, 2013
Messages
189
Reaction score
1
Re: GetChatEntryText (without SF)

Why a whole function to get samp base when you can use
0AA2: $hLIB = load_library "samp.dll" // IF and SET
:surprised:
 

T3KTONIT

Well-known member
Joined
Sep 2, 2013
Messages
308
Reaction score
5
Re: GetChatEntryText (without SF)

:computer_guy:
PopandaulX link said:
Why a whole function to get samp base when you can use
0AA2: $hLIB = load_library "samp.dll" // IF and SET
:surprised:
yep ... it's like fuck it i'm just going to load up kernel32 and then load samp.dll xD
 

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
0.3.7 - R2
PHP:
:getChatEntryText
{
    0.3.7 - R2
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 ChatID 99 _Returned: Text 0@
}
IF 0AA2: 1@ = "samp.dll"
THEN     
    1@ += 0x21A0EC
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
0.3.7 - R3
PHP:
:getChatEntryText
{
    0.3.7 - R3
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 ChatID 99 _Returned: Text 0@
}
IF 0AA2: 1@ = "samp.dll"
THEN    
    1@ += 0x26E8C8
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
0.3.DL
PHP:
:getChatEntryText
{
    0.3.DL
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 ChatID 99 _Returned: Text 0@
}
IF 0AA2: 1@ = "samp.dll"
THEN     
    1@ += 0x2ACA10
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 
Last edited:

Parazitas

God
Joined
Jan 2, 2017
Messages
3,113
Solutions
5
Reaction score
878
Location
Lithuania
0.3.7 - R4
PHP:
:getChatEntryText
{
    0.3.7 - R4
    0AC8: 0@ = allocate_memory_size 260
    0AB1: @getChatEntryText 1 ChatID 99 _Returned: Text 0@
}
IF 0AA2: 1@ = "samp.dll"
THEN     
    1@ += 0x26E9F8
    0A8D: 1@ readMem 1@ sz 4 vp 0
    1@ += 0x132
    0@ *= 0xFC
    005A: 1@ += 0@
    1@ += 0x20
    0AA3: 1@
END
0AB2: ret 1 1@
 
Last edited:
Top