The Mod Cave

by spaceeinstein

This page showcases my modifications in chronological order of release. Most of them utilize CLEO for GTA: Vice City, an enhanced scripting extension that allows the use of custom scripting language for Sanny Builder without the need to modify the main script file, main.scm.


Modifications for Vice City


Source codes

Vice City Radar Zoom

const
ZOOM = 0@
ZOOM_CAR = 1@
EFFECT = 2@
end

ZOOM = 180.0
EFFECT = 0
while true
    wait 10 ms
    if
        05EE:   key_pressed 84  // T
    then
        16@ = 0
        ZOOM = 350.0  // minimum zoom set to 350
        ZOOM_CAR = 0.0  // fast car dynamic zoom set to 0
        05DF: write_memory 0x974BEC size 4 value ZOOM virtual_protect 0  // current zoom lvl
        EFFECT = 1
    end
    if
        ZOOM >= 180.0
    then
        if
            16@ > 1000
        then
            ZOOM -= 10.0
            ZOOM_CAR += 10.0
            if
                180.0 > ZOOM
            then
                ZOOM = 180.0  // minimum zoom default 180
                ZOOM_CAR = 170.0  // fast car dynamic zoom default 170.0, difference between max and min (350 - 180 = 170)
                EFFECT = 0
            end
        else
            if
                EFFECT == 1  // prevents crash when game starts loading
            then
                05DF: write_memory 0xA0CFD4 size 4 value 1 virtual_protect 1  // car name stage
                05DF: write_memory 0x978D10 size 4 value 1 virtual_protect 1  // area name stage
            end
        end
    end
    05DF: write_memory 0x4C5CD5 size 4 value ZOOM virtual_protect 1  // in car min zoom
    05DF: write_memory 0x4C5D26 size 4 value ZOOM virtual_protect 1  // on foot min zoom
    05DF: write_memory 0x68FF04 size 4 value ZOOM_CAR virtual_protect 0  // fast car dynamic zoom
    05DF: write_memory 0x68FF0C size 4 value ZOOM virtual_protect 0  // minimum fast car dynamic zoom
end

Vice City Bomb Selector

const
PLAYER_CAR = 0@
TOT_NUM_GRG = 1@
GRG_OFFSET = 2@
GRG_POS_X = 3@
POS_X = 4@
GRG_POS_Y = 5@
POS_Y = 6@
GRG_POS_Z = 7@
POS_Z = 8@
INCREMENT = 9@
GRG_TYPE = 10@
end

var
TOT_NUM_GRG : integer
GRG_OFFSET : integer
GRG_POS_X : integer
GRG_POS_Y : integer
GRG_POS_Z : integer
INCREMENT : integer
GRG_TYPE : integer
end

05E0: TOT_NUM_GRG = read_memory 0x978DA4 size 4 virtual_protect 0  // get total number of created garages
GRG_OFFSET = 0x812668
INCREMENT = 0

