Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Address for HaloCE only.
- function adders() -- Some useful addresses.
- network_struct = read_dword(sig_scan("F3ABA1????????BA????????C740??????????E8????????668B0D") + 3)
- if halo_type == "CE" then
- ce = 0x40
- profilepath = read_string(0x5B9610)
- banlistpath = read_string(0x61FB60)
- hardwareinfo = read_string(0x5E6E3C)
- gametype_base = 0x5F5478
- end
- end
- function get_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
- -- 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
- -- 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
- -- 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
- -- 4 = King of the hill
- local moving_hill = read_byte(gametype_base + 0x7C) -- 0 = False | 1 = True
- -- 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
- -- 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) -- 0 = False | 1 = True
- 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)
- local client_machineinfo_struct = network_struct + 0x3B8+ce + to_real_index(PlayerIndex) * client_machineinfo_size
- local crouch_key = read_bit(client_machineinfo_struct + 0x24, 0) -- Confirmed. (0 = False 1 = True)
- local jump_key = read_bit(client_machineinfo_struct + 0x24, 1) -- Confirmed. (0 = False 1 = True)
- --unknownbit(24, 2)(24, 3)
- local flashlight_key = read_bit(client_machineinfo_struct + 0x24, 4) -- Confirmed. (0 = False 1 = True)
- local action_key = read_bit(client_machineinfo_struct + 0x24, 6) -- Confirmed. (0 = False 1 = True) Excludes X (Swap weapon) & R (Reaload weapon)
- local melee_key = read_bit(client_machineinfo_struct + 0x24, 7) -- Confirmed. (0 = False 1 = True)
- --unknownbit(24, 8)(25, 0)(25, 1)
- local reload_key = read_bit(client_machineinfo_struct + 0x25, 2) -- Confirmed. (0 = False 1 = True) Includes E (Action)
- local primary_fire = read_bit(client_machineinfo_struct + 0x25, 3) -- Confirmed. (0 = False 1 = True)
- local secondary_fire = read_bit(client_machineinfo_struct + 0x25, 4) -- Confirmed. (0 = False 1 = True)
- local secondary_fire2 = read_bit(client_machineinfo_struct + 0x25, 5) -- Confirmed. (0 = False 1 = True)
- local action_key2 = read_bit(client_machineinfo_struct + 0x25, 6) -- Confirmed. (0 = False 1 = True) Excludes X (Swap weapon) & R (Reaload weapon)
- --unknownbit(25, 7)(25, 8)
- end
- function driver(PlayerIndex)
- local m_vehicle = toplayermvehicle(PlayerIndex)
- local driver = read_dword(m_vehicle + 0x324) -- 0xFFFFFFFF if there is no driver to the vehicle
- if driver then return driver end
- return nil
- 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 rprintall_exclude(Message, PlayerIndex) -- Sends console text to every player except the one sent to the function.
- for i = 1,16 do
- if player_present(i) then
- if i ~= PlayerIndex then
- rprint(i, "|c" .. Message)
- end
- end
- end
- end
- function tomplayerId(PlayerIndex)
- local m_player = get_player(PlayerIndex)
- if m_player then
- local m_playerId = read_dword(m_player + 0x34)
- return m_playerId
- end
- return nil
- end
- function toplayermweaponid(PlayerIndex) -- Current weapon of the player.
- local m_object = get_dynamic_player(PlayerIndex)
- if m_object ~= 0 then
- local m_weaponId = read_dword(m_object + 0x118)
- return m_weaponId
- end
- return nil
- end
- function toplayermvehicle(PlayerIndex) -- Just showing how to get m_vehicle of a player .
- local m_object = get_dynamic_player(PlayerIndex)
- if m_object then
- local m_vehicleId = read_dword(m_object + 0x11C)
- if m_vehicleId then
- local m_vehicle = get_object_memory(m_vehicleId)
- return m_vehicle
- end
- end
- return nil
- end
- function toplayermvehicleid(PlayerIndex) -- Current vehicle of the player.
- local m_object = get_dynamic_player(PlayerIndex)
- if m_object ~= 0 then
- local m_vehicleId = read_dword(m_object + 0x11C)
- return m_vehicleId
- end
- return nil
- end
- function getplayercoords(PlayerIndex) -- Faster way to get the player coords
- local m_object = get_dynamic_player(PlayerIndex)
- if m_object ~= 0 then
- local x, y, z = read_vector3d(m_object + 0x5c)
- return x, y, z
- end
- return nil
- end
- function getobjetinteractionid(PlayerIndex) -- Gets the ObjectId that is currently being interacted with
- local m_player = get_player(PlayerIndex)
- if m_player ~= 0 then
- local ObjectId = read_dword(m_player + 0x24)
- return ObjectId
- end
- return nil
- end
- function write_widestring(address, str, len)
- local Count = 0
- for i = 1,len do -- Nuls out the old sting.
- write_byte(address + Count, 0)
- Count = Count + 2
- end
- local length = string.len(str)
- local count = 0
- for i = 1,length do -- Sets the new string
- local newbyte = string.byte(string.sub(str,i,i))
- write_byte(address + count, newbyte)
- count = count + 2
- end
- end
- function read_widestring(address, length)
- local count = 0
- local byte_table = {}
- for i = 1,length do -- reads the string.
- byte_table[i] = string.char(read_byte(address + count))
- count = count + 2
- end
- return table.concat(byte_table)
- end
- function tokenizestring(inputstr, sep) -- I forgot how it got this but, to whoever made it, thank you.
- if sep == nil then
- sep = "%s"
- end
- local t={} ; i=1
- for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
- t[i] = str
- i = i + 1
- end
- return t
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement