forked from mov1337/FortniteLeak5
-
Notifications
You must be signed in to change notification settings - Fork 0
/
sdk.hpp
1207 lines (954 loc) · 37.5 KB
/
sdk.hpp
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
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#pragma once
#include <fstream>
namespace sdk::cached
{
inline uintptr_t Base = 0;
inline uintptr_t UWorld = 0;
inline uintptr_t FreeFn = 0;
inline uintptr_t GetNameByIndex = 0;
inline uintptr_t LineSightOfTo = 0;
inline uintptr_t GetBoneMatrix = 0;
inline uintptr_t ProjectWorldToScreen = 0;
namespace objects
{
//Engine Render
inline PVOID Font = 0;
inline PVOID K2_DrawLine = 0;
inline PVOID K2_DrawBox = 0;
inline PVOID K2_DrawText = 0;
inline PVOID K2_TextSize = 0;
//Main Functions
inline PVOID WasInputKeyJustPressed = 0;
inline PVOID IsInputKeyDown = 0;
inline PVOID GetMousePosition = 0;
inline PVOID dingus = 0;
inline PVOID GetActorBounds = 0;
inline PVOID K2_SetActorLocation = 0;
inline PVOID GetMuzzleLocation = 0;
inline PVOID GetVelocity = 0;
inline PVOID ClientSetCameraMode = 0;
inline PVOID SetVisibility = 0;
inline PVOID SetWeaponVisibility = 0;
inline PVOID SetCharacterBodyVisibilityForPossession = 0;
inline PVOID ClientSetViewTarget = 0;
inline PVOID GetPlatform = 0;
inline PVOID IsDead = 0;
//Floating
inline PVOID StartFloating = 0;
inline PVOID EndFloating = 0;
//SetTimeOfDay
inline PVOID FortKismetLibrary = 0;
inline PVOID SetTimeOfDay = 0;
//ConvertToFName
inline PVOID KismetStringLibrary = 0;
inline PVOID Conv_StringToName = 0;
}
namespace classes
{
//Actors Classes
inline PVOID FortPlayerPawnAthena = 0;
inline PVOID FortPickup = 0;
inline PVOID BuildingContainer = 0;
inline PVOID FortProjectileBase = 0;
//Not real classes in ue4
inline PVOID Tiered_Chest = 0;
inline PVOID Tiered_Ammo = 0;
}
}
namespace sdk::structs
{
struct FMatrix
{
float M[ 4 ][ 4 ];
};
static FMatrix* myMatrix = new FMatrix( );
template<class T>
struct TArray
{
friend struct FString;
public:
inline TArray( )
{
Data = nullptr;
Count = Max = 0;
};
inline int Num( ) const
{
return Count;
};
inline T& operator[]( int i )
{
return Data[ i ];
};
inline const T& operator[]( int i ) const
{
return Data[ i ];
};
inline bool IsValidIndex( int i ) const
{
return i < Num( );
}
private:
T* Data;
int32_t Count;
int32_t Max;
};
struct FString : private TArray<wchar_t>
{
inline FString( )
{
};
FString( const wchar_t* other )
{
Max = Count = *other ? utilities::custom_wcslen( other ) + 1 : 0;
if ( Count )
{
Data = const_cast< wchar_t* >( other );
}
};
inline bool IsValid( ) const
{
return Data != nullptr;
}
inline const wchar_t* c_str( ) const
{
return Data;
}
};
struct FName
{
uint32_t ComparisonIndex;
uint32_t DisplayIndex;
};
struct FKey
{
FName KeyName;
unsigned char Padding_00[0x10];
};
struct FLinearColor
{
float R;
float G;
float B;
float A;
};
struct FVector2D
{
float X;
float Y;
};
struct FVector
{
float X;
float Y;
float Z;
inline float getDistance(const sdk::structs::FVector cmp) {
if (cmp.X == 0 || cmp.Y == 0 || cmp.Z == 0) return 0;
float dx = (this->X - cmp.X);
float dy = (this->Y - cmp.Y);
float dz = (this->Z - cmp.Z);
int tmp = (utilities::custom_sqrtf((dx * dx) + (dy * dy) + (dz * dz)));
return (int)(tmp / 100);
}
};
struct FRotator
{
float Pitch;
float Yaw;
float Roll;
};
struct FMinimalViewInfo {
sdk::structs::FVector Location;
sdk::structs::FRotator Rotation;
float FOV;
float OrthoWidth;
float OrthoNearClipPlane;
float OrthoFarClipPlane;
float AspectRatio;
};
class FText {
private:
char _padding_[0x28];
PWCHAR Name;
DWORD Length;
public:
inline PWCHAR c_str() {
return Name;
}
};
struct FPawnHighlight
{
float Priority_28_E2E1B5344846E187B9C11B863A7F0698; // 0x0000(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData)
FLinearColor Inner_21_4CC2801147EA190DE16F59B34F36853E; // 0x0004(0x0010) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData)
FLinearColor Outer_22_5A1D7D0543D303E8B54B66A7F7BD2E2E; // 0x0014(0x0010) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData)
float FresnelBrightness_23_52B0F96447FF640F47DF2895B0602E92; // 0x0024(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData)
float FresnelExponent_24_B427CF0C441AA37ED49833BF7579DE6D; // 0x0028(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData)
float UsesPulse_25_E29229F64E540F0617E4C4987AD77605; // 0x002C(0x0004) (Edit, BlueprintVisible, ZeroConstructor, IsPlainOldData)
};
struct FViewTargetTransitionParams
{
float BlendTime;
int BlendFunction;
float BlendExp;
bool bLockOutgoing;
};
enum EViewTargetBlendFunction
{
VTBlend_Linear, // Camera does a simple linear interpolation.
VTBlend_Cubic, // Camera has a slight ease in and ease out, but amount of ease cannot be tweaked.
VTBlend_EaseIn, // Camera immediately accelerates, but smoothly decelerates into the target. Ease amount controlled by BlendExp.
VTBlend_EaseOut, // Camera smoothly accelerates, but does not decelerate into the target. Ease amount controlled by BlendExp.
VTBlend_EaseInOut, // Camera smoothly accelerates and decelerates. Ease amount controlled by BlendExp.
VTBlend_PreBlended, // The game's camera system has already performed the blending. Engine should not blend at all
VTBlend_MAX,
};
class AHUD
{
public:
unsigned char Padding_d24Be[0x228];
char bLostFocusPaused : 1; // 0x228(0x1)
char bShowHUD : 1; // 0x228(0x1)
char bShowDebugInfo : 1; // 0x228(0x1)
unsigned char UnknownBuffer_HaB72 : 5; // 0x228(0x1)
unsigned char UnknownBuffer_7vY26[0x3]; // 0x229(0x3)
int32_t CurrentTargetIndex; // 0x22c(0x4)
char bShowHitBoxDebugInfo : 1; // 0x230(0x1)
char bShowOverlays : 1; // 0x230(0x1)
char bEnableDebugTextShadow : 1; // 0x230(0x1)
unsigned char UnknownBuffer_2aNx7 : 5; // 0x230(0x1)
unsigned char UnknownBuffer_8HAfk[0x7]; // 0x231(0x7)
TArray<struct AActor*> PostRenderedActors; // 0x238(0x10)
unsigned char UnknownBuffer_h7Nua[0x8]; // 0x248(0x8)
TArray<struct FName> DebugDisplay; // 0x250(0x10)
TArray<struct FName> ToggledDebugCategories; // 0x260(0x10)
uintptr_t Canvas; // 0x270(0x8)
uintptr_t DebugCanvas; // 0x278(0x8)
};
}
namespace sdk::classes
{
class UClass {
public:
BYTE _padding_0[ 0x40 ];
UClass* SuperClass;
};
class UObject {
public:
PVOID VTableObject;
DWORD ObjectFlags;
DWORD InternalIndex;
UClass* Class;
BYTE _padding_0[ 0x8 ];
UObject* Outer;
inline BOOLEAN IsA( PVOID parentClass )
{
for ( auto super = this->Class; super; super = super->SuperClass )
if ( super == parentClass )
return true;
return false;
}
};
class FUObjectItem {
public:
UObject* Object;
DWORD Flags;
DWORD ClusterIndex;
DWORD SerialNumber;
DWORD SerialNumber2;
};
class TUObjectArray {
public:
FUObjectItem* Objects[ 9 ];
};
class GObjects {
public:
TUObjectArray* ObjectArray;
BYTE _padding_0[ 0xC ];
DWORD ObjectCount;
};
inline GObjects* objects = nullptr;
}
namespace sdk::objects
{
inline void free_object( uintptr_t address )
{
if (!utilities::isValidPointer(address)) return;
auto function = reinterpret_cast<void(__fastcall*)(__int64)>(cached::FreeFn);
return SpoofCall(function, (__int64)address);
}
inline const wchar_t* get_name_by_index(int idx)
{
std::wstring name = xorstr(L"");
if (!idx) return xorstr(L"");
auto function = reinterpret_cast<structs::FString * (__fastcall*)(int* index, structs::FString * res)>(cached::GetNameByIndex);
int index = idx;
structs::FString fObjectName;
SpoofCall(function, &index, &fObjectName);
if (!fObjectName.IsValid()) return xorstr(L"");
auto objectName = fObjectName.c_str();
name = objectName;
free_object((uintptr_t)fObjectName.c_str());
return name.c_str();
}
inline const wchar_t* get_object_name(classes::UObject* object)
{
std::wstring name = xorstr(L"");
if (!object) return xorstr(L"");
auto function = reinterpret_cast<structs::FString * (__fastcall*)(int* index, structs::FString * res)>(cached::GetNameByIndex);
int index = utilities::read<int>(reinterpret_cast<uint64_t>(object) + 0x18);
structs::FString fObjectName;
SpoofCall(function, &index, &fObjectName);
if (!fObjectName.IsValid()) return xorstr(L"");
auto objectName = fObjectName.c_str();
name = objectName;
free_object((uintptr_t)fObjectName.c_str());
return name.c_str();
}
inline const wchar_t* get_full_object_name(classes::UObject* object)
{
std::wstring name = xorstr(L"");
for (auto i = 0; object; object = object->Outer, i++)
{
if (!object) return xorstr(L"");
auto function = reinterpret_cast<structs::FString * (__fastcall*)(int* index, structs::FString * res)>(cached::GetNameByIndex);
int index = utilities::read<int>(reinterpret_cast<uint64_t>(object) + 0x18);
structs::FString fObjectName;
SpoofCall(function, &index, &fObjectName);
if (!fObjectName.IsValid()) break;
auto objectName = fObjectName.c_str();
name = objectName + std::wstring(i > 0 ? xorstr(L".") : xorstr(L"")) + name;
free_object((uintptr_t)fObjectName.c_str());
}
return name.c_str();
}
inline void NumChunks(sdk::classes::TUObjectArray* ObjectArray, int* start, int* end)
{
int cStart = 0, cEnd = 0;
if (!cEnd)
{
while (true)
{
if (ObjectArray->Objects[cStart] == nullptr)
{
cStart++;
}
else
{
break;
}
}
cEnd = cStart;
while (true)
{
if (ObjectArray->Objects[cEnd] == nullptr)
{
break;
}
cEnd++;
}
}
*start = cStart;
*end = cEnd;
}
inline sdk::classes::UObject* GetObjByIndex(sdk::classes::TUObjectArray* ObjectArray, int32_t index)
{
int cStart = 0, cEnd = 0;
int chunkIndex, chunkSize = 0xFFFF, chunkPos;
sdk::classes::FUObjectItem* Object;
NumChunks(ObjectArray , &cStart, &cEnd);
chunkIndex = index / chunkSize;
if (chunkSize * chunkIndex != 0 &&
chunkSize * chunkIndex == index)
{
chunkIndex--;
}
chunkPos = cStart + chunkIndex;
if (chunkPos < cEnd)
{
Object = ObjectArray->Objects[chunkPos] + (index - chunkSize * chunkIndex);
if (!Object) { return nullptr; }
return Object->Object;
}
return nullptr;
}
inline const wchar_t* fix_objectname(const wchar_t* objname)
{
wchar_t* _4 = (wchar_t*)objname;
for (int i = 0; i < utilities::custom_wcslen(_4); i++)
{
if (_4[i] == L'_')
{
if (_4[i + 1] == L'0' ||
_4[i + 1] == L'1' ||
_4[i + 1] == L'2' ||
_4[i + 1] == L'3' ||
_4[i + 1] == L'4' ||
_4[i + 1] == L'5' ||
_4[i + 1] == L'6' ||
_4[i + 1] == L'7' ||
_4[i + 1] == L'8' ||
_4[i + 1] == L'9')
_4[i] = L'$';
for (int idx = 1; idx < 7; idx++) {
if (_4[i + idx] == L'.') break;
if (_4[i + idx] == L'0' ||
_4[i + idx] == L'1' ||
_4[i + idx] == L'2' ||
_4[i + idx] == L'3' ||
_4[i + idx] == L'4' ||
_4[i + idx] == L'5' ||
_4[i + idx] == L'6' ||
_4[i + idx] == L'7' ||
_4[i + idx] == L'8' ||
_4[i + idx] == L'9') {
_4[i + idx] = L'$';
}
}
}
}
std::wstring str = _4;
str.erase(std::remove(str.begin(), str.end(), '$'), str.end());
return str.c_str();
}
inline PVOID find_object(const wchar_t* objectname)
{
for (auto index = 0x0; index < classes::objects->ObjectCount; index++)
{
auto object = GetObjByIndex(classes::objects->ObjectArray, index);
const wchar_t* tmp_name = get_full_object_name(object);
const wchar_t* name = fix_objectname(tmp_name);
if ((utilities::custom_wcsstr(name, objectname)))
{
return object;
}
}
return 0;
}
inline bool process_event(uintptr_t address, void* fnobject, void* parms)
{
if (!utilities::isValidPointer(address)) return false;
auto index = *reinterpret_cast<void***>(address); if (!index) return false;
auto fProcessEvent = static_cast<void(*)(void* address, void* fnobject, void* parms)>(index[0x4B]); if (!fProcessEvent) return false;
SpoofCall(fProcessEvent, (void*)address, (void*)fnobject, (void*)parms);
return true;
}
inline sdk::structs::FName Conv_StringToName(const wchar_t* String)
{
struct
{
sdk::structs::FString inString; // (Parm, ZeroConstructor)
sdk::structs::FName ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
params.inString = String;
sdk::objects::process_event((uintptr_t)sdk::cached::objects::KismetStringLibrary, sdk::cached::objects::Conv_StringToName, ¶ms);
return params.ReturnValue;
}
}
// Structs
class APlayerState {
public:
uintptr_t TeamIndex() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return utilities::read<uintptr_t>((uintptr_t)this + 0xF28);
}
char CompressedPing() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return utilities::read<char>((uintptr_t)this + 0x220);
}
sdk::structs::FString GetPlatform()
{
if (!utilities::isValidPointer((uintptr_t)this)) return xorstr(L"");
struct
{
sdk::structs::FString ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm)
} params;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::GetPlatform, ¶ms);
return params.ReturnValue;
}
};
class AFortItemDefinition {
public:
sdk::structs::FText* DisplayName() {
if (!utilities::isValidPointer((uintptr_t)this)) return {};
return reinterpret_cast<sdk::structs::FText*>(*(uintptr_t*)((uintptr_t)this + 0x88));
}
UINT8 Tier() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return utilities::read<UINT8>((uintptr_t)this + 0x6C);
}
};
class AFortWeapon {
public:
AFortItemDefinition* WeaponData() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (AFortItemDefinition*)(utilities::read<uintptr_t>((uintptr_t)this + 0x378));
}
sdk::structs::FVector GetMuzzleLocation(int PatternIndex)
{
if (!utilities::isValidPointer((uintptr_t)this)) return { 0, 0, 0 };
struct
{
int PatternIndex;
sdk::structs::FVector ReturnValue;
} params;
params.PatternIndex = PatternIndex;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::GetMuzzleLocation, ¶ms);
return params.ReturnValue;
}
void SetWeaponVisibility(bool bDesiredVisibility, bool bForceUpdate)
{
if (!utilities::isValidPointer((uintptr_t)this)) return;
struct
{
bool bDesiredVisibility; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData)
bool bForceUpdate; // (ConstParm, Parm, ZeroConstructor, IsPlainOldData)
} params;
params.bDesiredVisibility = bDesiredVisibility;
params.bForceUpdate = bForceUpdate;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::SetWeaponVisibility, ¶ms);
}
};
class ARootComponent {
public:
sdk::structs::FVector RelativeLocation() {
if (!utilities::isValidPointer((uintptr_t)this)) return { 0, 0, 0 };
return utilities::read<sdk::structs::FVector>((uintptr_t)this + 0x11C);
}
void SetVisibility(bool bNewVisibility, bool bPropagateToChildren)
{
if (!utilities::isValidPointer((uintptr_t)this)) return;
struct
{
bool bNewVisibility; // (Parm, ZeroConstructor, IsPlainOldData)
bool bPropagateToChildren; // (Parm, ZeroConstructor, IsPlainOldData)
} params;
params.bNewVisibility = bNewVisibility;
params.bPropagateToChildren = bPropagateToChildren;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::SetVisibility, ¶ms);
}
};
class UFortItemDefinition {
public:
sdk::structs::FText* DisplayName() {
if (!utilities::isValidPointer(uintptr_t(this))) return 0;
return reinterpret_cast<sdk::structs::FText*>(utilities::read<uintptr_t>((uintptr_t)this + 0x88));
}
BYTE Tier() {
if (!utilities::isValidPointer(uintptr_t(this))) return false;
return utilities::read<BYTE>((uintptr_t)this + 0x6C);
}
};
class AFortPawn {
public:
const wchar_t* ObjectName() {
if (!utilities::isValidPointer((uintptr_t)this)) return xorstr(L"");
return sdk::objects::get_object_name((sdk::classes::UObject*)this);
}
uintptr_t Mesh() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return utilities::read<uintptr_t>((uintptr_t)this + 0x280);
}
UFortItemDefinition* ItemDefinition() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (UFortItemDefinition*)(utilities::read<uintptr_t>((uintptr_t)this + (0x2A0 + 0x18)));
}
BOOL bAlreadySearched() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return ((utilities::read<BYTE>((uintptr_t)this + 0xdf1) >> 7) & 1); //BuildingContainer.bAlreadySearched
}
AFortWeapon* CurrentWeapon() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (AFortWeapon*)(utilities::read<uintptr_t>((uintptr_t)this + 0x5F8));
}
ARootComponent* RootComponent() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (ARootComponent*)(utilities::read<uintptr_t>((uintptr_t)this + 0x130));
}
APlayerState* PlayerState() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (APlayerState*)(utilities::read<uintptr_t>((uintptr_t)this + 0x238));
}
BOOL IsA(PVOID parentClass)
{
if (!utilities::isValidPointer(uintptr_t(this))) return false;
sdk::classes::UObject* object = (sdk::classes::UObject*)this;
for (auto super = object->Class; super; super = super->SuperClass)
if (super == parentClass)
return true;
return false;
}
void Dingus(color InnerCol, color OuterCol)
{
if (!utilities::isValidPointer(uintptr_t(this))) return;
struct APlayerPawn_Athena_C_ApplyPawnHighlight_Params
{
uintptr_t Source; // (BlueprintVisible, BlueprintReadOnly, Parm, ZeroConstructor, IsPlainOldData)
sdk::structs::FPawnHighlight HitGlow; // (BlueprintVisible, BlueprintReadOnly, Parm, IsPlainOldData)
} params;
sdk::structs::FPawnHighlight HitGlow;
HitGlow.FresnelBrightness_23_52B0F96447FF640F47DF2895B0602E92 = 0.f;
HitGlow.FresnelExponent_24_B427CF0C441AA37ED49833BF7579DE6D = 0;
HitGlow.Inner_21_4CC2801147EA190DE16F59B34F36853E = { (float)InnerCol.R, (float)InnerCol.G, (float)InnerCol.B, (float)InnerCol.A };//{ 1.f, 0.f, 0.f, 1.f };//{ (float)col.R, (float)col.G, (float)col.B, (float)col.A };
HitGlow.Outer_22_5A1D7D0543D303E8B54B66A7F7BD2E2E = { (float)OuterCol.R, (float)OuterCol.G, (float)OuterCol.B, (float)OuterCol.A };//{ 0.f, 1.f, 0.f, 1.f };//{ (float)col.R, (float)col.G, (float)col.B, (float)col.A };
HitGlow.Priority_28_E2E1B5344846E187B9C11B863A7F0698 = 0.f;
HitGlow.UsesPulse_25_E29229F64E540F0617E4C4987AD77605 = 0.f;
params.Source = uintptr_t(this);
params.HitGlow = HitGlow;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::dingus, ¶ms);
}
BOOL K2_SetActorLocation(const sdk::structs::FVector NewLocation, bool bSweep, bool bTeleport)
{
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
struct
{
sdk::structs::FVector NewLocation;
bool bSweep;
int SweepHitResult;
bool bTeleport;
bool ReturnValue;
} params;
params.NewLocation = NewLocation;
params.bSweep = bSweep;
params.bTeleport = bTeleport;
sdk::objects::process_event((uintptr_t)this, sdk::cached::objects::K2_SetActorLocation, ¶ms);
return params.ReturnValue;
}
void GetActorBounds(bool bOnlyCollidingComponents, bool bIncludeFromChildActors, sdk::structs::FVector* Origin, sdk::structs::FVector* BoxExtent)
{
if (!utilities::isValidPointer(uintptr_t(this))) return;
struct
{
bool bOnlyCollidingComponents;
sdk::structs::FVector Origin;
sdk::structs::FVector BoxExtent;
bool bIncludeFromChildActors;
} params;
params.bOnlyCollidingComponents = bOnlyCollidingComponents;
params.bIncludeFromChildActors = bIncludeFromChildActors;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::GetActorBounds, ¶ms);
if (Origin != nullptr)
*Origin = params.Origin;
if (BoxExtent != nullptr)
*BoxExtent = params.BoxExtent;
}
sdk::structs::FVector GetBone(int Id)
{
if(!utilities::isValidPointer(uintptr_t(this))) return { 0, 0, 0 };
auto mesh = Mesh();
if (!mesh) return { 0, 0, 0 };
auto function = ((sdk::structs::FMatrix * (__fastcall*)(uintptr_t, sdk::structs::FMatrix*, int))(sdk::cached::GetBoneMatrix));
SpoofCall(function, mesh, sdk::structs::myMatrix, Id);
return { sdk::structs::myMatrix->M[3][0], sdk::structs::myMatrix->M[3][1], sdk::structs::myMatrix->M[3][2] };
}
sdk::structs::FVector GetVelocity()
{
if (!utilities::isValidPointer((uintptr_t)this)) return { 0, 0, 0 };
struct
{
sdk::structs::FVector ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
sdk::objects::process_event((uintptr_t)this, sdk::cached::objects::GetVelocity, ¶ms);
return params.ReturnValue;
}
BOOL SetCharacterBodyVisibilityForPossession(bool bVisible)
{
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
struct
{
bool bVisible; // (Parm, ZeroConstructor, IsPlainOldData)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
params.bVisible = bVisible;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::SetCharacterBodyVisibilityForPossession, ¶ms);
return params.ReturnValue;
}
VOID StartFloating()
{
if (!utilities::isValidPointer((uintptr_t)this)) return;
struct
{
} params;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::StartFloating, ¶ms);
}
VOID EndFloating()
{
if (!utilities::isValidPointer((uintptr_t)this)) return;
struct
{
} params;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::EndFloating, ¶ms);
}
bool IsDead()
{
if (!utilities::isValidPointer((uintptr_t)this)) return false;
struct
{
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::IsDead, ¶ms);
return params.ReturnValue;
}
};
class APlayerController {
public:
AFortPawn* LocalPawn() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (AFortPawn*)(utilities::read<uintptr_t>((uintptr_t)this + 0x2A8));
}
BOOL IsVisible(PVOID TargetActor) {
//if (!utilities::isValidPointer((uintptr_t)this)) return 0;
//if (!utilities::isValidPointer((uintptr_t)TargetActor)) return 0;
//sdk::structs::FVector ViewPoint;
//auto LineOfSight = reinterpret_cast<bool(__fastcall*)(PVOID PlayerController, PVOID TargetActor, sdk::structs::FVector* ViewPoint)>(sdk::cached::LineSightOfTo);
//return SpoofCall(LineOfSight, (PVOID)this, TargetActor, &ViewPoint);
return true;
}
Vector2 WorldToScreen(sdk::structs::FVector WorldLocation)
{
if (!utilities::isValidPointer(uintptr_t(this))) return Vector2(0, 0);
sdk::structs::FVector2D Output;
auto WorldToScreen = reinterpret_cast<bool(__fastcall*)(uintptr_t, sdk::structs::FVector, sdk::structs::FVector2D*, char)>(sdk::cached::ProjectWorldToScreen);
SpoofCall(WorldToScreen, (uintptr_t)this, WorldLocation, &Output, (char)0);
return { Output.X, Output.Y };
}
VOID ClientSetCameraMode(sdk::structs::FName NewCamMode)
{
if (!utilities::isValidPointer(uintptr_t(this))) return;
struct
{
sdk::structs::FName NewCamMode; // (Parm, ZeroConstructor, IsPlainOldData)
} params;
params.NewCamMode = NewCamMode;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::ClientSetCameraMode, ¶ms);
}
VOID ClientSetViewTarget(AFortPawn* Actor, sdk::structs::FViewTargetTransitionParams TransitionParams)
{
if (!utilities::isValidPointer(uintptr_t(this))) return;
struct
{
uintptr_t A; // (Parm, ZeroConstructor, IsPlainOldData)
sdk::structs::FViewTargetTransitionParams TransitionParams; // (Parm) FViewTargetTransitionParams
} params;
params.A = uintptr_t(Actor);
params.TransitionParams = TransitionParams;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::ClientSetViewTarget, ¶ms);
}
bool WasInputKeyJustPressed(sdk::structs::FKey Key)
{
if (!utilities::isValidPointer(uintptr_t(this))) return false;
struct
{
sdk::structs::FKey Key; // (Parm)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
params.Key = Key;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::WasInputKeyJustPressed, ¶ms);
return params.ReturnValue;
}
bool IsInputKeyDown(sdk::structs::FKey Key)
{
if (!utilities::isValidPointer(uintptr_t(this))) return false;
struct APlayerController_IsInputKeyDown_Params
{
sdk::structs::FKey Key; // (Parm)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
params.Key = Key;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::IsInputKeyDown, ¶ms);
return params.ReturnValue;
}
Vector2 GetMousePosition()
{
if (!utilities::isValidPointer((uintptr_t)this)) return { 0, 0 };
struct
{
float LocationX; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
float LocationY; // (Parm, OutParm, ZeroConstructor, IsPlainOldData)
bool ReturnValue; // (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData)
} params;
sdk::objects::process_event(uintptr_t(this), sdk::cached::objects::GetMousePosition, ¶ms);
Vector2 ret;
ret.x = params.LocationX;
ret.y = params.LocationY;
return ret;
}
};
class ULocalPlayer {
public:
APlayerController* PlayerController() {
if (!utilities::isValidPointer((uintptr_t)this)) return 0;
return (APlayerController*)(utilities::read<uintptr_t>((uintptr_t)this + 0x30));
}
};
class ULocalPlayers {
public:
ULocalPlayer* LocalPlayer() {