while true  // check if vc bomb garage exists
    wait 10 ms
    if
        not INCREMENT == TOT_NUM_GRG
    then
        GRG_POS_X = GRG_OFFSET
        GRG_POS_Y = GRG_OFFSET
        GRG_POS_Z = GRG_OFFSET
        GRG_POS_X += 0x1C
        GRG_POS_Y += 0x20
        GRG_POS_Z += 0x24
        05E0: POS_X = read_memory GRG_POS_X size 4 virtual_protect 0
        05E0: POS_Y = read_memory GRG_POS_Y size 4 virtual_protect 0
        05E0: POS_Z = read_memory GRG_POS_Z size 4 virtual_protect 0
        if and
            POS_X == -1163.248
            POS_Y == -1407.282
            POS_Z == 10.157
        then
            GRG_TYPE = 4
            
            while true  // create interaction
                wait 10 ms
                if
                    00E0:   player 0 driving
                then
                    03C1: PLAYER_CAR = player 0 car
                    if and
                        80E1:   not key_pressed 0 16  // accelerate
                        01B0:   car PLAYER_CAR stopped_in_sphere 1 near_point -1154.91 -1405.25 11.2 radius 5.0 5.0 5.0
                    then
                        0512: permanent_text_box 'SEBOMB0'
                        while true
                            wait 100 ms
                            if
                                80E1:   not key_pressed 0 16  // accelerate
                            then
                                if
                                    0256:   player 0 defined
                                then
                                    01B4: set_player 0 not_frozen 0
                                    if
                                        GRG_TYPE == 2
                                    then
                                        00BC: text_highpriority 'SEBOMB1' 100 ms 1
                                    end
                                    if
                                        GRG_TYPE == 3
                                    then
                                        00BC: text_highpriority 'SEBOMB2' 100 ms 1
                                    end
                                    if
                                        GRG_TYPE == 4
                                    then
                                        00BC: text_highpriority 'SEBOMB3' 100 ms 1
                                    end
                                    if
                                        00E1:   key_pressed 0 10  // left
                                    then
                                        GRG_TYPE -= 1
                                        if
                                            GRG_TYPE == 1
                                        then
                                            GRG_TYPE = 4
                                        end
                                    end
                                    if
                                        00E1:   key_pressed 0 11  // right
                                    then
                                        GRG_TYPE += 1
                                        if
                                            GRG_TYPE == 5
                                        then
                                            GRG_TYPE = 2
                                        end
                                    end
                                end
                            else
                                if
                                    0256:   player 0 defined
                                then
                                    01B4: set_player 0 not_frozen 1
                                end
                                05DF: write_memory GRG_OFFSET size 1 value GRG_TYPE virtual_protect 0
                                break
                            end
                        end
                        03E6: remove_text_box
                    end
                end
            end

        else
            GRG_OFFSET += 0xA8
            INCREMENT += 1
        end
    else
        05DC: end_custom_thread
    end
end

Small Boat Mod Fix

const
ADDRESS = 0@
INDEX = 1@
end

0000:
while true
    wait 10 ms
    if
        00E1:   key_pressed 0 19
    then
        if
            00DE:   player 0 driving_vehicle_type #SPEEDER
        then
            ADDRESS = 0x5A4EE6
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #REEFER
        then
            ADDRESS = 0x5A4F66
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #PREDATOR
        then
            ADDRESS = 0x5A4FE6
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #DINGHY
        then
            ADDRESS = 0x5A5066
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #COASTG
        then
            ADDRESS = 0x5A50E6
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #RIO
        then
            ADDRESS = 0x5A5166
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #SQUALO
        then
            ADDRESS = 0x5A51E6
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #MARQUIS
        then
            ADDRESS = 0x5A5266
            gosub @gosub
        end
        if
            00DE:   player 0 driving_vehicle_type #TROPIC
        then
            ADDRESS = 0x5A52E6
            gosub @gosub
        end
    end
end

:gosub
INDEX = 0
while 001B: 12 > INDEX
    wait 0
    05DF: write_memory ADDRESS size 4 value 0.0 virtual_protect 1
    INDEX += 1
    ADDRESS += 0xA
end
return

Vice City Adrenaline

const
DURATION = 0@
CURRENT_TIME = 1@
ADRENALINE_MODE = 2@
STAGE = 3@
VALUE_1 = 4@
VALUE_2 = 5@
WAIT_TIME = 50
end
var
CURRENT_TIME : integer
WAIT_TIME : integer
end

STAGE = 0  // stage 0

while true
    wait WAIT_TIME
    05E0: VALUE_1 = read_memory 0xA10942 size 4 virtual_protect 0
    05E0: VALUE_2 = read_memory 0xA10946 size 2 virtual_protect 0
    if and
        VALUE_1 == 0x55474D45  // ugme
        VALUE_2 == 0x4452  // dr
    then
        STAGE += 1
        05DF: write_memory 0xA10942 size 1 val 0x20 virtual_protect 0
        03E5: text_box 'CHEAT1'
    end
    if
        STAGE == 1  // stage 1
    then
        05E6: DURATION = actor $PLAYER_ACTOR struct
        DURATION += 0x634  // adrenaline duration = future time - current time 
        05E0: CURRENT_TIME = read_memory 0x974B2C size 4 virtual_protect 0  // current time
        CURRENT_TIME += WAIT_TIME  // future time = value, 20000 by default
        05DF: write_memory DURATION size 4 value CURRENT_TIME virtual_protect 0  // set adrenaline duration
        05E6: ADRENALINE_MODE = actor $PLAYER_ACTOR struct
        ADRENALINE_MODE += 0x63B
        05DF: write_memory ADRENALINE_MODE size 1 value 1 virtual_protect 0  // adrenaline mode, does not need reset
    end
    if or
        00E0:   player 0 driving
        STAGE == 2  // stage 2
    then
        05E6: DURATION = actor $PLAYER_ACTOR struct
        DURATION += 0x634
        05DF: write_memory DURATION size 4 value 0 virtual_protect 0  // turns off adrenaline
        STAGE = 0
    end
end

Vice City Car Alarm

const
INDEX = 0@
MEM = 1@
VAL = 2@
end
var
INDEX : integer
MEM : integer
VAL : integer
end

05DF: write_memory 0x5F0457 size 1 value 0xB0 virtual_protect 1  // use siren instead of horn
05DF: write_memory 0x5F04C6 size 1 value 12 virtual_protect 1  // reduce delay after each play
INDEX = 0
while INDEX < 106
    wait 0
    MEM = INDEX  // difference between target vehicle and landstalker
    MEM *= 28  // struct 28 bytes in size
    MEM += 0x6AD1B0  // add to base address
    05E0: VAL = read_memory MEM size 4 virtual_protect 0
    if
        VAL == 0  // check if it doesn't have a siren already
    then
        05DF: write_memory MEM size 4 value 52 virtual_protect 1  // siren/alarm sound
    end
    INDEX += 1
end
05DC: end_custom_thread

Emergency Vehicle Crane

const
ADDR = 0@
LOCATION = 1@
COLLECTED = 2@
PICKUP_GENERATED = 3@
PICKUP_POLICE = 4@
PICKUP_ENFORCER = 5@
PICKUP_FBIRANCH = 6@
PICKUP_RHINO = 7@
PICKUP_BARRACKS = 8@
PICKUP_AMBULAN = 9@
PICKUP_FIRETRUK = 10@
CAR_CREATED = 11@
CAR_MODEL = 12@
CAR = 13@
ALL_COLLECTED = 0x7F
DISTANCE = 90.0
end

// initialize prereward crane
05E0: COLLECTED = read_memory 0x9B6CE4 size 1 virtual_protect 0  // get collected
if
    not COLLECTED == ALL_COLLECTED
then
    ADDR = 0x7E40C4 // base crane address
    05DF: write_memory ADDR size 4 value -974.0 virtual_protect 1  // x1
    ADDR += 4
    05DF: write_memory ADDR size 4 value -954.0 virtual_protect 1  // x2
    ADDR += 4
    05DF: write_memory ADDR size 4 value -1500.0 virtual_protect 1  // y1
    ADDR += 4
    05DF: write_memory ADDR size 4 value -1480.0 virtual_protect 1  // y2
    ADDR += 16
    05DF: write_memory ADDR size 4 value 2.75 virtual_protect 1  // dest heading
    ADDR += 4
    05DF: write_memory ADDR size 4 value 2.35 virtual_protect 1  // idle rotation
    ADDR += 4
    05DF: write_memory ADDR size 4 value 3.92 virtual_protect 1  // dest rotation
    ADDR += 4
    05DF: write_memory ADDR size 4 value 20.0 virtual_protect 1  // idle dist
    ADDR += 4
    05DF: write_memory ADDR size 4 value 20.0 virtual_protect 1  // dest dist
    ADDR += 4
    05DF: write_memory ADDR size 4 value 25.0 virtual_protect 1  // idle height
    ADDR += 4
    05DF: write_memory ADDR size 4 value 25.0 virtual_protect 1  // dest height
    ADDR += 56
    05DF: write_memory ADDR size 1 value 1 virtual_protect 1  // activity
    05DF: write_memory 0x5A8083 size 1 value 1 virtual_protect 1  // military restriction
    05DF: write_memory 0x5A822A size 1 value 1 virtual_protect 1  // does military crane have this already
    05DF: write_memory 0x5A826B size 1 value 1 virtual_protect 1  // does military crane pick this up
    05DF: write_memory 0x5A8CAE size 1 value 1 virtual_protect 1  // reward military crane
    
    // detect completion
    while true
        wait 1000
        
        // convert crane for reward
        05E0: COLLECTED = read_memory 0x9B6CE4 size 1 virtual_protect 0  // get crane collected cars
        if
            COLLECTED == ALL_COLLECTED  // crane collected 7
        then
            00BA: text_styled 'GA_14' 5000 ms 5  // All the cars. NICE! Here's a little something.
            0109: player 0 money += 20000
            05DF: write_memory 0x7E4130 size 0 value 1 virtual_protect 1  // halt crane activity
            05DF: write_memory 0x7E4132 size 1 value 0 virtual_protect 1  // collected cars
            05DF: write_memory 0x5A8083 size 1 value 0 virtual_protect 1  // military restriction
            05DF: write_memory 0x5A822A size 1 value 0 virtual_protect 1  // does military crane have this already
            05DF: write_memory 0x5A826B size 1 value 0 virtual_protect 1  // does military crane pick this up
            05DF: write_memory 0x5A8CAE size 1 value 0 virtual_protect 1  // reward military crane
            break
        end
    end
