Skip to content

Commit a3ae9ac

Browse files
Redo patches to be more robust (#117)
1 parent 8ae64fa commit a3ae9ac

6 files changed

Lines changed: 580 additions & 432 deletions

File tree

gamedata/randomizer.txt

Lines changed: 113 additions & 164 deletions
Original file line numberDiff line numberDiff line change
@@ -4,51 +4,6 @@
44
{
55
"Keys"
66
{
7-
"PatchReplace_01" //Demoman class check for eyelander health
8-
{
9-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
10-
"windows" "\x90\x90" // Replace 'jnz short' to NOP (skip)
11-
}
12-
"PatchReplace_02" //Demoman class check for eyelander speed and charging
13-
{
14-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
15-
"windows" "\x90\x90" // Replace 'jnz short' to NOP (skip)
16-
}
17-
"PatchReplace_03" //Medic class check for healing charging
18-
{
19-
"linux" "\x90\x90\x90\x90\x90\x90" // Replace 'jnz' to NOP (skip)
20-
"windows" "\x90\x90\x90\x90\x90\x90" // Replace 'jz' (if '==' jump) to NOP (skip)
21-
}
22-
"PatchReplace_04" //Medic class check for Overdose speed
23-
{
24-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
25-
"windows" "\x90\x90" // Replace 'jnz short' to NOP (skip)
26-
}
27-
"PatchReplace_05" //Heavy class check for steak speed
28-
{
29-
"linux" "\x90\x90\x90\x90\x90\x90" // Replace 'jz' (if '==' jump) to to NOP (skip)
30-
"windows" "\xEB" // Replace 'jnz short' to 'jmp short' (always jump)
31-
}
32-
"PatchReplace_06" //Scout class check for Baby Face Blaster and Crit-A-Cola speed
33-
{
34-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
35-
"windows" "\x90\x90" // Replace 'jnz short' to NOP (skip)
36-
}
37-
"PatchReplace_07" //Spy class check for Your Eternal Reward silent kill
38-
{
39-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
40-
"windows" "\x90\x90" // Replace 'jnz short' to NOP (skip)
41-
}
42-
"PatchReplace_08" //Demoman class check for kill refilling meter
43-
{
44-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
45-
"windows" "\x90\x90\x90\x90\x90\x90" // Replace 'jnz' to NOP (skip)
46-
}
47-
"PatchReplace_09" //Sniper class check for Hitman's Heatmaker rage on kill
48-
{
49-
"linux" "\x90\xE9" // Replace 'jz' (if '==' jump) to 'jmp' (always jump)
50-
"windows" "\x90\x90" // Replace 'jnz short' to NOP (skip)
51-
}
527
"PatchReplace_IsPlayerClass" //Given class check, this patch makes it always return true
538
{
549
// \xB8\x01\x00\x00\x00 mov eax, 1
@@ -59,77 +14,24 @@
5914
// \x90 nop
6015
"windows" "\xB8\x01\x00\x00\x00\x90"
6116
}
62-
}
63-
"Addresses"
64-
{
65-
"PatchSig_01"
66-
{
67-
"signature" "PatchSig_01"
68-
"linux"
69-
{
70-
"offset" "95"
71-
}
72-
"windows"
73-
{
74-
"offset" "7" //Start is pushed back by 7 to make good unique sig
75-
}
76-
}
77-
"PatchSig_02"
78-
{
79-
"signature" "PatchSig_02"
80-
}
81-
"PatchSig_03"
82-
{
83-
"signature" "PatchSig_03"
84-
"linux"
85-
{
86-
"offset" "3" //Start is pushed back by 3 to make good unique sig
87-
}
88-
}
89-
"PatchSig_04"
90-
{
91-
"signature" "PatchSig_04"
92-
}
93-
"PatchSig_05"
94-
{
95-
"signature" "PatchSig_05"
96-
}
97-
"PatchSig_06"
98-
{
99-
"signature" "PatchSig_06"
100-
"linux"
101-
{
102-
"offset" "3" //Start is pushed back by 3 to make good unique sig
103-
}
104-
}
105-
"PatchSig_07"
17+
18+
"PatchSearch_Speed01"
10619
{
107-
"signature" "PatchSig_07"
108-
"linux"
109-
{
110-
"offset" "649"
111-
}
112-
"windows"
113-
{
114-
"offset" "4" //Start is pushed back by 4 to make good unique sig
115-
}
116-
}
117-
"PatchSig_08"
118-
{
119-
"signature" "PatchSig_08"
120-
"windows"
121-
{
122-
"offset" "4" //Start is pushed back by 4 to make good unique sig
123-
}
20+
"linux" "\x83\xFF\x2A\x0F"
21+
"windows" "\x83\x7D\xEC\x2A"
12422
}
125-
"PatchSig_09"
23+
24+
"PatchSearch_Speed02"
12625
{
127-
"signature" "PatchSig_09"
128-
"linux"
129-
{
130-
"offset" "1890"
131-
}
26+
"windows" "\x83\xF8\x2A"
13227
}
28+
29+
"PatchCount_Speed" "6" // How many patches we should expect from searches, errors out if found different amount of it
30+
"PatchBits_Speed" "1800" // How many bits to read from start to function to collect address
31+
"PatchWildcard_Speed" "\x01\x04\x05\x06" // List of possible values from \x2A wildcard to consider it valid and replace it
32+
}
33+
"Addresses"
34+
{
13335
"PatchSig_IsPlayerClass"
13436
{
13537
"signature" "PatchSig_IsPlayerClass"
@@ -145,51 +47,6 @@
14547
}
14648
"Signatures"
14749
{
148-
"PatchSig_01" //CTFPlayer::GetMaxHealthForBuffing
149-
{
150-
"linux" "@_ZN9CTFPlayer22GetMaxHealthForBuffingEv"
151-
"windows" "\x83\xBF\x2A\x2A\x2A\x2A\x04\x75\x2A\x6A\x00"
152-
}
153-
"PatchSig_02" //CTFPlayer::TeamFortress_CalculateMaxSpeed
154-
{
155-
"linux" "\x0F\x84\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x80\xB8\x2A\x0C\x00\x00\x00\x75\x2A\x80\xBB\x2A\x1E\x00\x00\x00"
156-
"windows" "\x75\x2A\x6A\x00\x68\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\x6A\x00\x6A\x40\x8B\xCE"
157-
}
158-
"PatchSig_03" //CTFPlayer::TeamFortress_CalculateMaxSpeed
159-
{
160-
"linux" "\x83\xFF\x05\x0F\x85\x2A\x2A\x2A\x2A"
161-
"windows" "\x0F\x85\x2A\x2A\x2A\x2A\x85\xDB\x0F\x84\x2A\x2A\x2A\x2A\x6A\x00"
162-
}
163-
"PatchSig_04" //CTFPlayer::TeamFortress_CalculateMaxSpeed
164-
{
165-
"linux" "\x0F\x84\x2A\x2A\x2A\x2A\x83\xEC\x0C\x6A\x01\x6A\x00\xFF\x75\xD8"
166-
"windows" "\x75\x2A\x6A\x00\x68\x2A\x2A\x2A\x2A\x68\x2A\x2A\x2A\x2A\x6A\x00\x6A\x32"
167-
}
168-
"PatchSig_05" //CTFPlayer::TeamFortress_CalculateMaxSpeed
169-
{
170-
"linux" "\x0F\x84\x2A\x2A\x2A\x2A\x83\xFF\x01\x0F\x84\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x85\xC0"
171-
"windows" "\x75\x2A\xF3\x0F\x10\x45\xE8\x8B\xCF"
172-
}
173-
"PatchSig_06" //CTFPlayer::TeamFortress_CalculateMaxSpeed
174-
{
175-
"linux" "\x83\xFF\x01\x0F\x84\x2A\x2A\x2A\x2A\xA1\x2A\x2A\x2A\x2A\x85\xC0"
176-
"windows" "\x75\x2A\x6A\x55\x8B\xCE\xE8\x2A\x2A\x2A\x2A\x85\xC0"
177-
}
178-
"PatchSig_07" //CTFPlayer::Event_KilledOther
179-
{
180-
"linux" "@_ZN9CTFPlayer17Event_KilledOtherEP11CBaseEntityRK15CTakeDamageInfo"
181-
"windows" "\x83\x78\x04\x08\x75\x2A\x56"
182-
}
183-
"PatchSig_08" //CTFPlayer::Event_KilledOther
184-
{
185-
"linux" "\x0F\x84\x2A\x2A\x2A\x2A\x83\xF8\x02\x0F\x84\x2A\x2A\x2A\x2A\x8B\x83\x2A\x2A\x2A\x2A"
186-
"windows" "\x83\x78\x04\x04\x0F\x85\x2A\x2A\x2A\x2A"
187-
}
188-
"PatchSig_09" //CTFPlayer::Event_KilledOther
189-
{
190-
"linux" "@_ZN9CTFPlayer17Event_KilledOtherEP11CBaseEntityRK15CTakeDamageInfo"
191-
"windows" "\x75\x2A\xD9\xEE\x6A\x01\x6A\x00\x53"
192-
}
19350
"PatchSig_IsPlayerClass" //CTFPlayer::IsPlayerClass
19451
{
19552
"linux" "@_ZNK9CTFPlayer13IsPlayerClassEi"
@@ -388,6 +245,11 @@
388245
"linux" "69"
389246
"windows" "68"
390247
}
248+
"CBaseEntity::Event_KilledOther"
249+
{
250+
"linux" "70"
251+
"windows" "69"
252+
}
391253
"CBaseEntity::GetMaxHealth"
392254
{
393255
"linux" "123"
@@ -418,6 +280,16 @@
418280
"linux" "486"
419281
"windows" "479"
420282
}
283+
"CTFSword::GetSwordSpeedMod"
284+
{
285+
"linux" "492"
286+
"windows" "484"
287+
}
288+
"CTFSword::GetSwordHealthMod"
289+
{
290+
"linux" "493"
291+
"windows" "485"
292+
}
421293
"CBaseObject::Killed"
422294
{
423295
"linux" "356"
@@ -433,6 +305,11 @@
433305
"linux" "337"
434306
"windows" "336"
435307
}
308+
"CBasePlayer::ClientCommand"
309+
{
310+
"linux" "380"
311+
"windows" "379"
312+
}
436313
"CBasePlayer::EquipWearable"
437314
{
438315
"linux" "439"
@@ -448,10 +325,10 @@
448325
"linux" "277"
449326
"windows" "276"
450327
}
451-
"CTFPlayer::ClientCommand"
328+
"CBaseMultiplayerPlayer::SpeakConceptIfAllowed"
452329
{
453-
"linux" "380"
454-
"windows" "379"
330+
"linux" "473"
331+
"windows" "472"
455332
}
456333
"CTFPlayer::GiveNamedItem"
457334
{
@@ -468,6 +345,16 @@
468345
"linux" "16"
469346
"windows" "15"
470347
}
348+
"CTakeDamageInfo::m_bitsDamageType"
349+
{
350+
"linux" "60"
351+
"windows" "60"
352+
}
353+
"CTakeDamageInfo::m_iDamageCustom"
354+
{
355+
"linux" "64"
356+
"windows" "64"
357+
}
471358
}
472359
"Functions"
473360
{
@@ -821,6 +708,24 @@
821708
}
822709
}
823710
}
711+
"CBaseEntity::Event_KilledOther"
712+
{
713+
"offset" "CBaseEntity::Event_KilledOther"
714+
"hooktype" "entity"
715+
"return" "void"
716+
"this" "entity"
717+
"arguments"
718+
{
719+
"pVictim"
720+
{
721+
"type" "cbaseentity"
722+
}
723+
"info"
724+
{
725+
"type" "objectptr"
726+
}
727+
}
728+
}
824729
"CEconEntity::TranslateViewmodelHandActivityInternal"
825730
{
826731
"offset" "CEconEntity::TranslateViewmodelHandActivityInternal"
@@ -870,6 +775,20 @@
870775
}
871776
}
872777
}
778+
"CTFSword::GetSwordSpeedMod"
779+
{
780+
"offset" "CTFSword::GetSwordSpeedMod"
781+
"hooktype" "entity"
782+
"return" "float"
783+
"this" "entity"
784+
}
785+
"CTFSword::GetSwordHealthMod"
786+
{
787+
"offset" "CTFSword::GetSwordHealthMod"
788+
"hooktype" "entity"
789+
"return" "int"
790+
"this" "entity"
791+
}
873792
"CBaseObject::Killed"
874793
{
875794
"offset" "CBaseObject::Killed"
@@ -908,6 +827,20 @@
908827
"return" "void"
909828
"this" "entity"
910829
}
830+
"CBasePlayer::ClientCommand"
831+
{
832+
"offset" "CBasePlayer::ClientCommand"
833+
"hooktype" "entity"
834+
"return" "bool"
835+
"this" "entity"
836+
"arguments"
837+
{
838+
"pArgs"
839+
{
840+
"type" "objectptr"
841+
}
842+
}
843+
}
911844
"CBasePlayer::EquipWearable"
912845
{
913846
"offset" "CBasePlayer::EquipWearable"
@@ -936,17 +869,33 @@
936869
}
937870
}
938871
}
939-
"CTFPlayer::ClientCommand"
872+
"CBaseMultiplayerPlayer::SpeakConceptIfAllowed"
940873
{
941-
"offset" "CTFPlayer::ClientCommand"
874+
"offset" "CBaseMultiplayerPlayer::SpeakConceptIfAllowed"
942875
"hooktype" "entity"
943876
"return" "bool"
944877
"this" "entity"
945878
"arguments"
946879
{
947-
"pArgs"
880+
"iConcept"
948881
{
949-
"type" "objectptr"
882+
"type" "int"
883+
}
884+
"modifiers"
885+
{
886+
"type" "charptr"
887+
}
888+
"pszOutResponseChosen"
889+
{
890+
"type" "charptr"
891+
}
892+
"bufsize"
893+
{
894+
"type" "int"
895+
}
896+
"filter"
897+
{
898+
"type" "int"
950899
}
951900
}
952901
}

0 commit comments

Comments
 (0)