Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ownership issue for string_pointer and buffer overrun issue for string_array. (#472) #474

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ srv_check = False
base = m_flGroundAccelLinearFracLastTime
offset = 140
type = STRING_ARRAY
length = 16


[property]
Expand Down
2 changes: 2 additions & 0 deletions addons/source-python/data/source-python/entities/orangebox/cstrike/CCSPlayer.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
offset_windows = 5628
offset_linux = 5648
type = STRING_ARRAY
length = 16


[based_attribute]
Expand All @@ -75,6 +76,7 @@
base = m_flFlashDuration
offset = -28
type = STRING_ARRAY
length = 16


[property]
Expand Down
1 change: 1 addition & 0 deletions addons/source-python/data/source-python/weapons/scripts/WeaponInfo.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@
[[class_name]]
type = STRING_ARRAY
offset = 6
length = 80
21 changes: 21 additions & 0 deletions addons/source-python/data/source-python/weapons/scripts/csgo/WeaponInfo.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,27 @@
[[print_name]]
type = STRING_ARRAY
offset = 86
length = 80

[[view_model_name]]
type = STRING_ARRAY
offset = 166
length = 80

[[world_model_name]]
type = STRING_ARRAY
offset = 246
length = 80

[[primary_ammo_type]]
type = STRING_ARRAY
offset = 326
length = 32

[[animation_prefix]]
type = STRING_ARRAY
offset = 438
length = 16

[[bucket]]
type = INT
Expand Down Expand Up @@ -72,14 +77,17 @@
[[secondary_ammo_type]]
type = STRING_ARRAY
offset = 496
length = 32

[[ai_addon_base]]
type = STRING_ARRAY
offset = 528
length = 80

[[ai_addon]]
type = STRING_ARRAY
offset = 608
length = 80

[[primary_ammo_index]]
type = INT
Expand Down Expand Up @@ -180,6 +188,7 @@
[[heat_effect_name]]
type = STRING_ARRAY
offset = 2096
length = 80

[[smoke_color]]
type = Vector
Expand All @@ -188,18 +197,22 @@
[[muzzle_flash_effect_1stperson]]
type = STRING_ARRAY
offset = 2188
length = 80

[[muzzle_flash_effect_3rdperson]]
type = STRING_ARRAY
offset = 2268
length = 80

[[eject_brass_effect]]
type = STRING_ARRAY
offset = 2348
length = 80

[[tracer_effect]]
type = STRING_ARRAY
offset = 2428
length = 80

[[tracer_frequency]]
type = INT
Expand Down Expand Up @@ -368,10 +381,12 @@
[[zoom_in_sound_name]]
type = STRING_ARRAY
offset = 3705
length = 80

[[zoom_out_sound_name]]
type = STRING_ARRAY
offset = 3785
length = 80

[[bot_audible_range]]
type = FLOAT
Expand All @@ -384,26 +399,32 @@
[[wrong_team_message]]
type = STRING_ARRAY
offset = 3873
length = 32

[[player_animation_extension]]
type = STRING_ARRAY
offset = 3905
length = 16

[[shield_view_model_name]]
type = STRING_ARRAY
offset = 3921
length = 64

[[addon_model_name]]
type = STRING_ARRAY
offset = 3985
length = 80

[[addon_location_name]]
type = STRING_ARRAY
offset = 4065
length = 80

[[silencer_model_name]]
type = STRING_ARRAY
offset = 4145
length = 80

[[addon_scale]]
type = FLOAT
Expand Down
21 changes: 21 additions & 0 deletions addons/source-python/data/source-python/weapons/scripts/orangebox/WeaponInfo.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,17 @@
[[print_name]]
type = STRING_ARRAY
offset = 86
length = 80

[[world_model]]
type = STRING_ARRAY
offset = 166
length = 80

[[animation_prefix]]
type = STRING_ARRAY
offset = 326
length = 16

[[slot_index]]
type = INT
Expand Down Expand Up @@ -64,70 +67,87 @@
[[primary_ammo_name]]
type = STRING_ARRAY
offset = 384
length = 32

[[secondary_ammo_name]]
type = STRING_ARRAY
offset = 416
length = 32

[[empty_sound]]
type = STRING_ARRAY
offset = 448
length = 80

[[single_sound]]
type = STRING_ARRAY
offset = 528
length = 80

[[single_npc_sound]]
type = STRING_ARRAY
offset = 608
length = 80

[[double_sound]]
type = STRING_ARRAY
offset = 688
length = 80

[[double_npc_sound]]
type = STRING_ARRAY
offset = 768
length = 80

[[burst_sound]]
type = STRING_ARRAY
offset = 848
length = 80

[[reload_sound]]
type = STRING_ARRAY
offset = 928
length = 80

[[reload_npc_sound]]
type = STRING_ARRAY
offset = 1008
length = 80

[[melee_miss_sound]]
type = STRING_ARRAY
offset = 1088
length = 80

[[melee_hit_sound]]
type = STRING_ARRAY
offset = 1168
length = 80

[[melee_hit_world_sound]]
type = STRING_ARRAY
offset = 1248
length = 80

[[special_sound_1]]
type = STRING_ARRAY
offset = 1328
length = 80

[[special_sound_2]]
type = STRING_ARRAY
offset = 1408
length = 80

[[special_sound_3]]
type = STRING_ARRAY
offset = 1488
length = 80

[[taunt_sound]]
type = STRING_ARRAY
offset = 1568
length = 80

[[primary_ammo_type]]
type = INT
Expand Down Expand Up @@ -196,3 +216,4 @@
[[ai_addon]]
type = STRING_ARRAY
offset = 1704
length = 80
6 changes: 6 additions & 0 deletions addons/source-python/data/source-python/weapons/scripts/orangebox/cstrike/WeaponInfo.ini
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -50,26 +50,32 @@ size = 2320
[[wrong_team_message]]
type = STRING_ARRAY
offset = 1817
length = 32

[[player_animation_extension]]
type = STRING_ARRAY
offset = 1849
length = 16

[[shield_view_model]]
type = STRING_ARRAY
offset = 1865
length = 64

[[addon_model]]
type = STRING_ARRAY
offset = 1929
length = 80

[[dropped_model]]
type = STRING_ARRAY
offset = 2009
length = 80

[[silencer_model]]
type = STRING_ARRAY
offset = 2089
length = 80

[[muzzle_flash_style_index]]
type = INT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ def _get_server_class(self, class_name, datamap):
attribute = method(
Key.as_attribute_type(self, data['type']),
offset,
data.get('doc')
data.get('doc'),
Key.as_int(self, data.get('length', 0)),
)

# Assign the attribute to the instance
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class Key(object):
# Attribute/array keys
TYPE_NAME = 'type'

# Array keys
# Attribute(string length)/Array keys
LENGTH = 'length'

# Pointer keys
Expand Down
Loading