end

// initialize reward crane
if
    COLLECTED == ALL_COLLECTED
then
    ADDR = 0x7E40C4 // base crane address
    05DF: write_memory ADDR size 4 value -974.0 virtual_protect 1  // x1
    ADDR += 4
    05DF: write_memory ADDR size 4 value -954.0 virtual_protect 1  // x2
    ADDR += 4
    05DF: write_memory ADDR size 4 value -1530.0 virtual_protect 1  // y1
    ADDR += 4
    05DF: write_memory ADDR size 4 value -1510.0 virtual_protect 1  // y2
    ADDR += 16
    05DF: write_memory ADDR size 4 value 1.18 virtual_protect 1  // dest heading
    ADDR += 4
    05DF: write_memory ADDR size 4 value 3.92 virtual_protect 1  // idle rotation
    ADDR += 4
    05DF: write_memory ADDR size 4 value 2.35 virtual_protect 1  // dest rotation
    ADDR += 4
    05DF: write_memory ADDR size 4 value 5.0 virtual_protect 1  // idle dist
    ADDR += 4
    05DF: write_memory ADDR size 4 value 20.0 virtual_protect 1  // dest dist
    ADDR += 4
    05DF: write_memory ADDR size 4 value 28.0 virtual_protect 1  // idle height
    ADDR += 4
    05DF: write_memory ADDR size 4 value 18.0 virtual_protect 1  // dest height
    ADDR += 56
    05DF: write_memory ADDR size 1 value 2 virtual_protect 1  // activity
    wait 0
    05DF: write_memory ADDR size 1 value 1 virtual_protect 1  // activity
    ADDR += 1
    05DF: write_memory ADDR size 1 value 0 virtual_protect 1  // status
    05DF: write_memory 0x7E4132 size 1 value 0 virtual_protect 1  // collected cars
    05DF: write_memory 0x5A8083 size 1 value 0 virtual_protect 1  // military restriction
    05DF: write_memory 0x5A822A size 1 value 0 virtual_protect 1  // does military crane have this already
    05DF: write_memory 0x5A826B size 1 value 0 virtual_protect 1  // does military crane pick this up
    05DF: write_memory 0x5A8CAE size 1 value 0 virtual_protect 1  // reward military crane
    
    PICKUP_GENERATED = 0
    CAR_CREATED = 0
    while true
        wait 100
        if
            0256:   player 0 defined
        then
            if
                00F5:   player 0 0 -969.535 -1500.98 12.7 radius DISTANCE DISTANCE DISTANCE
            then
                if and
                    PICKUP_GENERATED == 0
                    CAR_CREATED == 0
                then
                    gosub @destroy_pickups
                    032B: PICKUP_POLICE = create_weapon_pickup 376 3 ammo 1 at -955.66 -1506.68 12.2
                    032B: PICKUP_ENFORCER = create_weapon_pickup 376 3 ammo 2 at -960.285 -1504.78 12.2
                    032B: PICKUP_FBIRANCH = create_weapon_pickup 376 3 ammo 3 at -964.91 -1502.88 12.2
                    032B: PICKUP_RHINO = create_weapon_pickup 376 3 ammo 4 at -969.535 -1500.98 12.2
                    032B: PICKUP_BARRACKS = create_weapon_pickup 376 3 ammo 5 at -974.16 -1499.08 12.2
                    032B: PICKUP_AMBULAN = create_weapon_pickup 376 3 ammo 6 at -978.785 -1497.18 12.2
                    032B: PICKUP_FIRETRUK = create_weapon_pickup 376 3 ammo 7 at -983.41 -1495.28 12.2
                    05DF: write_memory 0x688230 size 4 value 0x494C4F50 virtual_protect 1  // "POLI"
                    05DF: write_memory 0x688234 size 4 value 0x00524143 virtual_protect 1  // "CAR\0"
                    05DF: write_memory 0x688238 size 4 value 0x4F464E45 virtual_protect 1  // "ENFO"
                    05DF: write_memory 0x68823C size 4 value 0x00524352 virtual_protect 1  // "RCR\0"
                    05DF: write_memory 0x688240 size 4 value 0x52494246 virtual_protect 1  // "FBIR"
                    05DF: write_memory 0x688244 size 4 value 0x00434E41 virtual_protect 1  // "ANC\0"
                    05DF: write_memory 0x688248 size 4 value 0x4E494852 virtual_protect 1  // "RHIN"
                    05DF: write_memory 0x68824C size 4 value 0x0000004F virtual_protect 1  // "O\0\0\0"
                    05DF: write_memory 0x688250 size 4 value 0x52524142 virtual_protect 1  // "BARR"
                    05DF: write_memory 0x688254 size 4 value 0x00534B43 virtual_protect 1  // "CKS\0"
                    05DF: write_memory 0x688258 size 4 value 0x55424D41 virtual_protect 1  // "AMBU"
                    05DF: write_memory 0x68825C size 4 value 0x004E414C virtual_protect 1  // "LAN\0"
                    05DF: write_memory 0x688260 size 4 value 0x45524946 virtual_protect 1  // "FIRE"
                    05DF: write_memory 0x688264 size 4 value 0x004B5254 virtual_protect 1  // "TRK\0"
                    05DF: write_memory 0x43F107 size 4 value 0x0068E934 virtual_protect 1  // pickup glow
                    05DF: write_memory 0x43F120 size 1 value 0 virtual_protect 1  // pickup glow
                    PICKUP_GENERATED = 1
                end
            else
                if
                    PICKUP_GENERATED == 1
                then
                    gosub @destroy_pickups
                end
                CAR_CREATED = 0
            end
            if and
                PICKUP_GENERATED == 1
                CAR_CREATED == 0
            then
                if
                    0214:   pickup PICKUP_POLICE picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #POLICE
                    gosub @create_car
                end
                if
                    0214:   pickup PICKUP_ENFORCER picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #ENFORCER
                    gosub @create_car
                end
                if
                    0214:   pickup PICKUP_FBIRANCH picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #FBIRANCH
                    gosub @create_car
                end
                if
                    0214:   pickup PICKUP_RHINO picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #RHINO
                    gosub @create_car
                end
                if
                    0214:   pickup PICKUP_BARRACKS picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #BARRACKS
                    gosub @create_car
                end
                if
                    0214:   pickup PICKUP_AMBULAN picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #AMBULAN
                    gosub @create_car
                end
                if
                    0214:   pickup PICKUP_FIRETRUK picked_up
                then
                    gosub @destroy_pickups
                    CAR_MODEL = #FIRETRUK
                    gosub @create_car
                end
            end
        end
    end
