Yay! I've bring better example, but in all, code just looking trash, I hope I'll have time to write my own textDrawer (actually, "shape-drawer"

) with many functions later.
| CODE |
{$CLEO} gosub @_patch
// main loop while true wait 0 0@v = "fx" 4@v = "OverdoseEffects" 0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 100.0 size 80.0 80.0 RGBA 255 255 255 255 0@v = "fonts" 4@v = "font1" 0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 200.0 size 80.0 80.0 RGBA 255 255 255 255 0@v = "sniper" 4@v = "SNIPERcrosshair" 0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 300.0 size 80.0 80.0 RGBA 255 255 255 255 0@v = "male01" 4@v = "male01" 0AB1: call_scm_func @drawTexture 16 txd_name 0@ 1@ 2@ 3@ texture_name 4@ 5@ 6@ 7@ position 100.0 400.0 size 80.0 80.0 RGBA 255 255 255 255 end
// trash :drawTexture 0AA7: call_function 0x731850 num_params 1 pop 1 0@v 25@ if 25@ <> -1 then 0AB1: @txdIndexToRwTexDictionary 1 25@ 26@ if 26@ <> 0 then 0AA7: call_function 0x7F39F0 num_params 2 pop 2 4@v 26@ 27@ if 27@ > 0 then 03F0: enable_text_draw 1 0A8C: write_memory 0x46E62A size 2 value 0x04EB vp 1 074B: draw_texture -1 position 8@ 9@ scale 10@ 11@ texture 27@ color_RGBA 12@ 13@ 14@ 15@ 0A8C: write_memory 0x46E62A size 2 value 0x0DD8 vp 1 end end end 0AB2: ret 0 :txdIndexToRwTexDictionary 0A8D: 1@ = read_memory 0xC8800C size 4 virtual_protect 0 0A8E: 2@ = 1@ + 4 0A8D: 2@ = read_memory 2@ size 4 virtual_protect 0 005A: 2@ += 0@ 0A8D: 2@ = read_memory 2@ size 1 virtual_protect 0 if 2@ > 0 then 0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0 0@ *= 12 005A: 1@ += 0@ 0A8D: 1@ = read_memory 1@ size 4 virtual_protect 0 else 1@ = 0 end 0AB2: ret 1 1@ :_patch 0AC6: 0@ = label @__newTypeTexDrawer offset 0AC6: 1@ = label @__jmp offset 0AB1: call_scm_func @asmdef 4 asm_inj 0@ jump_from 0x46499D then_jump 0x4649A3 offset_jump_in_asm 1@ return :asmdef 0A8C: write_memory 1@ size 1 value 0xE9 virtual_protect 1 0085: 4@ = 1@ 4@ += 5 0062: 0@ -= 4@ 1@ += 1 0A8C: write_memory 1@ size 4 value 0@ virtual_protect 1 0085: 4@ = 3@ 4@ += 5 0062: 2@ -= 4@ 3@ += 1 0A8C: write_memory 3@ size 4 value 2@ virtual_protect 1 0AB2: ret 0 :__newTypeTexDrawer hex 66 81 7E 06 FF FF 74 36 D9 46 0C 8B 56 08 8D 46 1C D9 5C 24 50 D9 46 10 50 8D 4C 24 48 51 8D 4E 18 D9 5C 24 54 89 54 24 4C D9 46 14 D9 5C 24 50 B8 50 83 72 00 FF D0 B8 84 4B 46 00 FF E0 8B 06 48 83 F8 04 end :__jmp hex E9 00 00 00 00 end |
This post has been edited by DK22Pac on Tuesday, Apr 17 2012, 16:28