0x73616D
Активный
- 140
- 42
Can someone help me rewrite these snippets in C++? | Может ли кто-нибудь помочь мне переписать эти фрагменты на C++?
CLEO:
:get_samp_version_id
// 0AB1: @get_samp_version_id 0 _returned: ID 0@
30@ = 0
IF 0AA2: 31@ = "samp.dll" // IF and SET
THEN
31@ += 0x128
0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
IF 29@ == 0x5542F47A
THEN // 0.3.7 R1
30@ = 1
END
IF 29@ == 0x59C30C94
THEN // 0.3.7 R2
30@ = 2
END
IF 29@ == 0x5A6A3130
THEN // 0.3.DL
30@ = 3
END
31@ -= 8 // reading samp.dll + 0x120
0A8D: 29@ = read_memory 31@ size 4 virtual_protect 1
IF 29@ == 0x5C0B4243
THEN // 0.3.7 R3
30@ = 4
END
IF 29@ == 0x5DD606CD
THEN // 0.3.7 R4
30@ = 5
END
IF 29@ == 0x6094ACAB
THEN // 0.3.7 R4 - v2
30@ = 6
END
IF 29@ == 0x6372C39E
THEN // 0.3.7 R5
30@ = 7
END
END
0AB2: ret 1 30@
CLEO:
:GetLocalPlayerName
{
0AB1: @GetLocalPlayerName 0 _Returned: NameInIntegerFormat 31@
}
IF 0AA2: 31@ = "samp.dll"
THEN
0AB1: @get_samp_version_id 0 _returned: ID 17@
IF 17@ > 0
THEN
IF 17@ == 1 // 0.3.7 R1
THEN
0A8E: 30@ = 31@ + 0x21A0F8 // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3CD // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x18 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x13CD0 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
IF 17@ == 2 // 0.3.7 R2
THEN
0A8E: 30@ = 31@ + 0x21A100 // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3C5 // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x13D90 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
IF 17@ == 3 // 0.3.DL
THEN
0A8E: 30@ = 31@ + 0x2ACA24 // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3DE // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x170C0 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
IF 17@ == 4 // 0.3.7 R3
THEN
0A8E: 30@ = 31@ + 0x26E8DC // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3DE // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x16EF0 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
IF 17@ == 5 // 0.3.7 R4
THEN
0A8E: 30@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3DE // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x8 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x17560 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
IF 17@ == 6 // 0.3.7 R4 - v2
THEN
0A8E: 30@ = 31@ + 0x26EA0C // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3DE // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x175B0 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
IF 17@ == 7 // 0.3.7 R5
THEN
0A8E: 30@ = 31@ + 0x26EB94 // SAMP_INFO_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x3DE // SAMP_PPOOLS_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
30@ += 0x4 // SAMP_PPOOL_PLAYER_OFFSET
0A8D: 30@ = readMem 30@ sz 4 vp 0
0A8E: 29@ = 31@ + 0x175B0 // SAMP_GET_LOCAL_PLAYER_NAME_OFFSET
END
0AA8: call_function_method 29@ struct 30@ num_params 0 pop 0 _Returned: Name 28@
/// Returned value is in integer, convert integer to string to get string...
END
END
0AB2: ret 0