end

:destroy_pickups
0215: destroy_pickup PICKUP_POLICE
0215: destroy_pickup PICKUP_ENFORCER
0215: destroy_pickup PICKUP_FBIRANCH
0215: destroy_pickup PICKUP_RHINO
0215: destroy_pickup PICKUP_BARRACKS
0215: destroy_pickup PICKUP_AMBULAN
0215: destroy_pickup PICKUP_FIRETRUK
05DF: write_memory 0x688230 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x688234 size 4 value 0x00003154 virtual_protect 1  // "T1\0\0"
05DF: write_memory 0x688238 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x68823C size 4 value 0x00003254 virtual_protect 1  // "T2\0\0"
05DF: write_memory 0x688240 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x688244 size 4 value 0x00003354 virtual_protect 1  // "T3\0\0"
05DF: write_memory 0x688248 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x68824C size 4 value 0x00003454 virtual_protect 1  // "T4\0\0"
05DF: write_memory 0x688250 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x688254 size 4 value 0x00003554 virtual_protect 1  // "T5\0\0"
05DF: write_memory 0x688258 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x68825C size 4 value 0x00003654 virtual_protect 1  // "T6\0\0"
05DF: write_memory 0x688260 size 4 value 0x4654554F virtual_protect 1  // "OUTF"
05DF: write_memory 0x688264 size 4 value 0x00003754 virtual_protect 1  // "T7\0\0"
05DF: write_memory 0x43F107 size 4 value 0x0068E940 virtual_protect 1  // pickup glow
05DF: write_memory 0x43F120 size 1 value 1 virtual_protect 1  // pickup glow
PICKUP_GENERATED = 0
return

