-
Notifications
You must be signed in to change notification settings - Fork 2
/
GetComponent.hpp
925 lines (847 loc) · 29.3 KB
/
GetComponent.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
#pragma once
#include "IDAdefs.h"
#define ISVALID(x) ((x) && (x) != INVALID_HANDLE_VALUE)
namespace OW {
class HPComponent
{
public:
char pad_0001[0xDC];
Vector2 Health;
char pad_0002[0x21C];
Vector2 Armor;
char pad_0003[0x35C];
Vector2 Barrier;
Vector2 GetHealth()
{
Vector2 HP = SDK->RPM<Vector2>((uint64_t)&this->Health);
Vector2 Ar = SDK->RPM<Vector2>((uint64_t)&this->Armor);
Vector2 Br = SDK->RPM<Vector2>((uint64_t)&this->Barrier);
// HP.X = Max , HP.Y = Current HP
return { HP.X + Ar.X + Br.X ,HP.Y + Ar.Y + Br.Y };
}
};
struct health_compo_t {
union {
OFF_MEMB(float, health, 0xE0);
OFF_MEMB(float, health_max, 0xDC);
OFF_MEMB(float, armor, 0x220);
OFF_MEMB(float, armor_max, 0x21C);
OFF_MEMB(float, barrier, 0x360);
OFF_MEMB(float, barrier_max, 0x35C);
OFF_MEMB(bool, isImmortal, 0x4A9);
OFF_MEMB(bool, isBarrierProjected, 0x4A8);
};
};
struct obj_compo_t {
union {
OFF_MEMB(XMFLOAT3, obj_pos, 0xE0);
};
};
struct velocity_compo_t {
union {
OFF_MEMB(XMFLOAT3, velocity, 0x50);
OFF_MEMB(XMFLOAT3, location, 0x1B0 + 0x50);
OFF_MEMB(uint64_t, bonedata, 0x8A0);
};
};
struct hero_compo_t {
union {
OFF_MEMB(uint64_t, heroid, 0xD0);
};
};
struct vis_compo_t {
union {
OFF_MEMB(uint64_t, key1, 0xA0);
OFF_MEMB(uint64_t, key2, 0x98);
};
};
inline std::string GetHeroNames(uint64_t HeroID, uint64_t LinkBase) {
switch (HeroID)
{
case eHero::HERO_REAPER:
return skCrypt(u8"死神").decrypt();
case eHero::HERO_TRACER:
return skCrypt(u8"猎空").decrypt();
case eHero::HERO_MERCY:
return skCrypt(u8"天使").decrypt();
case eHero::HERO_HANJO:
return skCrypt(u8"半藏").decrypt();
case eHero::HERO_TORBJORN:
return skCrypt(u8"托比昂").decrypt();
case eHero::HERO_REINHARDT:
return skCrypt(u8"莱因哈特").decrypt();
case eHero::HERO_PHARAH:
return skCrypt(u8"法老之鹰").decrypt();
case eHero::HERO_WINSTON:
return skCrypt(u8"温斯顿").decrypt();
case eHero::HERO_WIDOWMAKER:
return skCrypt(u8"黑百合").decrypt();
case eHero::HERO_BASTION:
return skCrypt(u8"堡垒").decrypt();
case eHero::HERO_SYMMETRA:
return skCrypt(u8"秩序之光").decrypt();
case eHero::HERO_ZENYATTA:
return skCrypt(u8"禅雅塔").decrypt();
case eHero::HERO_GENJI:
return skCrypt(u8"源氏").decrypt();
case eHero::HERO_ROADHOG:
return skCrypt(u8"路霸").decrypt();
case eHero::HERO_MCCREE:
return skCrypt(u8"麦克雷").decrypt();
case eHero::HERO_JUNKRAT:
return skCrypt(u8"狂鼠").decrypt();
case eHero::HERO_ZARYA:
return skCrypt(u8"查莉娅").decrypt();
case eHero::HERO_SOLDIER76:
return skCrypt(u8"士兵76").decrypt();
case eHero::HERO_LUCIO:
return skCrypt(u8"卢西奥").decrypt();
case eHero::HERO_DVA:
if (SDK->RPM<uint16_t>(LinkBase + 0xD4) != SDK->RPM<uint16_t>(LinkBase + 0xD8))
return skCrypt(u8"D.Va").decrypt();
else
return skCrypt(u8"哈娜").decrypt();
case eHero::HERO_MEI:
return skCrypt(u8"美").decrypt();
case eHero::HERO_ANA:
return skCrypt(u8"安娜").decrypt();
case eHero::HERO_SOMBRA:
return skCrypt(u8"黑影").decrypt();
case eHero::HERO_ORISA:
return skCrypt(u8"奥丽莎").decrypt();
case eHero::HERO_DOOMFIST:
return skCrypt(u8"末日铁拳").decrypt();
case eHero::HERO_MOIRA:
return skCrypt(u8"莫伊拉").decrypt();
case eHero::HERO_BRIGITTE:
return skCrypt(u8"布里吉塔").decrypt();
case eHero::HERO_WRECKINGBALL:
return skCrypt(u8"破坏球").decrypt();
case eHero::HERO_SOJOURN:
return skCrypt(u8"索杰恩").decrypt();
case eHero::HERO_ASHE:
return skCrypt(u8"艾什").decrypt();
case eHero::HERO_BAPTISTE:
return skCrypt(u8"巴蒂斯特").decrypt();
case eHero::HERO_KIRIKO:
return skCrypt(u8"雾子").decrypt();
case eHero::HERO_JUNKERQUEEN:
return skCrypt(u8"渣客女王").decrypt();
case eHero::HERO_SIGMA:
return skCrypt(u8"西格玛").decrypt();
case eHero::HERO_ECHO:
return skCrypt(u8"回声").decrypt();
case eHero::HERO_RAMATTRA:
return skCrypt(u8"拉玛刹").decrypt();
case eHero::HERO_TRAININGBOT1:
return skCrypt(u8"标准机器人").decrypt();
case eHero::HERO_TRAININGBOT2:
return skCrypt(u8"重装机器人").decrypt();
case eHero::HERO_TRAININGBOT3:
return skCrypt(u8"狙击机器人").decrypt();
case eHero::HERO_TRAININGBOT4:
return skCrypt(u8"友方机器人").decrypt();
case eHero::HERO_TRAININGBOT5:
return skCrypt(u8"友方重装机器人").decrypt();
case eHero::HERO_TRAININGBOT6:
return skCrypt(u8"火箭机器人").decrypt();
case eHero::HERO_TRAININGBOT7:
return skCrypt(u8"训练机器人").decrypt();
case eHero::HERO_LIFEWEAVER:
return skCrypt(u8"生命之梭").decrypt();
case eHero::TOBTERT:
return skCrypt(u8"炮台").decrypt();
case eHero::SYMTERT:
return skCrypt(u8"摄像头").decrypt();
case eHero::HERO_ILLARI:
return skCrypt(u8"伊拉锐").decrypt();
case eHero::HERO_MAUGA:
return skCrypt(u8"毛加").decrypt();
case eHero::Bob:
return skCrypt(u8"鲍勃").decrypt();
default:
return skCrypt(u8"未知").decrypt();
}
}
inline uint64_t GetParent(uint64_t encrypted) {
__try {
auto result = encrypted;
result -= 0x401C60913E3B91CE;
result = (result >> 0x20) | (result << 0x20);
return result;
}
__except (1) {
}
}
inline std::string GetHeroEngNames(uint64_t HeroID, uint64_t LinkBase) {
switch (HeroID)
{
case eHero::HERO_REAPER:
return skCrypt("Reaper").decrypt();
case eHero::HERO_TRACER:
return skCrypt("Tracer").decrypt();
case eHero::HERO_MERCY:
return skCrypt("Mercy").decrypt();
case eHero::HERO_HANJO:
return skCrypt("Hanzo").decrypt();
case eHero::HERO_TORBJORN:
return skCrypt("Torbjorn").decrypt();
case eHero::HERO_REINHARDT:
return skCrypt("Reinhardt").decrypt();
case eHero::HERO_PHARAH:
return skCrypt("Pharah").decrypt();
case eHero::HERO_WINSTON:
return skCrypt("Winston").decrypt();
case eHero::HERO_WIDOWMAKER:
return skCrypt("Widowmaker").decrypt();
case eHero::HERO_BASTION:
return skCrypt("Bastion").decrypt();
case eHero::HERO_SYMMETRA:
return skCrypt("Symmetra").decrypt();
case eHero::HERO_ZENYATTA:
return skCrypt("Zenyatta").decrypt();
case eHero::HERO_GENJI:
return skCrypt("Genji").decrypt();
case eHero::HERO_ROADHOG:
return skCrypt("Roadhog").decrypt();
case eHero::HERO_MCCREE:
return skCrypt("McCree").decrypt();
case eHero::HERO_JUNKRAT:
return skCrypt("Junkrat").decrypt();
case eHero::HERO_ZARYA:
return skCrypt("Zarya").decrypt();
case eHero::HERO_SOLDIER76:
return skCrypt("Soldier 76").decrypt();
case eHero::HERO_LUCIO:
return skCrypt("Lucio").decrypt();
case eHero::HERO_DVA:
if (SDK->RPM<uint16_t>(LinkBase + 0xD4) != SDK->RPM<uint16_t>(LinkBase + 0xD8))
return skCrypt("D.Va").decrypt();
else
return skCrypt("Hana").decrypt();
case eHero::HERO_MEI:
return skCrypt("Mei").decrypt();
case eHero::HERO_ANA:
return skCrypt("Ana").decrypt();
case eHero::HERO_SOMBRA:
return skCrypt("Sombra").decrypt();
case eHero::HERO_ORISA:
return skCrypt("Orisa").decrypt();
case eHero::HERO_DOOMFIST:
return skCrypt("Doomfist").decrypt();
case eHero::HERO_MOIRA:
return skCrypt("Moira").decrypt();
case eHero::HERO_BRIGITTE:
return skCrypt("Brigitte").decrypt();
case eHero::HERO_WRECKINGBALL:
return skCrypt("Wrecking Ball").decrypt();
case eHero::HERO_SOJOURN:
return skCrypt("Sojourn").decrypt();
case eHero::HERO_ASHE:
return skCrypt("Ashe").decrypt();
case eHero::HERO_BAPTISTE:
return skCrypt("Baptiste").decrypt();
case eHero::HERO_KIRIKO:
return skCrypt("Kiriko").decrypt();
case eHero::HERO_JUNKERQUEEN:
return skCrypt("Junker Queen").decrypt();
case eHero::HERO_SIGMA:
return skCrypt("Sigma").decrypt();
case eHero::HERO_ECHO:
return skCrypt("Echo").decrypt();
case eHero::HERO_RAMATTRA:
return skCrypt("Ramattra").decrypt();
case eHero::HERO_TRAININGBOT1:
return skCrypt("Standard Bot").decrypt();
case eHero::HERO_TRAININGBOT2:
return skCrypt("Tank Bot").decrypt();
case eHero::HERO_TRAININGBOT3:
return skCrypt("Sniper Bot").decrypt();
case eHero::HERO_TRAININGBOT4:
return skCrypt("Friend Bot").decrypt();
case eHero::HERO_TRAININGBOT5:
return skCrypt(u8"Friend Tank Bot").decrypt();
case eHero::HERO_TRAININGBOT6:
return skCrypt(u8"Rocket Bot").decrypt();
case eHero::HERO_TRAININGBOT7:
return skCrypt(u8"Training Bot").decrypt();
case eHero::HERO_LIFEWEAVER:
return skCrypt("LifeWeaver").decrypt();
case eHero::TOBTERT:
return skCrypt(u8"Tob").decrypt();
case eHero::SYMTERT:
return skCrypt(u8"Sym").decrypt();
case eHero::HERO_ILLARI:
return skCrypt(u8"Illari").decrypt();
case eHero::HERO_MAUGA:
return skCrypt(u8"Mauga").decrypt();
case eHero::Bob:
return skCrypt(u8"Bob").decrypt();
default:
return skCrypt(u8"Unknown").decrypt();
}
}
/*inline unsigned __int64 __fastcall DecryptVis(__int64 a1)
{
uint64_t v2;
uint64_t v3;
uint64_t v4;
uint64_t v5;
uint64_t v6;
uint64_t v7;
__m128i v8;
__m128i v9;
__m128i v10;
__m128i v11;
v2 = SDK->dwGameBase + 0x7A4552;
v3 = v2 + 0x8;
v4 = 0x0;
v5 = SDK->RPM<uint64_t>(SDK->dwGameBase + 0x3AA7180
+ 8 * (((uint8_t)a1 - 0x11) & 0x7F)
+ (((uint64_t)(a1 + 0x220329B4B2A3D7EF) >> 7) & 7)) ^ v2 ^ (a1 + 0x220329B4B2A3D7EF);
v6 = (v3 - v2 + 0x7) >> 0x3;
if (v2 > v3)
v6 = 0x0;
if (v6 && v6 >= 0x4)
{
v7 = v6 & 0xFFFFFFFFFFFFFFFC;
ZeroMemory(&v8, sizeof(v8));
ZeroMemory(&v9, sizeof(v9));
do
{
v4 += 0x4;
v8 = _mm_xor_si128(v8, _mm_loadu_si128((const __m128i*)v2));
v10 = _mm_loadu_si128((const __m128i*)(v2 + 0x10));
v2 += 0x20;
v9 = _mm_xor_si128(v9, v10);
} while (v4 < v7);
v11 = _mm_xor_si128(v8, v9);
v5 ^= _mm_xor_si128(v11, _mm_srli_si128(v11, 8)).m128i_u64[0];
}
for (; v2 < v3; v2 += 0x8)
v5 ^= SDK->RPM<uint64_t>(v2);
return v5 ^ ~v3 ^ 0x220329B4B2A3D7EF;
}
*/
/*inline uint64_t DecryptComponent(uint64_t parent, uint8_t idx)
{
__try {
if (parent)
{
unsigned __int64 v1 = parent;
unsigned __int64 v2 = (uint64_t)1 << (uint64_t)(idx & 0x3F);
unsigned __int64 v3 = v2 - 1;
unsigned __int64 v4 = idx & 0x3F;
unsigned __int64 v5 = idx / 0x3F;
unsigned __int64 v6 = SDK->RPM<uint64_t>(v1 + 8 * (uint32_t)v5 + 0xF0);
__int64 v7 = (v2 & SDK->RPM<uint64_t>(v1 + 8 * (uint32_t)v5 + 0xF0)) >> v4;
unsigned __int64 v8 = (v3 & v6) - (((v3 & v6) >> 1) & 0x5555555555555555);
unsigned __int64 v9 = SDK->RPM<uint64_t>(SDK->RPM<uint64_t>(v1 + 0x60) + 8 * (SDK->RPM<uint8_t>((uint32_t)v5 + v1 + 0x110) + ((0x101010101010101 * (((v8 & 0x3333333333333333) + ((v8 >> 2) & 0x3333333333333333) + (((v8 & 0x3333333333333333) + ((v8 >> 2) & 0x3333333333333333)) >> 4)) & 0xF0F0F0F0F0F0F0F)) >> 0x38)));
unsigned __int64 Key1 = SDK->GlobalKey1;
unsigned __int64 Key2 = SDK->GlobalKey2;
uint64_t d0 = (unsigned int)v9;
uint64_t d1 = (d0 | v9 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)(2
* __ROR4__(
SDK->RPM<uint64_t>(SDK->dwGameBase + 0x3711DE0
+ (Key1 & 0xFFF)),
3)
- (unsigned int)v9) << 0x20)) & 0xFFFFFFFF00000000ui64;
uint64_t d2 = (unsigned int)Key2 ^ ((unsigned int)v9 | (unsigned int)d1) | (Key2 ^ (d0 | d1 ^ ((unsigned __int64)(unsigned int)(d0 + 0x6E2D90B5) << 0x20))) & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)Key2 ^ ((unsigned int)v9 | (unsigned int)d1) ^ ~(unsigned int)SDK->RPM<uint64_t>(SDK->dwGameBase + 0x3711DE0 + (Key1 >> 0x34))) << 0x20);
uint64_t d3 = -(int)v7 & ((unsigned int)d2 | d2 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)d2 ^ (unsigned int)~HIDWORD(SDK->RPM<uint64_t>(SDK->dwGameBase + 0x3711DE0 + (Key1 & 0xFFF)))) << 0x20));
return d3;
}
}
__except (1) {
}
}*/
inline void sub_E8D1A0(_QWORD* a1, __int64* a2, __int64* a3, _DWORD* a4, uint8_t componentid)
{
*a1 = (uint64_t)1 << (uint64_t)(componentid & 0x3F);
*a2 = *a1 - 1;
*a3 = componentid;
*a4 = componentid / 0x3F;
}
/*inline uint64_t DecryptComponent(uint64_t parent, uint8_t componentid)
{
__try {
__int64 v15; // rbx
__int64 v16; // rsi
unsigned __int64 v17; // rdx
unsigned __int64 v18; // rsi
unsigned __int64 v19; // rax
__int64 v20; // rdi
__int64 v21; // r8
unsigned __int64 v22; // rdi
unsigned __int64 v23; // r8
unsigned __int64 v24; // [rsp+28h] [rbp-40h] BYREF
__int64 v25; // [rsp+30h] [rbp-38h] BYREF
unsigned __int64 v26; // [rsp+38h] [rbp-30h]
unsigned __int64 v27; // [rsp+40h] [rbp-28h] BYREF
__int64 v28; // [rsp+48h] [rbp-20h] BYREF
unsigned __int64 retaddr; // [rsp+68h] [rbp+0h]
unsigned int v30; // [rsp+78h] [rbp+10h] BYREF
__int64 v31; // [rsp+80h] [rbp+18h] BYREF
__int64 v32; // [rsp+88h] [rbp+20h]
v15 = parent;
sub_E8D1A0(&v27, &v28, &v31, &v30, componentid);
v16 = SDK->RPM<uint64_t>(v15 + 8i64 * v30 + 256);
v17 = v28 & v16;
v18 = (v27 & v16) >> v31;
v19 = ((v17 - ((v17 >> 1) & 0x5555555555555555i64)) & 0x3333333333333333i64)
+ (((v17 - ((v17 >> 1) & 0x5555555555555555i64)) >> 2) & 0x3333333333333333i64);
v20 = SDK->RPM<uintptr_t>((SDK->RPM<uint64_t>(v15 + 112)
+ 8
* (SDK->RPM<uint8_t>(v30 + v15 + 288)
+ ((0x101010101010101i64 * ((v19 + (v19 >> 4)) & 0xF0F0F0F0F0F0F0Fi64)) >> 56))));
v24 = SDK->GlobalKey1;
v25 = SDK->GlobalKey2;
unsigned __int64 decry1 = (unsigned int)v20;
unsigned __int64 decry2 = (decry1 | v20 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)v20 + 899132417) << 32)) & 0xFFFFFFFF00000000ui64;
unsigned __int64 decry3 = -(int)v18 & ((unsigned int)v25 ^ ((unsigned int)decry1 | (unsigned int)decry2) | ((unsigned int)v25 ^ ((unsigned int)decry1 | (unsigned int)decry2) | (v25 ^ (decry1 | decry2 ^ ((decry1 ^ HIDWORD(SDK->RPM<uintptr_t>(SDK->dwGameBase + 0x3779260 + (v24 >> 52)))) << 32))) & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)SDK->RPM<uintptr_t>(SDK->dwGameBase + 0x3779260 + (v24 & 0xFFF)) - ((unsigned int)v25 ^ ((unsigned int)decry1 | (unsigned int)decry2))) << 32)) & 0xFFFFFFFF00000000ui64 ^ (((unsigned int)v25 ^ ((unsigned int)decry1 | (unsigned int)decry2) ^ 0x4882DDEi64) << 32));
unsigned __int64 decry1,decry2,decry3;
decry3 = -(int)v18 & ((unsigned int)v25 ^ (unsigned int)v20 | ((unsigned int)v25 ^ (unsigned int)v20 | (v25 ^ ((unsigned int)v20 | ((unsigned int)v20 | v20 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)(389238746 - (unsigned int)v20) << 32)) & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)(unsigned int)(HIDWORD(SDK->RPM<uintptr_t>(SDK->dwGameBase + 0x3802420 + (v24 >> 52))) - v20) << 32))) & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)v25 ^ (unsigned int)v20 ^ ~(unsigned int)SDK->RPM<uintptr_t>(SDK->dwGameBase + 0x3802420 + (v24 & 0xFFF))) << 32)) & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)v25 ^ (unsigned int)v20 ^ 0xBDDE411B) << 32));
}
__except (EXCEPTION_EXECUTE_HANDLER) {
return 0;
}
}*/
inline uintptr_t DecryptComponent(uintptr_t parent, uint8_t idx) {
__try {
if (parent) {
unsigned __int64 v1 = parent;
unsigned __int64 v2 = (uintptr_t)1 << (uintptr_t)(idx & 0x3F);
unsigned __int64 v3 = v2 - 1;
unsigned __int64 v4 = idx & 0x3F;
unsigned __int64 v5 = idx / 0x3F;
unsigned __int64 v6 = SDK->RPM<uintptr_t>((v1 + 8 * (uint32_t)v5 + 0x110));
unsigned __int64 v7 = (v2 & SDK->RPM<uintptr_t>((v1 + 8 * (uint32_t)v5 + 0x110))) >> v4;
unsigned __int64 v8 = (v3 & v6) - (((v3 & v6) >> 1) & 0x5555555555555555);
unsigned __int64 v9 = SDK->RPM<uintptr_t>((SDK->RPM<uintptr_t>((v1 + 0x80)) + 8 * (SDK->RPM<uint8_t>(((uint32_t)v5 + v1 + 0x130)) + ((0x101010101010101 * (((v8 & 0x3333333333333333) + ((v8 >> 2) & 0x3333333333333333) + (((v8 & 0x3333333333333333) + ((v8 >> 2) & 0x3333333333333333)) >> 4)) & 0xF0F0F0F0F0F0F0F)) >> 0x38))));
unsigned __int64 Key1 = SDK->GlobalKey1;
unsigned __int64 Key2 = SDK->GlobalKey2;
auto dummy = SDK->RPM<_QWORD>(SDK->dwGameBase + 0x3807620 + (Key1 >> 0x34));
auto dummy2 = SDK->RPM<_QWORD>(SDK->dwGameBase + 0x3807620 + (Key1 & 0xFFF));
unsigned __int64 v10 = Key2 ^ ((unsigned int)v9 | ((unsigned int)v9 | v9 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)(unsigned int)(2 * __ROR4__(dummy, 3) - v9) << 0x20)) & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)(__ROR4__(HIDWORD(dummy2), 0xB) ^ (unsigned int)~(_DWORD)v9) << 0x20));
unsigned __int64 v11 = (unsigned int)v10 | v10 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)v10 ^ 0x281677CD) << 0x20);
unsigned __int64 v12 = -(int)v7 & (unsigned __int64)((unsigned int)v11 | v11 & 0xFFFFFFFF00000000ui64 ^ ((unsigned __int64)((unsigned int)v10 ^ HIDWORD(dummy)) << 0x20));
return v12;
}
}
__except (EXCEPTION_EXECUTE_HANDLER) {}
return NULL;
}
/*void sub_21964C0(_QWORD* a1, __int64* a2, int* a3, _DWORD* a4, uint8_t componentid)
{
*a1 = (uint64_t)1 << (uint64_t)(componentid & 0x3F);
*a2 = *a1 - 1;
*a3 = componentid;
*a4 = componentid / 0x3F;
}*/
inline unsigned __int64 __fastcall DecryptVis(__int64 a1) {
__int64 v1; // rsi
unsigned __int64 v2; // rbx
unsigned __int64 v3; // r9
__int64 v4; // rsi
unsigned __int64 v5; // rdx
unsigned __int64 v6; // rcx
__m128i v7; // xmm1
__m128i v8; // xmm2
__m128i v9; // xmm0
__m128i v10; // xmm1
v1 = a1;
v2 = SDK->dwGameBase + offset::VisFN;
v3 = v2 + 0x8;
v4 = SDK->RPM<uint64_t>(SDK->dwGameBase + 0x3808640
+ 8 * (((uint8_t)a1 + 0x5A) & 0x7F)
+ (((uint64_t)(a1 + offset::Vis_Key) >> 7) & 7)) ^ v2 ^ (a1 + offset::Vis_Key);
v5 = (v3 - v2 + 7) >> 3;
v6 = 0i64;
if (v2 > v3)
v5 = 0i64;
if (v5) {
if (v5 >= 4) {
ZeroMemory(&v7, sizeof(v7));
ZeroMemory(&v8, sizeof(v8));
do {
v6 += 4i64;
v7 = _mm_xor_si128(v7, _mm_loadu_si128((const __m128i*)v2));
v9 = _mm_loadu_si128((const __m128i*)(v2 + 16));
v2 += 32i64;
v8 = _mm_xor_si128(v8, v9);
} while (v6 < (v5 & 0xFFFFFFFFFFFFFFFCui64));
v10 = _mm_xor_si128(v7, v8);
auto addr = _mm_xor_si128(v10, _mm_srli_si128(v10, 8));
v4 ^= *(__int64*)&addr;
}
}
for (; v6 < v5; ++v6) {
v4 ^= SDK->RPM<uint64_t>(v2);
v2 += 8i64;
}
return v4 ^ ~v3 ^ offset::Vis_Key;
}
uintptr_t GetHeapManager(uint8_t index) {
uintptr_t v0 = SDK->RPM<uintptr_t>(SDK->dwGameBase + offset::HeapManager);
if (v0 != 0) {
uintptr_t v1 = SDK->RPM<uintptr_t>(v0 + offset::HeapManager_Pointer) ^ (offset::HeapManager_Key - SDK->RPM<uintptr_t>(SDK->dwGameBase + offset::HeapManager_Var));
//uintptr_t v1 = SDK->RPM<uintptr_t>(v0 + offset::HeapManager_Pointer) ^ (SDK->RPM<uintptr_t>(SDK->dwGameBase + offset::HeapManager_Var), 12)^ offset::HeapManager_Key;
//uintptr_t v1 = SDK->RPM<uintptr_t>(SDK->dwGameBase + offset::HeapManager_Var) ^ SDK->RPM<uintptr_t>(v0 + offset::HeapManager_Pointer) ^ offset::HeapManager_Key;
//uintptr_t v1 = SDK->RPM<uintptr_t>(v0 + offset::HeapManager_Pointer) ^ (_rotl64(SDK->RPM<uintptr_t>(SDK->dwGameBase + offset::HeapManager_Var), 0xA) - offset::HeapManager_Key);
if (v1 != 0) {
uintptr_t v2 = SDK->RPM<uintptr_t>(v1 + 0x8 * index);
return v2;
}
}
return NULL;
}
inline uintptr_t GetSenstivePTR() {
uintptr_t heap = GetHeapManager(6);
if (heap) {
return heap + offset::SensitivePtr;
}
return NULL;
}
inline std::vector<std::pair<uint64_t, uint64_t>> get_ow_entities()
{
std::vector<std::pair<uint64_t, uint64_t>> result;
struct Entity {
uint64_t entity;
uint64_t pad;
};
uintptr_t entity_list = SDK->RPM<uint64_t>(SDK->dwGameBase + offset::Address_entity_base);
MEMORY_BASIC_INFORMATION mbi{};
VirtualQueryEx(SDK->hProcess, (LPCVOID)entity_list, &mbi, sizeof(mbi));
SIZE_T entity_list_size = mbi.RegionSize / sizeof(Entity);
Entity* raw_list = new Entity[entity_list_size];
if (ReadProcessMemory(SDK->hProcess, (LPCVOID)entity_list, raw_list, mbi.RegionSize, nullptr))
{
for (size_t i = 0; i < entity_list_size; ++i)
{
uint64_t cur_entity = raw_list[i].entity;
if (cur_entity)
{
uint64_t common_linker = DecryptComponent(cur_entity, TYPE_LINK);
//printf("LINK:%llx\n", common_linker);
if (common_linker)
{
uint32_t unique_id = SDK->RPM<uint32_t>(common_linker + 0xD4);
//printf("unique_id:%llx\n", unique_id);
for (size_t x = 0; x < entity_list_size; ++x)
{
uint64_t possible_common = raw_list[x].entity;
if (possible_common && SDK->RPM<uint32_t>(possible_common + 0x138) == unique_id)
{
//printf("%llx", unique_id);
result.emplace_back(possible_common, cur_entity);
break;
}
else {
uint64_t Ptr = SDK->RPM<uint64_t>(possible_common + 0x30) & 0xFFFFFFFFFFFFFFC0;
if (Ptr < 0xFFFFFFFFFFFFFFEF) {
uint64_t EntityID = SDK->RPM<uint64_t>(Ptr + 0x10);
if (EntityID == 0x400000000000060 || EntityID == 0x40000000000480A || EntityID == 0x40000000000005F || EntityID == 0x400000000002533) {
result.emplace_back(possible_common, cur_entity);
}
}
}
}
}
}
}
}
delete[] raw_list;
return result;
}
inline bool IsSkillActive(uint64_t base, uint16_t index, uint16_t id)
{
if (id == 0)
return false;
uintptr_t skillList = 0;
if (index == 0)
{
// Use the default skill list for index 0
skillList = base + 0x570;
}
else
{
// Get the skill list for the given index
uint32_t count = SDK->RPM<uint32_t>(base + 0x378);
if (count <= 0 || count >= 0xFF)
return false;
uintptr_t entry = SDK->RPM<uintptr_t>(base + 0x370);
if (!entry)
return false;
for (uint32_t i = 0; i < count; i++, entry += 0x10)
{
if (SDK->RPM<uint16_t>(entry + 0x8) == index)
{
uintptr_t listStruct = SDK->RPM<uintptr_t>(entry);
if (!listStruct)
return false;
skillList = SDK->RPM<uintptr_t>(listStruct + 0xA8);
break;
}
}
}
if (!skillList)
return false;
// Get the skill entry from the list using the skill id
uintptr_t listEntry = skillList + 0x20 * ((id & 0xF) + 1);
uintptr_t structList = SDK->RPM<uintptr_t>(listEntry);
if (!structList)
return false;
int32_t listIndex = index == 0 ? 0 : SDK->RPM<int32_t>(listEntry + 0x8) - 1;
if (listIndex < 0 || listIndex >= 0xFF)
return false;
uintptr_t skillEntry = structList + 0x10 * listIndex;
if (SDK->RPM<uint16_t>(skillEntry) == id)
{
uintptr_t skill = SDK->RPM<uintptr_t>(skillEntry + 0x8);
if (!skill)
return false;
return SDK->RPM<uint8_t>(skill + 0x48) == 1;
}
return false;
}
inline float SkillCD(uint64_t base, uint16_t index, uint16_t id)
{
if (id == 0)
return false;
uintptr_t skillList = 0;
if (index == 0)
{
// Use the default skill list for index 0
skillList = base + 0x570;
}
else
{
// Get the skill list for the given index
uint32_t count = SDK->RPM<uint32_t>(base + 0x378);
if (count <= 0 || count >= 0xFF)
return false;
uintptr_t entry = SDK->RPM<uintptr_t>(base + 0x370);
if (!entry)
return false;
for (uint32_t i = 0; i < count; i++, entry += 0x10)
{
if (SDK->RPM<uint16_t>(entry + 0x8) == index)
{
uintptr_t listStruct = SDK->RPM<uintptr_t>(entry);
if (!listStruct)
return false;
skillList = SDK->RPM<uintptr_t>(listStruct + 0xA8);
break;
}
}
}
if (!skillList)
return false;
// Get the skill entry from the list using the skill id
uintptr_t listEntry = skillList + 0x20 * ((id & 0xF) + 1);
uintptr_t structList = SDK->RPM<uintptr_t>(listEntry);
if (!structList)
return false;
int32_t listIndex = SDK->RPM<int32_t>(listEntry + 0x8) - 1;
if (listIndex < 0 || listIndex >= 0xFF)
return false;
uintptr_t skillEntry = structList + 0x10 * listIndex;
if (SDK->RPM<uint16_t>(skillEntry) == id)
{
uintptr_t skill = SDK->RPM<uintptr_t>(skillEntry + 0x8);
if (!skill)
return false;
return SDK->RPM<float>(skill + 0x60);
}
return false;
}
inline uintptr_t SkillStructCheck(uint64_t a1, uint16_t a2)
{
__int64 v2; // r8
__int64 i; // rax
if (SDK->RPM<uint32_t>(a1 + 0x2A8) <= 0)
return 0i64;
v2 = 0i64;
for (i = SDK->RPM<uintptr_t>(a1 + 0x2A0); SDK->RPM<uint16_t>(i + 8) != a2; i += 16i64)
{
if (++v2 >= SDK->RPM<uint32_t>(a1 + 0x2A8))
return 0i64;
}
return SDK->RPM<uintptr_t>(i);
}
inline uint64_t FnSkillStruct(__m128* a1, uint16_t* a2)
{
__int64 v2; // rbx
uint16_t* v3;
__int16 v4; // dx
__int64 v5; // rcx
__int64 v6; // r9
__int64 v7; // rax
unsigned __int16 v8; // r8
__int64 v9; // rdx
int v10; // eax
__int64 v11; // rcx
__int64 v12; // rax
__int64 v13; // rdi
v2 = 0i64;
v3 = a2;
if (!a2[1])
return 0i64;
v4 = *a2;
v5 = a1->m128_i64[1];
if (!v4)
{
v6 = v5 + 0x4A0;
goto LABEL_6;
}
v7 = SkillStructCheck(v5, v4);
if (!v7)
return 0i64;
v6 = SDK->RPM<uintptr_t>(v7 + 168);
LABEL_6:
v8 = v3[1];
v9 = 32 * ((v3[1] & 0xF) + 1i64);
v10 = SDK->RPM<uint32_t>(v9 + v6 + 8) - 1;
if (v10 < 0)
return 0x0;
v11 = v10;
v12 = SDK->RPM<uintptr_t>(v9 + v6) + 16i64 * v10;
while (SDK->RPM<uint16_t>(v12) != v8)
{
v12 -= 16i64;
if (--v11 < 0)
return 0x0;
}
v13 = SDK->RPM<uintptr_t>(v12 + 8);
if (!v13)
return 0x0;
if (*((uint32_t*)v3 + 4) <= 0)
return v13;
return v13;
}
inline bool IsSkillActivate1(uint64_t base, uint16_t skillIdx, uint16_t skillIdx2)
{
__m128 skillStruct{};
uint16_t skillId[15] = { skillIdx, skillIdx2 };
skillStruct.m128_u64[1] = base + 0xD0;
uint64_t skill = FnSkillStruct(&skillStruct, skillId);
bool ret = SDK->RPM<uint8_t>(skill + 0x48) == 1;
if (!skill)
return false;
return ret;
}
inline float readskillcd(uint64_t base, uint16_t skillIdx, uint16_t skillIdx2)
{
__m128 skillStruct{};
uint16_t skillId[15] = { skillIdx, skillIdx2 };
skillStruct.m128_u64[1] = base + 0xD0;
uint64_t skill = FnSkillStruct(&skillStruct, skillId);
if (!skill)
return false;
float ret = SDK->RPM<float>(skill + 0x48);
if (!ret) return ret;
ret = SDK->RPM<float>(skill + 0x60);
if (ret != 0)
return ret;
else return 1;
}
inline float readult(uint64_t base, uint16_t skillIdx, uint16_t skillIdx2)
{
__m128 skillStruct{};
uint16_t skillId[15] = { skillIdx, skillIdx2 };
skillStruct.m128_u64[1] = base + 0xD0;
uint64_t skill = FnSkillStruct(&skillStruct, skillId);
if (!skill)
return false;
float ret = SDK->RPM<float>(skill + 0x60);
return ret;
}
inline float cdready(uint64_t base, uint16_t skillIdx, uint16_t skillIdx2)
{
__m128 skillStruct{};
uint16_t skillId[15] = { skillIdx, skillIdx2 };
skillStruct.m128_u64[1] = base + 0xD0;
uint64_t skill = FnSkillStruct(&skillStruct, skillId);
if (!skill)
return false;
float ret = SDK->RPM<float>(skill + 0x48);
return ret;
}
inline uint64_t GetOutlineStruct(uint64_t a1)
{
__try
{
uint64_t result = NULL;
int v1 = SDK->RPM<uint32_t>(a1 + 0x68);
if (v1 <= 0)
result = 0;
else
result = (uint64_t)(0x20 * v1 + SDK->RPM<uint64_t>(a1 + 0x60) - 0x20);
return result;
}
__except (EXCEPTION_EXECUTE_HANDLER) {}
return NULL;
}
uint64_t GetThickNessStruct(uint64_t a1)
{
__try
{
uint64_t result = NULL;
int v1 = SDK->RPM<uint32_t>(a1 + 0x1C8);
if (v1 <= 0)
result = 0;
else
result = (uint64_t)(0x14 * v1 + SDK->RPM<uint64_t>(a1 + 0x1C0) - 0x14);
return result;
}
__except (EXCEPTION_EXECUTE_HANDLER) {}
return NULL;
}
int64_t DecryptOutline(uint64_t a1)
{
unsigned __int64 v2 = 0; // rdi
unsigned __int64 v3 = 0; // r8
unsigned __int64 v4 = 0; // rax
__int64 v5 = 0; // rbx
unsigned __int64 v6 = 0; // rcx
unsigned __int64 v7 = 0; // rcx
__m128i v8; // xmm1
__m128i v9; // xmm2
__m128i v10; // xmm0
__m128i v11; // xmm1
v2 = (SDK->dwGameBase + offset::OutlineFN);
v3 = v2 + 0x8;
v4 = 0i64;
v5 = SDK->RPM<uint64_t>(SDK->dwGameBase + 0x3808640
+ 8ull * (((unsigned __int8)a1 + 0x31) & 0x7F)
+ (((unsigned __int64)(a1 - offset::OutLine_Key) >> 7) & 7)) ^ v2 ^ (a1 - offset::OutLine_Key);
v6 = (v3 - v2 + 7) >> 3;
if (v2 > v3)
v6 = 0i64;
if (v6 >= 4)
{
v7 = v6 & 0xFFFFFFFFFFFFFFFCui64;
ZeroMemory(&v8, sizeof(v8));
ZeroMemory(&v9, sizeof(v9));
do
{
v4 += 4i64;
v8 = _mm_xor_si128(v8, _mm_loadu_si128((const __m128i*)v2));
v10 = _mm_loadu_si128((const __m128i*)(v2 + 0x10));
v2 += 0x20i64;
v9 = _mm_xor_si128(v9, v10);
} while (v4 < v7);
v11 = _mm_xor_si128(v8, v9);
auto addr = _mm_xor_si128(v11, _mm_srli_si128(v11, 8));
v5 = *(__int64*)&addr;
}
for (; v2 < v3; v2 += 8i64)
v5 ^= SDK->RPM<uint64_t>(v2);
return v5 ^ ~v3 ^ 0xDF9DC69B9E06D531ui64;
}
inline void SetBorderLine(uint32_t BorderType, DWORD_PTR base)
{
uint64_t BorderStruct = GetOutlineStruct((uint64_t)(base + 0x20)); // 0x5A Components + 0x20
uint64_t DecryptData = DecryptOutline(SDK->RPM<uint64_t>(BorderStruct + 0x18));
SDK->WPM<uint32_t>(BorderStruct + 0x10, (DecryptData ^ BorderType));
}
}