CLEO Help samp_memory

CLEO related
Status
Not open for further replies.

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Can someone explain me how to make use of the following opcodes?
Code:
0B2E: 1@ = read_samp_memory
0B2D: write samp_memory

The mod called mastercar.cs released by TH3RM4L which allows to enter restricted vehicles consists mainly of those two opcodes and I wonder how it works.
Code:
{$CLEO .cs}

thread 'NOPS' 

0ACD: show_text_highpriority "CLEO MADE BY ~R~TH3RM4L" time 10000 

:NOPS_1
wait 0
if 
0AB0: key_pressed 101
else_jump @NOPS_1
0ACD: show_text_highpriority "NOPS ~G~ON" time 1500
0B2E: 1@ = read_samp_memory 0x12D60 size 2
0B2D: write samp_memory 0x12D60 value 0xC390 size 2
0B2E: 2@ = read_samp_memory 0x13FA0 size 2
0B2D: write samp_memory 0x13FA0 value 0xC390 size 2
0B2E: 3@ = read_samp_memory 0x78560 size 2
0B2D: write samp_memory 0x78560 value 0xC20400 size 2
wait 500
jump @NOPS_2

:NOPS_2
wait 0
if
0AB0: key_pressed 101
else_jump @NOPS_2
0ACD: show_text_highpriority "NOPS ~R~OFF" time 1500
0B2D: write samp_memory 0x12D60 value 1@ size 2
0B2D: write samp_memory 0x13FA0 value 2@ size 2
0B2D: write samp_memory 0x78560 value 3@ size 2
wait 500
jump @NOPS_1

I google'd 0x12D60 0xC390 and the rest of these addresses to check what they stand for, find similar ones and potentially make use of them but I can't find anything about it.
 
Joined
Feb 18, 2005
Messages
2,965
Reaction score
272
http://ugbase.eu/notessnippets/0-3z-samp-patches/ - list of NOP samp patches.

0B2E: var@ = read_samp_memory 0xEXAMPLE size 4 - reads the current value of memory from samp.dll module offset, 3 parameters are needed;
var@; the variable in which the readed value is stored
0xEXAMPLE; the offset from samp.dll
size 4; number of bytes to read

0B2D: write_memory 0xEXAMPLE value 0xSHIT size 3 - writes memory to samp.dll module offset, 3 parameters are needed;
0xEXAMPLE; the offset to be written
value 0xSHIT; the new value to be written
size 3; number of bytes to be written, should be equal to number of bytes of value
 

monday

Expert
Joined
Jun 23, 2014
Messages
1,127
Solutions
1
Reaction score
158
Thank you, btw is there any rule about how many bytes should be read for a specific patch?
 
Status
Not open for further replies.
Top