:create_car
0247: request_model CAR_MODEL
while 8248:   not model CAR_MODEL available
    wait 0
end
00A5: CAR = create_car CAR_MODEL at -964.0 -1520.0 18.5
0249: release_model CAR_MODEL
0175: set_car CAR z_angle_to 247.68 
020A: set_car CAR door_status_to 1
01C3: remove_references_to_car CAR
CAR_CREATED = 1
return

Aquatic Life

const
ARRAY_ADDRESS = 0@
OFFSET_ADDRESS = 1@
INDEX = 2@
MAX_MEMORY = 3@
VALUE_1 = 4@
VALUE_2 = 5@
VALUE_3 = 6@
DEBUG = 7@
MAX_COUNT = 8@
end

var
OFFSET_ADDRESS : integer
ARRAY_ADDRESS : integer
MAX_MEMORY : integer
VALUE_1 : integer
VALUE_2 : integer
MAX_COUNT : integer
end

// struct 0x18 each
MAX_MEMORY = 127
MAX_MEMORY *= 0x18
// initialise array
0AC8: ARRAY_ADDRESS = allocate_memory_size MAX_MEMORY
OFFSET_ADDRESS = ARRAY_ADDRESS
OFFSET_ADDRESS += 0x14
for INDEX = 0 to 127
    0A8C: write_memory OFFSET_ADDRESS size 4 value 4 virtual_protect 1
    OFFSET_ADDRESS += 0x18
end
// remove duration to spawn
0A8C: write_memory 0x5BC34B size 4 value 0 virtual_protect 1
// redirect array to allocated memory
0A8C: write_memory 0x636E46 size 4 value ARRAY_ADDRESS virtual_protect 1
0A8C: write_memory 0x636EE7 size 4 value ARRAY_ADDRESS virtual_protect 1
0A8C: write_memory 0x63754C size 4 value ARRAY_ADDRESS virtual_protect 1
0A8C: write_memory 0x636EB0 size 1 value 127 virtual_protect 1
0A8C: write_memory 0x6371E9 size 1 value 127 virtual_protect 1
0A8C: write_memory 0x63755C size 1 value 127 virtual_protect 1
// initialise max object limit to 8 when creating
0A8C: write_memory 0x636D16 size 1 value 8 virtual_protect 1
0A8C: write_memory 0x63722F size 1 value 8 virtual_protect 1

MAX_COUNT = 8
DEBUG = 0
while true
    wait 10
    // remove aquatic life during cutscenes
    0A8D: VALUE_1 = read_memory 0xA10B64 size 1 virtual_protect 0
    if
        VALUE_1 == 1
    then
        0AA5: call 0x636E40 num_params 0 pop 0
    end
    // debug
    if
        0ADC:   test_cheat "AQUATIC"
    then
        if
            DEBUG == 0
        then
            DEBUG = 1
        else
            DEBUG = 0
        end
    end
    if
        DEBUG == 1
    then
        0A8D: VALUE_1 = read_memory 0x9B5F80 size 4 virtual_protect 0
        02FD: text_2numbers_highpriority 'AQUATIC' VALUE_1 MAX_COUNT time 10 1
        if
            00E1:   player 0 pressed_button 7
        then
            MAX_COUNT += 1
            if
                MAX_COUNT > 127
            then
                MAX_COUNT = 127
            end
            gosub @UPDATE
        end
        if
            00E1:   player 0 pressed_button 5
        then
            MAX_COUNT -= 1
            if
                MAX_COUNT < VALUE_1
            then
                MAX_COUNT = VALUE_1
            end
            if
                MAX_COUNT < 0
            then
                MAX_COUNT = 0
            end
            gosub @UPDATE
        end
    end
