LUA
172
+++ Halo 1.10 Addresses and offsets (and some usage) +++ By xdedeone on 25th February 2019 11:18:36 PM
- api_version = "1.10.0.0"
- ce, client_info_size = 0x40, 0xEC
- function OnScriptLoad()end
- function OnScriptUnload() end
- function game_addresses()
- if halo_type == "PC" then ce, client_info_size = 0x0, 0x60 end
- stats_header = 0x5BD720 -- Confirmed.
- stats_globals = read_dword(sig_scan("33C0BF??????00F3AB881D") + 0x3) -- Confirmed. (Thanks Giraffe)
- ctf_globals = 0x5BDB98 -- Confirmed.
- slayer_globals = 0x5BE0E8 -- Confirmed,
- oddball_globals = 0x5BDE58 -- Confirmed.
- koth_globals = 0x5BDBD0 -- Confirmed.
- race_globals = 0x5BDFA0 -- Confirmed.
- race_locs = 0x5F5078 -- Confirmed.
- map_pointer = 0x5B925C -- Confirmed.
- gametype_base = 0x5F5478 -- Confirmed.
- network_struct = read_dword(sig_scan("F3ABA1????????BA????????C740??????????E8????????668B0D") + 3) -- Confirmed (Thanks Wizard)
- camera_base = 0x620734 -- Confirmed.
- player_globals = 0x6E1458 -- Confirmed.
- player_header_pointer = read_dword(sig_scan("DDD8A1??????008944244835") + 0x3) -- Confirmed (Thanks Giraffe)
- object_header_pointer = read_dword(sig_scan("8B0D????????8B513425FFFF00008D") + 2) -- Confirmed. (Thanks 002)
- collideable_objects_pointer = 0x6C69F4 -- Confirmed.
- map_header_base = 0x6E2C84 -- Confirmed.
- banlist_header = 0x5C5280 -- Confirmed.
- game_globals = nil -- Don't care.
- gameinfo_header = read_dword(sig_scan("A1????????8B480C894D00") + 0x1) -- Confirmed. (Thanks Wizard)
- mapcycle_header = 0x598A8C -- Confirmed
- network_server_globals = 0x61FB44 -- Confirmed.
- hash_table_base = 0x5AFB14 -- Untested.
- -- Strings (Thanks to Giraffe for all the sigs in this section!)
- broadcast_version_address = read_dword(sig_scan("751768??????0068??????00BA") + 0x3) -- Confirmed.
- version_info_address = nil -- Don't care.
- broadcast_game_address = read_dword(sig_scan("CCCCBA??????002BD08A08") + 0x3) -- Confirmed (halor = PC, halom = CE)
- server_ip_argument = read_dword(sig_scan("BA??????008BC72BD78A08880C024084C975F68B442404") + 0x1) -- Confirmed.
- server_port_address = read_dword(sig_scan("668B0D??????000BF2C605") + 0x3) -- Confirmed.
- server_path_address = read_dword(sig_scan("0000BE??????005657C605") + 0x3) -- Confirmed.
- computer_name_address = read_dword(sig_scan("68??????0068??????0068000401006A00") + 0x1) -- Confirmed
- profile_path_address = read_dword(sig_scan("68??????008D54245468") + 0x1) -- Confirmed.
- map_name_address =read_dword(sig_scan("66A3??????00890D??????00C3") + 0x2) -- Confirmed. (Full name)
- hardware_info_address = read_dword(sig_scan("BE??????008BC68B4DF064890D000000005F5E5B8BE55DC36A0C") + 0x1) -- Confirmed.
- map_name_address2 = read_dword(sig_scan("B8??????00E8??????0032C983F813") + 0x1) -- Confirmed. (File name)
- server_password_address = read_dword(sig_scan("F3ABA3??????00A3??????00A2??????00C705") + 0x3) -- Confirmed.
- logfile_path_address = read_dword(sig_scan("740ABB????5C00E8????0300") + 0x3) -- Confirmed. (CE Only)
- banlist_path_address = read_dword(sig_scan("68??????00E8??????0083C41068") + 0x1) -- Confirmed.
- banlist_path_address2 = read_dword(sig_scan("CCCCC605??????0000E8??????0085C0") + 0x4) -- Confirmed.
- rcon_password_address = read_dword(sig_scan("7740BA??????008D9B000000008A01") + 0x3) -- Confirmed.
- -- Patches
- rcon_failed_address = read_dword(sig_scan("B8????????E8??000000A1????????55") + 1) -- Found by 002
- kill_message_address = read_dword(sig_scan("8B42348A8C28D500000084C9") + 3) -- Found by sehe (Write to 0x03EB01B1)
- color_patch1 = read_char(sig_scan("741F8B482085C9750C")) -- Found by 002 (Write to 235 if not 0)
- color_patch2 = read_char(sig_scan("EB1F8B482085C9750C")) -- Found by 002 (Write to 235)
- -- Other
- gravity_global = 0x637BE4 -- Found by 002
- game_over_state_address_sig = sig_scan("C705????????03??????75??C6") -- Found by 002
- end
- function get_ban_data()
- local banlist_size = read_dword(banlist_header)
- local banlist_base = read_dword(banlist_header + 0x4)
- for i = 1,banlist_size do
- ban_index_struct = banlist_base + ((i-1) * 0x44)
- ban_name = read_widestring(ban_index_struct, 12)
- ban_hash = read_widestring(ban_index_struct + 0x1A, 32)
- ban_expired = read_bit(ban_index_struct + 0x3A, 0)
- ban_count = read_word(ban_index_struct + 0x3C)
- ban_indefinitely = read_bit(ban_index_struct + 0x3E, 0)
- ban_end_date = read_dword(ban_index_struct + 0x40)
- end
- end
- function mapcycle_data()
- local mapcycle_pointer = read_dword(mapcycle_header)
- local mapcycle_size = read_dword(mapcycle_header + 0x4) -- Number of options in the mapcycle.
- local mapcycle_allocated = read_dword(mapcycle_header + 0x8) -- Number of active options in the mapcycle.
- local mapcycle_index = read_dword(mapcycle_header + 0xC) -- Current mapcycle index.
- for i = 0,mapcycle_size-1 do
- local mapcycle_index_gametype = read_widestring(mapcycle_pointer + i * 0xE4 + 0xC, 22) -- Gametype name of the mapcycle index.
- end
- local mapcycle_current_map = read_string(read_dword(mapcycle_pointer)) -- Real name of the map.
- local mapcycle_current_gametype = read_string(read_dword(mapcycle_pointer + 0x4)) -- Gametype as typed in init. (Ex: sv_map ratrace SlAyEr)
- local mapcycle_current_gametype2 = read_widestring(mapcycle_pointer + 0xC, 22) -- Full name of gametype. (Ex: Slayer)
- end
- function game_type()
- -- Gametype Name
- local gametype_name = read_widestring(gametype_base, 0x2C) -- Custom name of gametype.
- -- Gametype Options
- local team_play = read_byte(gametype_base + 0X34) -- 0 = False | 1 = True
- local gametype_game = read_byte(gametype_base + 0X30) -- Listed in order below with settings.
- local gametype_timelimit = read_dword(gametype_base + 0x78) -- 1 Second = 30
- local gametype_scorelimit = read_byte(gametype_base + 0x58) -- Number
- if gametype_game == 1 then -- 1 = CTF
- local assualt = read_byte(gametype_base + 0x7C) -- 0 = False | 1 = True
- local flag_must_reset = read_byte(gametype_base + 0x7E) -- 0 = False | 1 = True
- local flag_at_home_to_score = read_byte(gametype_base + 0x7F) -- 0 = False | 1 = True
- local single_flag_reset_time = read_dword(gametype_base + 0x80) -- 1 Second = 30
- elseif gametype_game == 2 then -- 2 = Slayer
- local death_bonus = read_byte(gametype_base + 0x7C) -- 0 = False | 1 = True
- local kill_penalty = read_byte(gametype_base + 0x7D) -- 0 = False | 1 = True
- elseif gametype_game == 3 then -- 3 = Oddball
- local oddball_type = read_byte(gametype_base + 0x8C) -- 0 = Normal | 1 = Reverse Tag | 2 = Juggernaut
- local speed_with_ball = read_byte(gametype_base + 0x80) -- 0 = Slow | 1 = Normal | 2 = Fast
- local trait_with_ball = read_byte(gametype_base + 0x84) -- 0 = None | 1 = Invisable | 2 = Extra Damage | 3 = Damage Resistant
- local trait_without_ball = read_byte(gametype_base + 0x88) -- Same as above.
- local oddball_spawn_count = read_byte(gametype_base + 0x90) -- Unknown
- elseif gametype_game == 4 then -- 4 = King of the hill
- local moving_hill = read_byte(gametype_base + 0x7C) -- 0 = False | 1 = True
- elseif gametype_game == 5 then -- 5 = Race
- local race_type = read_byte(gametype_base + 0x7C) -- 0 = Normal | 1 = Any Order | 2 = Rally
- local team_scoring = read_byte(gametype_base + 0x80) -- 0 = Min | 1 = Max | 2 = Sum
- end
- -- Player Options
- local number_of_lives = read_byte(gametype_base + 0x50) -- 0 = Unlimited
- local max_health = read_float(gametype_base + 0x54) -- Untested
- local sheilds = read_bit(gametype_base + 0x38, 3) -- 1 = False | 0 = True ?? WHY THE FUCK?
- local respawn_time = read_byte(gametype_base + 0x48) -- 1 Second = 30
- local respawn_time_growth = read_byte(gametype_base + 0x44) -- 1 Second = 30
- local odd_man_out = read_byte(gametype_base + 0x40) -- 0 = False | 1 = True
- local invisable_players = read_bit(gametype_base + 0x38, 4) -- 0 = False | 1 = True
- local suicide_penalty = read_byte(gametype_base + 0x4C) -- 1 Second = 30
- -- Item Options
- local infite_grenades = read_bit(gametype_base + 0x38, 2) -- 0 = False | 1 = True
- local weapon_set = read_byte(gametype_base + 0x5C) -- 0 = Normal | 1 = Pistols | 2 = Rifles | 3 = Plasma | 4 = Snipers | 5 = No Snipers | 6 = Rockets | 7 = Shotguns | 8 = Short Range | 9 = Human | 10 = Covenent | 11 = Classic | 12 = Heavy
- local starting_equipment = read_bit(gametype_base + 0x38, 5) -- 0 = Custom | 1 = Generic
- -- Vehicle Options
- local red_vehicles = read_dword(gametype_base + 0x60) -- Unknown
- local blue_vehicles = read_dword(gametype_base + 0x64) -- Unknown
- local Vehicle_respawn_time = read_dword(gametype_base + 0x68) -- 1 Second = 30
- -- Indicator Options
- local gametype_indicator = read_byte(gametype_base + 0x3C) -- 0 = Motion Tracker | 1 = Nav Points | 2 = None
- local only_friendlys_on_radar = read_bit(gametype_base + 0x38, 6) -- 0 = False | 1 = True
- local all_players_on_radar = read_bit(gametype_base + 0x38, 0) -- 0 = False | 1 = True
- local friendly_indicators = read_bit(gametype_base + 0x38, 1) -- 0 = False | 1 = True
- -- Team Options
- local friendly_fire = read_byte(gametype_base + 0x6C) -- 0 = False | 1 = True
- local friendly_fire_penalty = read_byte(gametype_base + 0x70) -- 1 Second = 30
- local auto_balance = read_byte(gametype_base + 0x74) -- 0 = False | 1 = True
- end
- function NetworkStruct(PlayerIndex) -- Stuff regarding the player Wizard had wrong.
- local client_machineinfo_struct = network_struct + 0x3B8 + ce + to_real_index(PlayerIndex) * client_info_size
- local crouch_key = read_bit(client_machineinfo_struct + 0x24, 0) -- 0 = False | 1 = True
- local jump_key = read_bit(client_machineinfo_struct + 0x24, 1) -- 0 = False | 1 = True
- --unknownbit(24, 2)(24, 3)
- local flashlight_key = read_bit(client_machineinfo_struct + 0x24, 4) -- 0 = False | 1 = True
- local action_key = read_bit(client_machineinfo_struct + 0x24, 6) -- 0 = False | 1 = True | Action (E) & Swap Weapon (X - Lags)
- local melee_key = read_bit(client_machineinfo_struct + 0x24, 7) -- 0 = False | 1 = True
- --unknownbit(24, 8)(25, 0)(25, 1)
- local reload_key = read_bit(client_machineinfo_struct + 0x25, 2) -- 0 = False | 1 = True | Reload (R)
- local primary_fire = read_bit(client_machineinfo_struct + 0x25, 3) -- 0 = False | 1 = True
- local secondary_fire = read_bit(client_machineinfo_struct + 0x25, 4) -- 0 = False | 1 = True
- local secondary_fire2 = read_bit(client_machineinfo_struct + 0x25, 5) -- 0 = False | 1 = True
- local swap_weapon = read_bit(client_machineinfo_struct + 0x25, 6) -- 0 = False | 1 = True | Swap Weapon (X)
- --unknownbit(25, 7)(25, 8)
- local nade_type = read_bit(client_machineinfo_struct + 0x4A, 0) -- 0 = Frag | 1 = Plasma
- local zoom_level = read_char(client_machineinfo_struct + 0x4C) -- -1 = None | 0 = 2x | 1 = 8x
- end
- -- Custom function(s)
- function player() -- Player Only
- local m_player = get_player(PlayerIndex)
- -- Stats
- local stats_base = stats_globals + to_real_index(PlayerIndex) * 0x30
- local player_ingame = read_byte(stats_base) -- 1 = true 0 = false
- local player_dword_id = read_dword(stats_base + 0x4)
- local player_kills = read_word(stats_base + 0x8)
- local player_assists = read_word(stats_base + 0x10)
- local player_betrays = read_word(stats_base + 0x18)
- local player_deaths = read_word(stats_base + 0x1A)
- local player_suicides = read_word(stats_base + 0x1C)
- -- Gametype specific
- -- (CTF = Flag steals) (KOTH = Hill time) (Race = Time)
- local player_gametype_stats = read_word(stats_base + 0x1E)
- -- (CTF = Flag returns) (ODDBALL = Tragets killed vs jug), (RACE = laps)
- local player_gametype_stats2 = read_word(stats_base + 0x20)
- -- (CTF = Flag scores) (ODDBALL = Kills as jug) (RACE = Best lap)
- local player_gametype_stats3 = read_word(stats_base + 0x22)
- local player_in_hill = read_byte(koth_globals + to_real_index(PlayerIndex) + 0x80)
- local oddball_base = oddball_globals + to_real_index(PlayerIndex) * 4
- local player_oddball_score = read_dword(oddball_base + 0x44)
- local player_holding_ball = read_dword(oddball_base + 0xC4)
- local player_time_with_ball = read_dword(oddball_base + 0x104)
- local player_current_checkpoint = read_dword(race_globals + to_real_index(PlayerIndex) * 4 + 0x44)
- local player_slayer_score = read_dword(slayer_globals + to_real_index(PlayerIndex) * 4 + 0x40)
- -- Camera
- local camera_struct = camera_base + to_real_index(PlayerIndex) * 0x30
- local xy = read_float(camera_struct)
- local z = read_float(camera_struct + 0x4)
- local x_aim = read_float(camera_struct + 0x1C)
- local y_aim = read_float(camera_struct + 0x20)
- local z_aim = read_float(camera_struct + 0x24)
- -- Player
- local player_menu = read_word((m_player - 0xD) + 1) -- 0 = In server 1 = At menu (ui.map)
- local player_word_id = read_word(m_player)
- local player_host = read_word(m_player + 0x2) -- Setting this to 1 will stop the server from sending location updates to them.
- local player_name = read_widestring(m_player + 0x4, 12) -- Name captured with 'pl' command.
- local player_team = read_byte(m_player + 0x20)
- -- Interactions
- local player_interaction_object_id = read_dword(m_player + 0x24)
- local player_interaction_object_type = read_word(m_player + 0x28) -- 7 = weapon, 8 = Vehicle
- local player_interaction_vehicle_seat = read_word(m_player + 0x2A)
- -- Respawn times
- local player_respawn_time = read_dword(m_player + 0x2C)
- local player_respawn_time_growth = read_dword(m_player + 0x30)
- -- Objects
- local player_object_id = read_dword(m_player + 0x34)
- local player_last_object_id = read_dword(m_player + 0x38)
- local player_weapon_pickup = read_dword(m_player + 0x3E) -- 1 = true, 0 = false
- local player_tickcount_last_shot = read_dword(m_player + 0x44) -- Last gametime tick the player shot.
- local player_name2 = read_widestring(m_player + 0x48, 12)
- local player_color = read_word(m_player + 0x60)
- local player_machine_index = read_byte(m_player + 64) -- Same as to_player_index
- local player_spawned_team = read_byte(m_player + 0x66) -- Team the player spawned on.
- local player_index = read_byte(m_player + 0x67) -- Same as to_real_index
- -- Timed powerups.
- -- For times 1 second = 30 ticks. (This means divide these values by 30 to get the time in seconds.)
- local camo_timer = read_word(m_player + 0x68) -- Time until player is no longer camouflaged.
- local full_spec_timer = read_word(m_player + 0x6A) -- Time until player no longer has full spectrum vision.
- local player_speed_multiplier = read_float(m_player + 0x6C) -- This is what sapp uses for setting player speeds.
- local player_objective_mode = read_dword(m_player + 0x74)
- local player_target_player = read_dword(m_player + 0x7C)
- local player_target_time = read_dword(m_player + 0x80)
- local player_slayer_target = read_dword(m_player + 0x88) -- Enemy player who gets the objective marker above their head.
- local player_oddman_out = read_bit(m_player + 0x8C, 0)
- local player_kill_steak = read_word(m_player + 0x96) -- Killing spree, Running riot, ect.
- local player_kill_multiplier = read_word(m_player + 0x98) -- Double kill, Triple Kill, ect.
- local player_tickcount_last_kill = read_word(m_player + 0x9A) -- Last gametime tick the player got a kill.
- -- Stats 2
- local player_kills2 = read_word(m_player + 0x9C)
- local player_assists2 = read_word(m_player + 0xA4)
- local player_betrays2 = read_word(m_player + 0xAC) -- Betrays + Suicides
- local player_deaths2 = read_word(m_player + 0xAE)
- local player_suicides2 = read_word(m_player + 0xB0)
- local player_teamkills = read_word(m_player + 0xC0)
- -- Gametype specific 2
- -- (CTF = Flag steals) (KOTH = Hill time) (Race = Time)
- local player_gametype_stats_2 = read_word(m_player + 0xC4)
- -- (CTF = Flag returns) (ODDBALL = Tragets killed vs jug), (RACE = laps)
- local player_gametype_stats2_2 = read_word(m_player + 0xC6)
- -- (CTF = Flag scores) (ODDBALL = Kills as jug) (RACE = Best lap)
- local player_gametype_stats3_2 = read_word(m_player + 0xC8)
- local player_telefrag_timer = read_dword(m_player + 0xCC) -- Time spent blocking teleporter.
- local player_quit_time = read_dword(m_player + 0xD0)
- local player_ping = read_dword(m_player + 0xDC)
- local player_teamkill_count = read_dword(m_player + 0xE0)
- local player_teamkill_timer = read_dword(m_player + 0xE4) -- Time since last betray.
- local player_local_update_count = read_word(m_player + 0xE8) -- Tick (0-32) since the players local position was updated.
- local x, y, z = read_vector3d(m_player + 0xF8) -- Player's biped coords. (DS only)
- -- Baseline updates (update every 3-6 seconds by default.)
- -- Tied to the following server console commands.
- -- DS Side.
- local player_melee_key = read_bit(m_player + 0x11C, 0)
- local player_action_key = read_bit(m_player + 0x11C, 1)
- local player_flashlight_key = read_bit(m_player + 0x11C, 3)
- local player_reload_key = read_bit(m_player + 0x11D, 5)
- local player_xy_aim = read_float(m_player + 0x138)
- local player_z_aim = read_float(m_player + 0x13C)
- local player_forward = read_float(m_player + 0x140)
- local player_left = read_float(m_player + 0x144)
- local player_rate_of_fire = read_float(m_player + 0x148)
- local player_weapon_slot = read_byte(m_player + 0x14C)
- local player_nade_type = read_byte(m_player + 0x14E)
- local player_x_aim2 = read_float(m_player + 0x154)
- local player_y_aim2 = read_float(m_player + 0x158)
- local player_z_aim2 = read_float(m_player + 0x15C)
- local x, y, z = read_vector3d(m_player + 0x170) -- Player coords.
- -- Client side addresses (These are mapped better probably)
- local player_crouch_hold = read_bit(m_player + 0xF4, 0) -- Current crouch state.
- local player_flashlight = read_bit(m_player + 0xF4, 4) -- Current flashlight press.
- local player_action_press = read_bit(m_player + 0xF4, 6) -- Current action press.
- local player_melee_press = read_bit(m_player + 0xF4, 7) -- Current melee press.
- local player_reload_press = read_bit(m_player + 0xF5, 2) -- Current reload press.
- local player_attack_hold = read_bit(m_player + 0xF5, 3) -- Current attack hold.
- local player_secondary_attack_hold = read_bit(m_player + 0xF5, 4) -- Current secondary attack hold.
- local player_secondary_attack_hold_2 = read_bit(m_player + 0xF5, 5) -- Current secondary attack hold.
- local player_action_swap_hold = read_bit(m_player + 0xF5, 5) -- Current action/swap hold.
- local player_forward = read_float(m_player + 0x100) -- Current baseline forward/back speed.
- local player_left = read_float(m_player + 0x104) -- Current baseline left/right speed.
- local player_weapon_slot = read_byte(m_player + 0x10C) -- Current player weapon slot.
- local x_aim, y_aim, z_aim = read_vector3d(m_player + 0x114) -- Current baseline vector aim.
- local player_aim_yaw = read_float(m_player + 0x140) -- Current baseline player yaw.
- local player_aim_pitch = read_float(m_player + 0x144) -- Current baseline player pitch.
- local player_forward_2 = read_float(m_player + 0x148) -- Current baseline forward/back speed.
- local player_left_2 = read_float(m_player + 0x14C) -- Current baseline left/right speed.
- local player_rof = read_float(m_player + 0x150) -- Current baseline rate of fire.
- local player_weapon_slot = read_byte(m_player + 0x154) -- Current baseline weapon slot.
- local player_nade_slot = read_byte(m_player + 0x156) -- Current baseline nade type.
- local x, y, z = read_vector3d(m_player + 0x164) -- Current baseline location.
- end
- function player_object() -- Object (Player, Vehicle, Projectile, Ect)
- local m_object = get_dynamic_player(PlayerIndex)
- local m_objectId = read_dword(get_player(PlayerIndex) + 0x34)
- local object_tag_id = read_dword(m_object)
- local object_forces_baseline_update = read_bit(m_object + 0x8, 8)
- local object_existance_time = read_dword(m_object + 0xC)
- local object_has_no_collision = read_bit(m_object + 0x10, 0)
- local object_in_contact_with_bsp = read_bit(m_object + 0x10, 1)
- local object_ignores_gravity = read_bit(m_object + 0x10, 2)
- local object_in_water = read_bit(m_object + 0x10, 3)
- local object_is_stationary = read_bit(m_object + 0x10, 5)
- local object_has_no_collision2 = read_bit(m_object + 0x10, 7)
- local object_garbage_bit = read_bit(m_object + 0x12, 0)
- local object_does_not_cast_shadow = read_bit(m_object + 0x12, 2)
- local object_outside_map = read_bit(m_object + 0x12, 5)
- local Object_has_no_collision3 = read_bit(m_object + 0x13, 0) -- Does not apply to vehicles
- local x3, y3, z3 = read_vector3d(m_object + 0x5c)
- local object_x_velocity = read_float(m_object + 0x68)
- local object_y_velocity = read_float(m_object + 0x6C)
- local object_z_velocity = read_float(m_object + 0x70)
- local object_pitch = read_float(m_object + 0x74) -- Vector
- local object_yaw = read_float(m_object + 0x78) -- Vector
- local object_roll = read_float(m_object + 0x7C) -- Vector
- local object_x_scale = read_float(m_object + 0x80)
- local object_y_scale = read_float(m_object + 0x84)
- local object_z_scale = read_float(m_object + 0x88)
- local object_pitch_velocity = read_float(m_object + 0x8C)
- local object_yaw_velocity = read_float(m_object + 0x90)
- local object_roll_velocity = read_float(m_object + 0x94)
- local object_location_id = read_dword(m_object + 0x98) -- There's a lot of these.
- local x4, y4, z4 = read_vector3d(m_object + 0xA0) -- Objects center (Player pelvis.)
- local object_radius = read_float(m_object + 0xAC)
- local object_scale = read_float(m_object + 0xB0) -- Hitbox scale (from objects center.)
- -- (0 = Biped) (1 = Vehicle) (2 = Weapon) (3 = Equipment) (4 = Garbage)
- -- (5 = Projectile) (6 = Scenery) (7 = Machine) (8 = Control)
- -- (9 = Light Fixture) (10 = Placeholder) (11 = Sound Scenery)
- local object_type = read_word(m_object + 0xB4)
- local object_gametype_objective = read_word(m_object + 0xB8)
- local object_player_id = read_dword(m_object + 0xC0)
- local object_owner_id = read_dword(m_object + 0xC4) -- Parent/Owner objectId
- local object_max_health = read_float(m_object + 0xD8)
- local object_max_shields = read_float(m_object + 0xDC)
- local object_health = read_float(m_object + 0xE0)
- local object_shields = read_float(m_object + 0xE4) -- (0 to 3) (Normal = 1) (Full overshield = 3)
- local object_current_shield_damage = read_float(m_object + 0xE8)
- local object_current_damage = read_float(m_object + 0xEC)
- local object_last_shield_damage_ammount = read_float(m_object + 0xF4)
- local object_last_damage_ammount = read_float(m_object + 0xF8)
- local object_last_shield_damage_time = read_float(m_object + 0xFC)
- local object_last_damage_time = read_float(m_object + 0x100)
- local object_shields_recharge_time = read_float(m_object + 0x104)
- local object_cannot_take_damage = read_bit(m_object + 0x106, 11)
- local object_shields_recharging = read_bit(m_object + 0x106, 12)
- local object_weapon_object_id = read_dword(m_object + 0x118) -- WeaponId
- local object_vehicle_object_id = read_dword(m_object + 0x11C) -- VehicleId
- local object_forces_shield_update = read_bit(m_object + 0x122, 0)
- local object_shields_hit = read_float(m_object + 0x124)
- local object_flashlight_scale = read_float(m_object + 0x12C)
- local unit_is_invisible = read_bit(m_object + 0x204, 4) -- Confirmed. (True if currently invisible, False if not)
- local unit_flashlight = read_bit(m_object + 0x206, 3)
- local unit_wont_drop_items = read_bit(m_object + 0x206, 4)
- local unit_is_suspended = read_bit(m_object + 0x207, 0)
- -- There is more to come.
- local weapon_slot_2 = read_byte(m_object + 0x2A1) -- Current player weapon slot.
- local weapon_slot_3 = read_byte(m_object + 0x2F2) -- Current player weapon slot. (Read only)
- end
- function player_vehicle() -- Vehicle only
- local m_object = get_dynamic_player(PlayerIndex)
- local m_vehicle = get_object_memory(read_dword(m_object + 0x11C))
- -- I think theses are the three levitation points?
- local ghost_x_coord = read_float(m_vehicle + 0x5E8)
- local ghost_y_coord = read_float(m_vehicle + 0x5EC)
- local ghost_z_coord = read_float(m_vehicle + 0x5F0)
- local ghost_x_coord2 = read_float(m_vehicle + 0x684)
- local ghost_y_coord2 = read_float(m_vehicle + 0x688)
- local ghost_z_coord2 = read_float(m_vehicle + 0x68C)
- local ghost_x_coord3 = read_float(m_vehicle + 0x6B8)
- local ghost_y_coord3 = read_float(m_vehicle + 0x6BC)
- local ghost_z_coord3 = read_float(m_vehicle + 0x6C0)
- end
- function get_object_info()
- local object_table = read_dword(object_header_pointer)
- local object_count = read_word(object_table + 0x2E)
- local first_object = read_dword(object_table + 0x34)
- for i = 0,object_count-1 do
- local object = read_dword(first_object + i * 0xC + 0x8)
- if object ~= 0 and object ~= 0xFFFFFFFF then
- local object_type = read_word(object + 0xB4) -- (0 = Biped) (1 = Vehicle) (2 = Weapon) (3 = Equipment) (4 = Garbage) (5 = Projectile) (6 = Scenery) (7 = Machine) (8 = Control) (9 = Light Fixture) (10 = Placeholder) (11 = Sound Scenery)
- if object_type = 3 then
- local equip_existane_time = read_word(object + 0x32c) -- (1 sec = 30 ticks) counting tied to objects incremental rate.
- end
- end
- end
- end
- function get_random_player(New_Team, Kill)
- local players, count = {}, 1
- for i = 1,16 do
- if player_present(i) then
- if New_Team then
- if get_team(i) ~= New_Team then
- players[count], count = i, count + 1
- end
- else
- players[count], count = i, count + 1
- end end end
- if #players > 1 then
- local PlayerIndex = players(rand(1, #players))
- set_team(PlayerIndex, New_Team, Kill)
- end
- end
- function get_tag(class, path) -- By 002
- local tagarray = read_dword(0x40440000)
- for i = 0,read_word(0x4044000C)-1 do
- local tag = tagarray + i * 0x20
- local tagclass = string.reverse(string.sub(read_string(tag),1,4))
- if tagclass == class then
- if(read_string(read_dword(tag + 0x10)) == path) then return read_dword(tag + 0xC) end
- end
- end
- return nil
- end
- function get_team(PlayerIndex)
- local m_player = get_player(PlayerIndex)
- if m_player then
- return read_byte(m_player + 0x20)
- end
- return nil
- end
- function get_name(PlayerIndex)
- if player_present then
- return get_var(PlayerIndex, "$name")
- end
- return nil
- end
- function set_speed(PlayerIndex, Speed)
- local m_player = get_player(PlayerIndex)
- if m_player then
- write_float(m_player + 0x6c, Speed)
- end
- end
- function set_spawn_time(PlayerIndex, Time)
- local m_player = get_player(PlayerIndex)
- if m_player then
- write_dword(m_player + 0x2C, Time + 30)
- end
- end
- function set_color(PlayerIndex, Color)
- local m_player = get_player(PlayerIndex)
- if m_player then
- write_word(m_player + 0x60, Color)
- end
- end
- function set_team(PlayerIndex, New_Team, Kill)
- local m_player = get_player(PlayerIndex)
- if m_player then
- write_byte(m_player + 0x20, New_Team)
- if Kill then kill(PlayerIndex) end
- end
- end
- function set_navs(PlayerIndex)
- local Target = nil
- for i = 1,16 do
- local m_player = get_player(i)
- if m_player then
- if PlayerIndex == nil then
- Target = to_real_index(i)
- else
- Target = to_real_index(PlayerIndex)
- end
- write_word(m_player + 0x88, Target)
- end
- end
- end
- function read_widestring(address, length)
- local count = 0
- local byte_table = {}
- for i = 1,length do -- Reads the string.
- if read_byte(address + count) == 00 then count = count + 1 end
- byte_table[i] = string.char(read_byte(address + count))
- count = count + 1
- end
- return table.concat(byte_table)
- end
Recent Pastes