This repository has been archived by the owner on Dec 18, 2017. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvgm_hooks.cpp
831 lines (734 loc) · 20 KB
/
vgm_hooks.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
#include "vgm_hooks.h"
// ---------------------------
// This File (Hooks.cpp) generally need not be modified, with the exception of adding a new hook.
// ---------------------------
bool InitHook() {
vManager.Init();
return true;
}
ASMHackJump InitHack(InitHookAddr, &InitHook);
void __stdcall XWISInitHook() {
__asm {
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
}
static ASMHackJump* XWISJoinHook1 = new ASMHackJump(XWISPlayerLimitBypassHookAddr1, &XWISPlayerLimitBypassNaked1, 1);
static ASMHackCall* XWISJoinHook2 = new ASMHackCall(XWISPlayerLimitBypassHookAddr2, &XWISPlayerLimitBypassNaked2);
ConsoleOut("[VGM] WOLAPI Hooks Enabled.");
}
ASMHackCall XWISInitHack(XWISInitHookAddr, &XWISInitHook);
void __stdcall OnThink() {
vManager.Think();
Stewie_GameModeManager::Think();
}
ASMHackCall ThinkHack(ThinkHookAddr, &OnThink);
void __stdcall OnShutdown() { vManager.Shutdown(); ConsoleOut("[VGM] The Dedicated Server shutdown procedure is complete."); }
ASMHackJump ShutdownHack(ShutdownHookAddr, &OnShutdown);
void __stdcall OnLevelLoaded() { vManager.Level_Loaded(); }
ASMHackJump LevelLoadHack(LevelLoadHookAddr, &OnLevelLoaded);
void __stdcall OnLevelEnd() { vManager.Level_Ended(); }
__declspec(naked) void LevelEndNaked() {
__asm {
sub esp,0x10
push ebx
push ebp
push ecx
call OnLevelEnd
pop ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump LevelEndHack(LevelEndHookAddr, &LevelEndNaked);
ASMHackJump TeamScoreSwitchFixHack(TeamScoreSwitchFixHookAddr, TeamScoreSwitchFixHookAddr + 0x109);
void __stdcall OnGameReset() { vManager.Game_Reset(); }
__declspec(naked) void ResetGameNaked() {
__asm {
call OnGameReset
jmp GameDataObj // Original function
}
}
ASMHackNops ChangeTeamNops(ChangeTeamHookAddr, 0x6B); // Old remix code
ASMHackCall ResetGameHack(ResetGameHookAddr, &ResetGameNaked); // Just before resetting the player data (scores)
ASMHackCall ChatMsgHack(ChatMsgHookAddr, &ChatMsgHook);
__declspec(naked) void RadioNaked() {
__asm {
push ecx
push ecx
call RadioHook
pop ecx
test al,al
je skip
push edi
mov edi,ecx
push 0x000000 // For security and licensing purposes, an address has been hidden from this line
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump RadioHack(RadioHookAddr, &RadioNaked, 3);
__declspec(naked) void ReserveAllSlotsNaked() {
__asm {
mov eax,127
sub esp,0x10
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
ASMHackJump ReserveAllSlotsHack(ReserveAllSlotsHookAddr, &ReserveAllSlotsNaked, 2);
__declspec(naked) void XWISPlayerLimitBypassNaked1() {
__asm {
push 0x80
push [esi+4]
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
unsigned int __stdcall XWISPlayerLimitBypassHook2() {
return GameDataObj()->MaxPlayers;
}
__declspec(naked) void XWISPlayerLimitBypassNaked2() {
__asm {
call XWISPlayerLimitBypassHook2
add eax,1
retn
}
}
__declspec(naked) void ClientConnectionNaked() {
__asm {
push [esp+4]
push ecx
call ClientConnectionHook
retn 4
}
}
ASMHackJump ClientConnectionHack(ClientConnectionHookAddr, &ClientConnectionNaked);
__declspec(naked) void PlayerJoinNaked() {
__asm {
push ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
call PlayerJoinHook
retn
}
}
ASMHackPtr PlayerJoinHack(PlayerJoinHookAddr, &PlayerJoinNaked);
__declspec(naked) void ClientDisconnectNaked() {
__asm {
push esi
call ClientDisconnectHook
retn 12
}
}
ASMHackCall ClientDisconnectHack(ClientDisconnectHookAddr, &ClientDisconnectNaked);
__declspec(naked) void PlayerLeaveNaked() {
__asm {
push edi
call PlayerLeaveHook
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackCall PlayerLeaveHack(PlayerLeaveHookAddr, &PlayerLeaveNaked);
__declspec(naked) void PlayerTeamNaked() {
__asm {
push ecx
push [esp+4]
push ecx
call PlayerTeamHook
pop ecx
mov edi,ecx
mov [esp+0xC],edi
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump PlayerTeamHack(PlayerTeamHookAddr, &PlayerTeamNaked, 1);
__declspec(naked) void SerialRetrievedNaked() {
__asm {
push esi
call SerialRetrievedHook
pop edi
pop esi
pop ebx
retn 4
}
}
ASMHackJump SerialRetrievedHack(SerialRetrievedHookAddr, &SerialRetrievedNaked);
__declspec(naked) void VehicleTransitionNaked() {
__asm {
push ecx
push ecx
push [esp+0xC]
call VehicleTransitionHook
pop ecx
test al,al
je go
push [esp+4]
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
go:
retn
}
}
ASMHackCall VehicleTransitionHack(VehicleTransitionHookAddr, &VehicleTransitionNaked);
__declspec(naked) void ExitDeadVehicleNaked() {
__asm {
push ecx
push ecx
call ExitDeadVehicleHook
pop ecx
sub esp,0x7C
push esi
mov esi,ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump ExitDeadVehicleHack(ExitDeadVehicleHookAddr, &ExitDeadVehicleNaked, 1);
ASMHackCall OnPurchaseHack(OnPurchaseHookAddr, &OnPurchaseHook);
ASMHackCall OnPurchaseCharacterHack(OnPurchaseCharacterHookAddr, &OnPurchaseCharacterHook);
__declspec(naked) void PowerupCollectedNaked() {
__asm {
push ecx
push ecx
mov eax,[esp+0xC]
push eax
call PowerupCollectedHook
pop ecx
test al,al
je skip
push ebx
mov ebx,[esp+8]
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump PowerupCollectedHack(PowerupCollectedHookAddr, &PowerupCollectedNaked);
__declspec(naked) void WantsPowerupsNaked() {
__asm {
push ecx
call WantsPowerupsHook
retn
}
}
ASMHackJump WantsPowerupsHack(WantsPowerupsHookAddr, &WantsPowerupsNaked);
__declspec(naked) void WeaponDefSearchNaked() {
__asm {
test esi,esi
je skip
mov eax,[esi]
test eax,eax
je skip
mov ecx,esi
call [eax+0x20]
mov ecx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp ecx
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump WeaponDefSearchHack(WeaponDefSearchHookAddr, &WeaponDefSearchNaked);
__declspec(naked) void PlayerKillMsgNaked() {
__asm {
pop eax
pop eax
push [esp+0x14]
push [esp+0x10]
push ecx
call PlayerKillMsgHook
mov ecx,PlayerKillMsgHookAddr + 5
jmp ecx
}
}
ASMHackJump PlayerKillMsgHack(PlayerKillMsgHookAddr, &PlayerKillMsgNaked);
__declspec(naked) bool DamageNaked() {
__asm {
push ecx
push ecx
call DamageHook
pop ecx
retn
}
}
ASMHackCall DamageHack(DamageHookAddr, &DamageNaked);
void __stdcall SoldierRDNaked(Stewie_OffenseObjectClass &object, float unk1, int unk2) {
bool damage = false;
__asm {
push ecx
push object
push ecx
call SoldierRDHook
mov damage,al
pop ecx
}
if (damage) {
__asm {
push unk2
push unk1
push object
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
}
}
}
ASMHackCall SoldierRDHack(SoldierRDHookAddr, &SoldierRDNaked);
void __stdcall VehicleRDNaked(Stewie_OffenseObjectClass &object, float unk1, int unk2) {
bool damage = false;
__asm {
push ecx
push object
push ecx
call VehicleRDHook
mov damage,al
pop ecx
}
if (damage) {
__asm {
push unk2
push unk1
push object
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
}
}
}
ASMHackCall VehicleRDHack(VehicleRDHookAddr, &VehicleRDNaked);
__declspec(naked) void BuildingRDNaked() {
__asm {
push ebx
mov ebx,ecx
push esi
push edi
push ecx
push [esp+0x14]
push ecx
call BuildingRDHook
pop ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump BuildingRDHack(BuildingRDHookAddr, &BuildingRDNaked);
__declspec(naked) void FatalDamageNaked() {
__asm {
push [esp]
push ebx
call FatalDamageHook
cmp esi,ebp
je skip
fld [esi]
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump FatalDamageHack(FatalDamageHookAddr, &FatalDamageNaked, 1);
__declspec(naked) void JumpNaked() {
__asm {
mov eax,[ecx]
call [eax+0x18]
push eax
mov eax,esi
mov eax,[eax+0x2C]
mov eax,[eax+0x4C]
add eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
push eax
call JumpHook
pop eax
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
ASMHackJump JumpHack(JumpHookAddr, &JumpNaked);
__declspec(naked) void FallNaked() {
__asm {
push [esp+0x28]
mov eax,edi
mov eax,[eax+0x2C]
mov eax,[eax+0x4C]
add eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
push eax
call FallHook
test al,al
je nodmg
mov eax,FallHookAddr + 6
jmp eax
nodmg:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump FallHack(FallHookAddr, &FallNaked);
__declspec(naked) void __stdcall VehicleFlipNaked() {
__asm {
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
push eax
push ebx
call VehicleFlipHook
pop eax
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
ASMHackJump VehicleFlipHack(VehicleFlipHookAddr, &VehicleFlipNaked);
__declspec(naked) void __stdcall ObjectCreationNaked() {
__asm {
push esi
mov esi,ecx
push edi
xor edi,edi
push ecx
push esi
call ObjectCreationHook
pop ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump ObjectCreationHack(ObjectCreationHookAddr, &ObjectCreationNaked, 1);
__declspec(naked) void __stdcall VehicleCreateNaked() {
__asm {
push ecx
push [esp+0x8]
push edi
call VehicleCreateHook
pop ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackCall VehicleCreateHack1(VehicleCreateHookAddr1, &VehicleCreateNaked);
ASMHackCall VehicleCreateHack2(VehicleCreateHookAddr2, &VehicleCreateNaked);
__declspec(naked) void HarvesterDockedNaked() {
__asm {
push esi
mov esi,ecx
push [esi+0x82C]
push esi
call HarvesterDockedHook
mov ecx,esi
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
ASMHackJump HarvesterDockedHack(HarvesterDockedHookAddr, &HarvesterDockedNaked, 3);
__declspec(naked) void C4InitNaked() {
__asm {
push ecx
push ebx
call C4InitHook
pop ecx
pop esi
pop ebx
add esp,0x20
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump C4InitHack(C4InitHookAddr, &C4InitNaked);
ASMHackCall C4LimitHack(C4LimitHookAddr, &C4LimitHook);
ASMHackCall C4ShouldExplodeHack(C4ShouldExplodeHookAddr, &C4ShouldExplodeHook);
__declspec(naked) void C4DefuseNaked() {
__asm {
push ecx
push [esp+0x8] // ECX + Return Address = 0x8
push ecx
call C4DefuseHook
pop ecx
test al,al
je skip
mov al,0x000000 // For security and licensing purposes, an address has been hidden from this line
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump C4DefuseHack(C4DefuseHookAddr, &C4DefuseNaked);
/*__declspec(naked) void C4DetonationNaked() {
__asm {
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
push eax
push esi
call C4DetonationHook
pop eax
mov ebx,C4DetonationHookAddr + 5
jmp ebx
}
}
ASMHackJump C4DetonationHack(C4DetonationHookAddr, &C4DetonationNaked);*/
__declspec(naked) void C4DetonationNaked() {
__asm {
push ecx
push ecx
call C4DetonationHook
pop ecx
test al,al
je skip
mov al,0x000000 // For security and licensing purposes, an address has been hidden from this line
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump C4DetonationHack(C4DetonationHookAddr, &C4DetonationNaked);
__declspec(naked) void C4PlantedNaked() {
__asm {
push ecx
lea edi,[esi-0x76C]
push edi
call C4PlantedHook
pop ecx
mov al,0x000000 // For security and licensing purposes, an address has been hidden from this line
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump C4PlantedHack(C4PlantedHookAddr, &C4PlantedNaked);
__declspec(naked) void C4ExportAttachedNaked() {
__asm {
push 0x20
test ecx,ecx
jne skip
mov ecx,0x000000 // For security and licensing purposes, an address has been hidden from this line
skip:
push ecx
mov ecx,esi
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
mov ecx,C4ExportAttachedHookAddr + 0xA
jmp ecx
}
}
ASMHackJump C4ExportAttachedHack(C4ExportAttachedHookAddr, &C4ExportAttachedNaked, 5);
ASMHackCall EnemySeenHack(EnemySeenHookAddr, &EnemySeenHook);
__declspec(naked) void BeaconStateNaked() {
__asm {
push ebp
mov ebp,[esp+0x14]
push ecx
push ebp
push ecx
call BeaconStateHook
pop ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump BeaconStateHack(BeaconStateHookAddr, &BeaconStateNaked);
__declspec(naked) void BeaconWarningNaked() {
__asm {
push ebx
push esi
mov esi,[0x000000] // For security and licensing purposes, an address has been hidden from this line
push ecx
push 5
push [esp+0x14]
call BeaconStateHook
pop ecx
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump BeaconWarningHack(BeaconWarningHookAddr, &BeaconWarningNaked, 3);
__declspec(naked) void BeaconInitiatedNaked() {
__asm {
push 6
push esi
call BeaconStateHook
mov al,[0x000000] // For security and licensing purposes, an address has been hidden from this line
mov ecx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp ecx
}
}
ASMHackJump BeaconInitiatedHack(BeaconInitiatedHookAddr, &BeaconInitiatedNaked);
__declspec(naked) void BeaconDisarmedNaked() {
__asm {
push ecx
push [esp+0x8]
push ecx
call BeaconDisarmedHook
pop ecx
push esi
mov esi,ecx
mov al,[esi+0x4A4]
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
ASMHackJump BeaconDisarmedHack(BeaconDisarmedHookAddr, &BeaconDisarmedNaked, 4);
__declspec(naked) void BeaconRequestedNaked() {
__asm {
push [esp+4]
push ecx
call BeaconRequestedHook
retn 4
}
}
ASMHackJump BeaconRequestedHack(BeaconRequestedHookAddr, &BeaconRequestedNaked);
__declspec(naked) bool BeaconOwnerInterruptedNaked() {
__asm {
push ecx
push ecx
call BeaconOwnerInterruptedHook
pop ecx
retn
}
}
ASMHackCall BeaconOwnerInterruptedHack(BeaconOwnerInterruptedHookAddr, &BeaconOwnerInterruptedNaked);
__declspec(naked) void PedestalTimerNaked() {
__asm {
push ecx
push esi
call PedestalTimerHook
pop ecx
test al,al
je NotDetonated
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
NotDetonated:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump PedestalTimerHack(PedestalTimerHookAddr, &PedestalTimerNaked);
__declspec(naked) void PedestalNaked() {
__asm {
push ecx
push esi
call PedestalHook
pop ecx
test al,al
je skip
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
call eax
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
skip:
mov eax,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp eax
}
}
ASMHackJump PedestalHack(PedestalHookAddr, &PedestalNaked);
__declspec(naked) void SelectWeaponNaked() {
__asm {
push esi
call SelectWeaponHook
pop esi
retn
}
}
ASMHackJump SelectWeaponHack(SelectWeaponHookAddr, &SelectWeaponNaked);
int __cdecl UnlimitedAmmoHook() {
Stewie_WeaponClass *w;
__asm { mov w, ecx }
int r = 0;
if (w) {
if ((int)(w->ClipBullets) == -1) {
if ((int)(w->Bullets) == 0) { r = -1; }
else { r = (int)(w->Bullets); }
} else {
r = (int)(w->Bullets) + (int)(w->ClipBullets);
}
}
return r;
}
ASMHackCall UnlimitedAmmoHack(UnlimitedAmmoHookAddr, &UnlimitedAmmoHook);
/*
#ifdef DEBUG
#ifdef _DEV_
void __stdcall InterpretStateHook(Stewie_HumanStateClass& HumanState, Stewie_HumanStateClass::HumanStateType StateType, int SubState) {
if (HumanState.Type != Stewie_HumanStateClass::IN_VEHICLE) {
HumanState.Set_State(StateType,SubState);
}
}
__declspec(naked) void InterpretStateNaked() {
__asm {
push [esp+8]
push [esp+8]
push ecx
call InterpretStateHook
retn 8
}
}
ASMHackJump obb_separation_testHook(obbSeparationTestFixHookAddr, &obb_separation_test);
ASMHackJump CheckBox0BasisHack(CheckBox0BasisHookAddr, &obb_check_box0_basis);
ASMHackJump CheckBox1BasisHack(CheckBox1BasisHookAddr, &obb_check_box1_basis);
ASMHackCall InterpretStateHack(0x000000, &InterpretStateNaked); // For security and licensing purposes, an address has been hidden from this line
#else
__declspec(naked) void BlueHellHook() {
__asm {
mov esi,[ecx+0xAC]
mov dword ptr [ecx+0xC],-1
retn
}
}
ASMHackCall BlueHellHack(BlueHellHookAddr, &BlueHellHook, 1);
#endif
#endif
*/
__declspec(naked) void MenuBgCrashFixNaked() {
__asm {
test ecx,ecx
je skip
mov eax,[ecx+0x10]
test eax,eax
jnz skip
mov edx,MenuBgCrashFixHookAddr + 0x7
jmp edx
skip:
mov edx,0x000000 // For security and licensing purposes, an address has been hidden from this line
jmp edx
}
}
ASMHackJump MenuBgCrashFixHack(MenuBgCrashFixHookAddr, &MenuBgCrashFixNaked);
__declspec(naked) void DoorFixNaked() {
__asm {
push [esp+0x10]
push ecx
call DoorFixHook
retn
}
}
ASMHackCall DoorFixHack(DoorFixHookAddr, &DoorFixNaked);
__declspec(naked) void PointFixHook() {
__asm {
push [esp+4+0x4C] // OffenseObject
push ebx // DefenseObject
call GetDmgMultiplier
fmul [esp+4+0x14] // ShieldDamage
fadd [esp+4+0x10] // HealthDamage
retn
}
}
ASMHackCall PointFixHack(PointFixHookAddr, &PointFixHook, 1);
void __stdcall PTFixHook(Stewie_cPlayer& Player) {
Player.Set_Is_Active(true);
Stewie_cNetwork::Send_Object_Update(&Player,Player.PlayerId);
}
__declspec(naked) void PTFixNaked() {
__asm {
mov [esp+4],ecx
jmp PTFixHook
}
}
ASMHackCall PTFixHack(PTFixHookAddr, &PTFixNaked);
ASMHackNops NodHarvesterGlitchFixNops(NodHarvesterGlitchFixHookAddr, 0xC);
ASMHackNops ResultScreenGlitchFixNops(ResultScreenGlitchFixHookAddr, 0x9);