end

:UPDATE
// max object limit set to MAX_COUNT
0A8C: write_memory 0x636D16 size 1 value MAX_COUNT virtual_protect 1
0A8C: write_memory 0x63722F size 1 value MAX_COUNT virtual_protect 1
return

Vice City Detonator

// weapon cheat gives 100 grenades
05DF: write_memory 0x4AED27 size 1 value 100 virtual_protect 1
// prevents switching to detonator
05DF: write_memory 0x5D49C7 size 1 value 0xD virtual_protect 1
// allows scrolling with detonator
05DF: write_memory 0x5345ED size 4 value 0x90909090 virtual_protect 1
05DF: write_memory 0x5345F1 size 4 value 0x90909090 virtual_protect 1
05DF: write_memory 0x5345F5 size 1 value 0x90 virtual_protect 1
05DC: end_custom_thread

Jump and Fly

const
IS_ENABLED = 0@
PLAYER_STRUCT = 1@
end

IS_ENABLED = 0
0A8C: write_memory 0x4F03D3 size 1 value 0x75 virtual_protect 1
while true
    wait 10
    if
        0ADC:   test_cheat "JUMPANDFLY"
    then
        if
            IS_ENABLED == 0
        then
            0ACA: show_text_box "Cheat activated"
            IS_ENABLED = 1
            0A8C: write_memory 0x4F03D3 size 1 value 0xEB virtual_protect 1
        else
            0ACA: show_text_box "Cheat deactivated"
            IS_ENABLED = 0
            0A8C: write_memory 0x4F03D3 size 1 value 0x75 virtual_protect 1
        end
    end
    if and
        IS_ENABLED == 1
        00E1:   player 0 pressed_button 14  // jump
    then
        0A8D: PLAYER_STRUCT = read_memory 0x94AD28 size 4 virtual_protect 0
        0AA6: call_method 0x4F03C0 struct PLAYER_STRUCT num_params 0 pop 0
    end
end

Potent Tear Gas

const
STRUCT_BEGIN = 0x945D30
STRUCT_SIZE = 0x34
INDEX = 0@
TEMP_VAR = 1@
PICKUP_LOCATION = 2@
STRUCT_ELEMENT = 3@
PICKUP_ENTITY = 4@
PICKUP_MODEL = 5@
OBJECT_ENTITY = 6@
LABEL_OFFSET = 7@
TEMP_FVAR = 8@
end
var
INDEX : int
TEMP_VAR : int
PICKUP_LOCATION : int
STRUCT_ELEMENT : int
PICKUP_ENTITY : int
PICKUP_MODEL : int
TEMP_FVAR : float
end

0247: request_model #TEARGAS
038B: load_requested_models
wait 1000
0AC6: LABEL_OFFSET = label @HEX_VALUE offset
0A8C: write_memory 0x4D4ED6 size 4 val LABEL_OFFSET virtual_protect 1 // make gas more potent
0A8C: write_memory 0x4D4E0F size 4 val 0x90909090 virtual_protect 1 // allows anyone to get damaged by it
0A8C: write_memory 0x4D4E13 size 2 val 0x9090 virtual_protect 1
INDEX = 0

0A8C: write_memory 0x4D4ECE size 1 value 0xE9 virtual_protect 1 // jmp
0AC6: LABEL_OFFSET = label @HEX_CODE offset
0AB1: call_scm_func @RELATIVE_ADDRESS inputs 2 source 0x4D4ECF target LABEL_OFFSET

