CLEO Help Custom text from memory

CLEO related
Status
Not open for further replies.

mrT101

Active member
Joined
Feb 18, 2014
Messages
58
Reaction score
0
I am trying to read the first 5 characters of a char[6] stored in the exe's memory using the following code but keep getting exceptions and a crash when i run it. The readmemory line works as I use this to read integers in other parts of my code and it works fine.

Code:
0A8D: 4@v = read_memory 1@ size 5 virtual_protect 0

0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'BJ_PUSH' 2@
0AA5: call 0x718600 2 pop 2 2@ 4@v

03F0: enable_text_draw 1
033F: set_text_draw_letter_size 1.0 3.0 
081C: draw_text_outline 1 RGBA 0 0 0 255 
0340: set_text_draw_RGBA 255 255 255 255 
0349: set_text_draw_font 3 
033E: display_text 320.0 180.333 gxt 'BJ_PUSH'
 

ThermaL

Expert
Joined
Oct 23, 2013
Messages
1,593
Reaction score
3
I have something similar and it's working

0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'BJ_PUSH' 3@
0AA5: call 0x718600 2 pop 2 3@ "TEXT"


033E: set_draw_text_position 550.0 5.0 GXT 'BJ_PUSH' 
 

mrT101

Active member
Joined
Feb 18, 2014
Messages
58
Reaction score
0
Yes, I've tried code that does the same as your example and it works fine when I define the string within cleo, e.g. "TEXT".

What I am looking to do is read a string from samp's memory and show it so the problem is likely to be in these lines:

Code:
0A8D: 4@v = read_memory 1@ size 5 virtual_protect 0

0AA5: call 0x718600 2 pop 2 2@ 4@v
 

Opcode.eXe

Expert
Joined
Feb 18, 2013
Messages
1,497
Reaction score
241
Location
( ͡° ͜ʖ ͡°)
0AC8: 0@ = allocate_memory_size 260
0AC8: 1@ = allocate_memory_size 260
0@ = READ_SAMP_TEXT
0AD3: 1@ = format "%s" 0@
0AA8: call_function_method 0x6A0050 0xC1B340 num_params 1 pop 0 'CRED001' 2@
0AA5: call 0x718600 2 pop 2 2@ 1@
03F0: enable_text_draw 1
033F: set_text_draw_letter_size 1.0 3.0
081C: draw_text_outline 1 RGBA 0 0 0 255
0340: set_text_draw_RGBA 255 255 255 255
0349: set_text_draw_font 3
033E: display_text 320.0 180.333 gxt 'CRED001'
0AC9: free_allocated_memory 0@
0AC9: free_allocated_memory 1@
 
Status
Not open for further replies.
Top