0AC6: LABEL_OFFSET = label @UPDATEWANTEDLEVEL offset
0AB1: call_scm_func @RELATIVE_ADDRESS inputs 2 source LABEL_OFFSET target 0x4D2110 // UpdateWantedLevel
0AC6: LABEL_OFFSET = label @JMP offset
0AB1: call_scm_func @RELATIVE_ADDRESS inputs 2 source LABEL_OFFSET target 0x4D4ED4

while if INDEX < 335
    STRUCT_ELEMENT = INDEX
    STRUCT_ELEMENT *= STRUCT_SIZE
    STRUCT_ELEMENT += STRUCT_BEGIN
    // get pickup location
    PICKUP_LOCATION = STRUCT_ELEMENT
    0A8D: TEMP_FVAR = read_memory PICKUP_LOCATION size 4 virtual_protect 0
    if and
        TEMP_FVAR > 362.0
        TEMP_FVAR < 363.0
    then
        PICKUP_LOCATION += 4
        0A8D: TEMP_FVAR = read_memory PICKUP_LOCATION size 4 virtual_protect 0
        if and
            TEMP_FVAR > -501.0
            TEMP_FVAR < -500.0
        then
            PICKUP_LOCATION += 4
            0A8D: TEMP_FVAR = read_memory PICKUP_LOCATION size 4 virtual_protect 0
            if and
                TEMP_FVAR > 12.0
                TEMP_FVAR < 13.0
            then
                // get pickup model
                PICKUP_MODEL = STRUCT_ELEMENT
                PICKUP_MODEL += 0x22
                0A8D: TEMP_VAR = read_memory PICKUP_MODEL size 2 virtual_protect 0
                if
                    TEMP_VAR == #GRENADE
                then
                    // set pickup model
                    0A8C: write_memory PICKUP_MODEL size 2 val #TEARGAS virtual_protect 0
                    // get pickup entity
                    PICKUP_ENTITY = STRUCT_ELEMENT
                    PICKUP_ENTITY += 0x10
                    0A8D: OBJECT_ENTITY = read_memory PICKUP_ENTITY size 4 virtual_protect 0
                    if
                        not OBJECT_ENTITY == 0
                    then
                        // destroy object
                        0AA5: call 0x4DB310 num_params 1 pop 1 entity OBJECT_ENTITY
                        0A8D: TEMP_VAR = read_memory OBJECT_ENTITY size 4 virtual_protect 0
                        TEMP_VAR += 8
                        0A8D: TEMP_VAR = read_memory TEMP_VAR size 4 virtual_protect 0
                        0AA6: call_method TEMP_VAR struct OBJECT_ENTITY num_params 1 pop 0 1
                    end
                    0A8C: write_memory PICKUP_ENTITY size 4 val 0 virtual_protect 0
                    0249: release_model #TEARGAS
                    jump @IDLE_LOOP
                end
            end
        end
    end
    INDEX += 1
end
0249: release_model #TEARGAS

:IDLE_LOOP
while true
    wait 1000
end

:HEX_CODE
hex
8B 4C 24 34          // mov ecx, [esp+34]
83 B9 D4 03 00 00 00 // cmp dword ptr [ecx+3D4], 0
75 17                // jne end
83 BB D4 03 00 00 06 // cmp dword ptr [ebx+3D4], 6
75 0E                // jne end
8B 89 F4 05 00 00    // mov ecx, [ecx+5F4]
83 01 03             // add dword ptr [ecx], 3
E8                   // call
end
:UPDATEWANTEDLEVEL
hex
00 00 00 00          // UpdateWantedLevel
8B CB                // mov ecx, ebx
6A 00                // push 0
6A 00                // push 0
E9                   // jmp
end
:JMP
hex
00 00 00 00          // 004D4ED4
end

const
SOURCE = 0@
TARGET = 1@
end

var
SOURCE : int
TARGET : int
end

:RELATIVE_ADDRESS
// 0@ - source
// 1@ - target
TARGET -= SOURCE
TARGET -= 4
0A8C: write_memory SOURCE size 4 value TARGET virtual_protect 1
0AB2: ret 0

:HEX_VALUE
hex
00 00 A0 40
end
A A A
INDEX
Creative Commons License
These works are licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
This page was last modified on 2017-08-22 02:51:16 UTC.