-
Notifications
You must be signed in to change notification settings - Fork 3
/
archive.txt
3405 lines (3270 loc) · 102 KB
/
archive.txt
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
//
//#include "f4se/GameMenus.h"
//class UIStringHolder
//{
// struct StringItem
// {
// BSFixedString name;
// UInt32 isInit;
// };
// StringItem barterMenu; //BarterMenu
// StringItem bookMenu;
// StringItem BSOverlayMenu;
// StringItem buttonBarMenu;
// StringItem buttonBarWidget;
// StringItem closeMenu;
// StringItem closingAllMenus;
// StringItem console;
// StringItem consoleNativeUIMenu;
// StringItem containerMenu;
// StringItem cookingMenu;
// StringItem craftingMenu;
// StringItem creditsMenu;
// StringItem cursorMenu;
// StringItem debugTextMenu;
// StringItem dialogueHideButtons;
// StringItem dialogueInDialogueCamera;
// StringItem dialogueLookingAtSpeaker;
// StringItem dialogueMenu;
// StringItem dialogueSetButtonText;
// StringItem dialogueShowButtons;
// StringItem dialogueShowSpeechChallenge;
// StringItem examineConfirmMenu;
// StringItem examineMenu;
// StringItem examineMenuItem3D;
// StringItem faderMenu;
// StringItem favoritesMenu;
// StringItem flatScreenModel;
// StringItem floatingQuestMarkers;
// StringItem genericMenu;
// StringItem graphWidget;
// StringItem hudCamData;
// StringItem hudMenu;
// StringItem hudScreenModel;
// StringItem inventoryMenu;
// StringItem journalSettingsSaved;
// StringItem kinectMenu;
// StringItem levelUpMenu;
// StringItem loadingMenu;
// StringItem loadingMenuFadeIn;
// StringItem loadingMenuNewLocation;
// StringItem lockpickingMenu;
// StringItem lockpickingMenu3D;
// StringItem looksMenu;
// StringItem magicMenu;
// StringItem mainMenu;
// StringItem mapMenu;
// StringItem menuTextureDegradeEvent;
// StringItem messageBoxMenu;
// StringItem multiActiveMenu;
// StringItem noMenu;
// StringItem onPipboyOpening;
// StringItem pauseMenu;
// StringItem pauseMenuBackOutFromLoadGame;
// StringItem pipboyHolotapeMenu;
// StringItem pipboyMenu;
// StringItem pipboyOpeningSequenceMenu;
// StringItem playBinkMenu;
// StringItem powerArmorHUDMenu;
// StringItem powerArmorModMenu;
// StringItem previousMod;
// StringItem previousSelect;
// StringItem promptMenu;
// StringItem quantityData;
// StringItem quantityMenu;
// StringItem raseSexMenu;
// StringItem refreshMenu;
// StringItem scopeMenu;
// StringItem showJournal;
// StringItem sitWaitMenu;
// StringItem sleepWaitMenu;
// StringItem soundMenuCancel;
// StringItem soundMenuOK;
// StringItem specialMenu;//SPECIALMenu
// StringItem statsMenu;
// StringItem streamingInstallMenu;
// StringItem terminalHolotapeMenu;
// StringItem terminalMenu;
// StringItem terminalRenderOverride;
// StringItem textureWidght;
// StringItem textWidget;
// StringItem titleSequenceMenu;
// StringItem topMenu;
// StringItem tutorialMenu;
// StringItem tweenMenu;
// StringItem vatsMenu;
// StringItem vertibirdMenu;
// StringItem vignetteMenu;
// StringItem voiceHolotape;
// StringItem workshopCaravanMenu;
// StringItem workshopMeScreenModel;
// float unk;
// //64F8670 - 64F8C30
// //sub_2027800(v24, 3i64, v25); CloseMenu;
// //sub_2027340 scaleform
// // LODWORD(v4) = sub_B67220(off_585BD48, v9, v8, &v13); AddMessage flexMakeShapeFlags
//int __fastcall sub_D263F0(__int64 a1, unsigned int a2, __int64 a3, __int64 a4) WNDPROC
//sub_2024830 CloseMenu
//};
/*
*/
/*
1> IDXGISwapChain::$vftable@:
1> | &IDXGISwapChain_meta
1> | 0
1> 0 | &IUnknown::QueryInterface
1> 1 | &IUnknown::AddRef
1> 2 | &IUnknown::Release
1> 3 | &IDXGIObject::SetPrivateData
1> 4 | &IDXGIObject::SetPrivateDataInterface
1> 5 | &IDXGIObject::GetPrivateData
1> 6 | &IDXGIObject::GetParent
1> 7 | &IDXGIDeviceSubObject::GetDevice
1> 8 | &IDXGISwapChain::Present
1> 9 | &IDXGISwapChain::GetBuffer
1> 10 | &IDXGISwapChain::SetFullscreenState
1> 11 | &IDXGISwapChain::GetFullscreenState
1> 12 | &IDXGISwapChain::GetDesc
1> 13 | &IDXGISwapChain::ResizeBuffers
1> 14 | &IDXGISwapChain::ResizeTarget
1> 15 | &IDXGISwapChain::GetContainingOutput
1> 16 | &IDXGISwapChain::GetFrameStatistics
1> 17 | &IDXGISwapChain::GetLastPresentCount
1> ID3D11Device::$vftable@:
1> | &ID3D11Device_meta
1> | 0
1> 0 | &IUnknown::QueryInterface
1> 1 | &IUnknown::AddRef
1> 2 | &IUnknown::Release
1> 3 | &ID3D11Device::CreateBuffer
1> 4 | &ID3D11Device::CreateTexture1D
1> 5 | &ID3D11Device::CreateTexture2D
1> 6 | &ID3D11Device::CreateTexture3D
1> 7 | &ID3D11Device::CreateShaderResourceView
1> 8 | &ID3D11Device::CreateUnorderedAccessView
1> 9 | &ID3D11Device::CreateRenderTargetView
1> 10 | &ID3D11Device::CreateDepthStencilView
1> 11 | &ID3D11Device::CreateInputLayout
1> 12 | &ID3D11Device::CreateVertexShader
1> 13 | &ID3D11Device::CreateGeometryShader
1> 14 | &ID3D11Device::CreateGeometryShaderWithStreamOutput
1> 15 | &ID3D11Device::CreatePixelShader
1> 16 | &ID3D11Device::CreateHullShader
1> 17 | &ID3D11Device::CreateDomainShader
1> 18 | &ID3D11Device::CreateComputeShader
1> 19 | &ID3D11Device::CreateClassLinkage
1> 20 | &ID3D11Device::CreateBlendState
1> 21 | &ID3D11Device::CreateDepthStencilState
1> 22 | &ID3D11Device::CreateRasterizerState
1> 23 | &ID3D11Device::CreateSamplerState
1> 24 | &ID3D11Device::CreateQuery
1> 25 | &ID3D11Device::CreatePredicate
1> 26 | &ID3D11Device::CreateCounter
1> 27 | &ID3D11Device::CreateDeferredContext
1> 28 | &ID3D11Device::OpenSharedResource
1> 29 | &ID3D11Device::CheckFormatSupport
1> 30 | &ID3D11Device::CheckMultisampleQualityLevels
1> 31 | &ID3D11Device::CheckCounterInfo
1> 32 | &ID3D11Device::CheckCounter
1> 33 | &ID3D11Device::CheckFeatureSupport
1> 34 | &ID3D11Device::GetPrivateData
1> 35 | &ID3D11Device::SetPrivateData
1> 36 | &ID3D11Device::SetPrivateDataInterface
1> 37 | &ID3D11Device::GetFeatureLevel
1> 38 | &ID3D11Device::GetCreationFlags
1> 39 | &ID3D11Device::GetDeviceRemovedReason
1> 40 | &ID3D11Device::GetImmediateContext
1> 41 | &ID3D11Device::SetExceptionMode
1> 42 | &ID3D11Device::GetExceptionMode
1> ID3D11DeviceContext::$vftable@:
1> | &ID3D11DeviceContext_meta
1> | 0
1> 0 | &IUnknown::QueryInterface
1> 1 | &IUnknown::AddRef
1> 2 | &IUnknown::Release
1> 3 | &ID3D11DeviceChild::GetDevice
1> 4 | &ID3D11DeviceChild::GetPrivateData
1> 5 | &ID3D11DeviceChild::SetPrivateData
1> 6 | &ID3D11DeviceChild::SetPrivateDataInterface
1> 7 | &ID3D11DeviceContext::VSSetConstantBuffers
1> 8 | &ID3D11DeviceContext::PSSetShaderResources
1> 9 | &ID3D11DeviceContext::PSSetShader
1> 10 | &ID3D11DeviceContext::PSSetSamplers
1> 11 | &ID3D11DeviceContext::VSSetShader
1> 12 | &ID3D11DeviceContext::DrawIndexed
1> 13 | &ID3D11DeviceContext::Draw
1> 14 | &ID3D11DeviceContext::Map
1> 15 | &ID3D11DeviceContext::Unmap
1> 16 | &ID3D11DeviceContext::PSSetConstantBuffers
1> 17 | &ID3D11DeviceContext::IASetInputLayout
1> 18 | &ID3D11DeviceContext::IASetVertexBuffers
1> 19 | &ID3D11DeviceContext::IASetIndexBuffer
1> 20 | &ID3D11DeviceContext::DrawIndexedInstanced
1> 21 | &ID3D11DeviceContext::DrawInstanced
1> 22 | &ID3D11DeviceContext::GSSetConstantBuffers
1> 23 | &ID3D11DeviceContext::GSSetShader
1> 24 | &ID3D11DeviceContext::IASetPrimitiveTopology
1> 25 | &ID3D11DeviceContext::VSSetShaderResources
1> 26 | &ID3D11DeviceContext::VSSetSamplers
1> 27 | &ID3D11DeviceContext::Begin
1> 28 | &ID3D11DeviceContext::End
1> 29 | &ID3D11DeviceContext::GetData
1> 30 | &ID3D11DeviceContext::SetPredication
1> 31 | &ID3D11DeviceContext::GSSetShaderResources
1> 32 | &ID3D11DeviceContext::GSSetSamplers
1> 33 | &ID3D11DeviceContext::OMSetRenderTargets
1> 34 | &ID3D11DeviceContext::OMSetRenderTargetsAndUnorderedAccessViews
1> 35 | &ID3D11DeviceContext::OMSetBlendState
1> 36 | &ID3D11DeviceContext::OMSetDepthStencilState
1> 37 | &ID3D11DeviceContext::SOSetTargets
1> 38 | &ID3D11DeviceContext::DrawAuto
1> 39 | &ID3D11DeviceContext::DrawIndexedInstancedIndirect
1> 40 | &ID3D11DeviceContext::DrawInstancedIndirect
1> 41 | &ID3D11DeviceContext::Dispatch
1> 42 | &ID3D11DeviceContext::DispatchIndirect
1> 43 | &ID3D11DeviceContext::RSSetState
1> 44 | &ID3D11DeviceContext::RSSetViewports
1> 45 | &ID3D11DeviceContext::RSSetScissorRects
1> 46 | &ID3D11DeviceContext::CopySubresourceRegion
1> 47 | &ID3D11DeviceContext::CopyResource
1> 48 | &ID3D11DeviceContext::UpdateSubresource
1> 49 | &ID3D11DeviceContext::CopyStructureCount
1> 50 | &ID3D11DeviceContext::ClearRenderTargetView
1> 51 | &ID3D11DeviceContext::ClearUnorderedAccessViewUint
1> 52 | &ID3D11DeviceContext::ClearUnorderedAccessViewFloat
1> 53 | &ID3D11DeviceContext::ClearDepthStencilView
1> 54 | &ID3D11DeviceContext::GenerateMips
1> 55 | &ID3D11DeviceContext::SetResourceMinLOD
1> 56 | &ID3D11DeviceContext::GetResourceMinLOD
1> 57 | &ID3D11DeviceContext::ResolveSubresource
1> 58 | &ID3D11DeviceContext::ExecuteCommandList
1> 59 | &ID3D11DeviceContext::HSSetShaderResources
1> 60 | &ID3D11DeviceContext::HSSetShader
1> 61 | &ID3D11DeviceContext::HSSetSamplers
1> 62 | &ID3D11DeviceContext::HSSetConstantBuffers
1> 63 | &ID3D11DeviceContext::DSSetShaderResources
1> 64 | &ID3D11DeviceContext::DSSetShader
1> 65 | &ID3D11DeviceContext::DSSetSamplers
1> 66 | &ID3D11DeviceContext::DSSetConstantBuffers
1> 67 | &ID3D11DeviceContext::CSSetShaderResources
1> 68 | &ID3D11DeviceContext::CSSetUnorderedAccessViews
1> 69 | &ID3D11DeviceContext::CSSetShader
1> 70 | &ID3D11DeviceContext::CSSetSamplers
1> 71 | &ID3D11DeviceContext::CSSetConstantBuffers
1> 72 | &ID3D11DeviceContext::VSGetConstantBuffers
1> 73 | &ID3D11DeviceContext::PSGetShaderResources
1> 74 | &ID3D11DeviceContext::PSGetShader
1> 75 | &ID3D11DeviceContext::PSGetSamplers
1> 76 | &ID3D11DeviceContext::VSGetShader
1> 77 | &ID3D11DeviceContext::PSGetConstantBuffers
1> 78 | &ID3D11DeviceContext::IAGetInputLayout
1> 79 | &ID3D11DeviceContext::IAGetVertexBuffers
1> 80 | &ID3D11DeviceContext::IAGetIndexBuffer
1> 81 | &ID3D11DeviceContext::GSGetConstantBuffers
1> 82 | &ID3D11DeviceContext::GSGetShader
1> 83 | &ID3D11DeviceContext::IAGetPrimitiveTopology
1> 84 | &ID3D11DeviceContext::VSGetShaderResources
1> 85 | &ID3D11DeviceContext::VSGetSamplers
1> 86 | &ID3D11DeviceContext::GetPredication
1> 87 | &ID3D11DeviceContext::GSGetShaderResources
1> 88 | &ID3D11DeviceContext::GSGetSamplers
1> 89 | &ID3D11DeviceContext::OMGetRenderTargets
1> 90 | &ID3D11DeviceContext::OMGetRenderTargetsAndUnorderedAccessViews
1> 91 | &ID3D11DeviceContext::OMGetBlendState
1> 92 | &ID3D11DeviceContext::OMGetDepthStencilState
1> 93 | &ID3D11DeviceContext::SOGetTargets
1> 94 | &ID3D11DeviceContext::RSGetState
1> 95 | &ID3D11DeviceContext::RSGetViewports
1> 96 | &ID3D11DeviceContext::RSGetScissorRects
1> 97 | &ID3D11DeviceContext::HSGetShaderResources
1> 98 | &ID3D11DeviceContext::HSGetShader
1> 99 | &ID3D11DeviceContext::HSGetSamplers
1> 100 | &ID3D11DeviceContext::HSGetConstantBuffers
1> 101 | &ID3D11DeviceContext::DSGetShaderResources
1> 102 | &ID3D11DeviceContext::DSGetShader
1> 103 | &ID3D11DeviceContext::DSGetSamplers
1> 104 | &ID3D11DeviceContext::DSGetConstantBuffers
1> 105 | &ID3D11DeviceContext::CSGetShaderResources
1> 106 | &ID3D11DeviceContext::CSGetUnorderedAccessViews
1> 107 | &ID3D11DeviceContext::CSGetShader
1> 108 | &ID3D11DeviceContext::CSGetSamplers
1> 109 | &ID3D11DeviceContext::CSGetConstantBuffers
1> 110 | &ID3D11DeviceContext::ClearState
1> 111 | &ID3D11DeviceContext::Flush
1> 112 | &ID3D11DeviceContext::GetType
1> 113 | &ID3D11DeviceContext::GetContextFlags
1> 114 | &ID3D11DeviceContext::FinishCommandList
*/
//WPARAM param = wParam;
//RelocAddr<bool*> isInputEnabled = 0x371E5E8;
//if (*isInputEnabled && *g_inputDeviceMgr)
//{
// char sName[8] = { 0x0 };
// if (GetKeyboardLayoutName(sName))
// {
// char* pTerminal = sName + 8;
// long iName = strtol(sName, &pTerminal, 0x10);
// char sResult[0x8] = { 0x0 };
// GetLocaleInfo(iName, 0x1004, sResult, 8);//Singopore
// int codePage = atoi(sResult);
// UInt8 code = static_cast<UInt8>(wParam);
// wchar_t sWChar[1];
// MultiByteToWideChar(codePage, MB_ERR_INVALID_CHARS, (char*)&code, 1, sWChar, 1);
// param = *reinterpret_cast<UInt16*>(sWChar);
// }
//}
RelocAddr<bool*> isInputEnabled = 0x371E5E8;
if (*g_inputDeviceMgr && *isInputEnabled)
{
#ifdef _DEBUG
_MESSAGE("[CHAR] wParam: %016I64X lParam: %016I64X", wParam, lParam);
#endif // _DEBUG
RelocAddr<void(*)(BSPCKeyboardDevice*, WPARAM, LPARAM)> fnProcessCharEvent = 0x01B11760;
fnProcessCharEvent((*g_inputDeviceMgr)->keyboardDevice, wParam, 0);
}
case WM_CREATE:
pWinHook = SetWindowsHookEx(WH_KEYBOARD_LL, [](int nCode, WPARAM wParam, LPARAM lParam)->LRESULT
{
if (nCode < 0 || nCode != HC_ACTION) // do not process message
return CallNextHookEx(pWinHook, nCode, wParam, lParam);
KBDLLHOOKSTRUCT* p = (KBDLLHOOKSTRUCT*)lParam;
switch (wParam)
{
case WM_KEYDOWN:
case WM_SYSKEYDOWN:
case WM_KEYUP:
case WM_SYSKEYUP:
switch (p->vkCode)
{
case VK_LWIN:
case VK_RWIN:
{
}
}
break;
}
return CallNextHookEx(pWinHook, nCode, wParam, lParam);
}, ((LPCREATESTRUCT)lParam)->hInstance, 0);
break;
case WM_DESTROY:
if (pWinHook != nullptr)
{
UnhookWindowsHookEx(pWinHook);
}
break;
//g_criticalSection.Enter();
//pFontWrapper->DrawString
//(
// pImmediateContext,
// pInputMenu->inputStateInfo.c_str(),// String
// 24.0f,// Font size
// 1280 / 2.0f,// X offset
// 300 / 2.0f,// Y offset
// 0x800099FF,// Text color, 0xAaBbGgRr
// FW1_LEFT | FW1_TOP// Flags
//);
//FW1_RECTF textRect = { 640, 350, 1040, 400};
////FW1_RECTF sizeRect = pFontWrapper->MeasureString(pInputMenu->tempContent.c_str(), L"Arial", 64.0f, &textRect, FW1_LEFT | FW1_VCENTER | FW1_NOWORDWRAP | FW1_CLIPRECT);
//pRectDrawer->DrawRect(pImmediateContext, textRect.Left, textRect.Top, textRect.Right, textRect.Bottom, 0xFFFF9911);
//pFontWrapper->DrawString(pImmediateContext, pInputMenu->compositionContent.c_str(), L"Arial", 24.0f, &textRect, 0xFFFFFFFF, &textRect, NULL, FW1_LEFT | FW1_VCENTER | FW1_NOWORDWRAP | FW1_CLIPRECT);
//g_criticalSection.Leave();
#include <fstream>
#include <sstream>
int __do_write(std::stringstream& ss, uintptr_t addr, uintptr_t * skip, bool full, bool& wrote)
{
char buf[64];
int failed = 0;
__try
{
uintptr_t val = *((uintptr_t*)addr);
if (full || (addr >= ((uintptr_t)GetModuleHandle(NULL) + 0x1000) && addr <= ((uintptr_t)GetModuleHandle(NULL) + 0x2BC2000)))
{
if (skip)
{
for (int i = 0; skip[i] != 0; i++)
{
if (val == skip[i])
{
failed = -1;
break;
}
}
}
if (failed >= 0)
{
if (wrote)
_snprintf_s(buf, 64, " %016I64X", (uintptr_t)val);
else
_snprintf_s(buf, 64, "%016I64X", (uintptr_t)val);
ss << buf;
wrote = true;
failed = 1;
}
}
}
__except (1)
{
failed = -1;
}
return failed;
}
std::string get_stack_string(uintptr_t address, uintptr_t * skip = NULL, bool full = false)
{
std::stringstream ss;
uintptr_t idx = 0;
bool wrote = false;
while (idx < 256)
{
int failed = __do_write(ss, address + 8 * idx, skip, full, wrote);
if (failed < 0)
break;
if (failed > 0)
skip = NULL;
idx++;
}
return ss.str();
}
void try_write_crash_info(EXCEPTION_POINTERS * info)
{
constexpr char * logPath = "./Data/F4SE/Plugins/CrashLog";
time_t rawtime;
struct tm timeinfo;
time(&rawtime);
errno_t err = localtime_s(&timeinfo, &rawtime);
static char fileNameBuf[MAX_PATH];
static char fileTimeBuf[80];
if (err == 0)
strftime(fileTimeBuf, 80, "%Y_%m_%d_%H-%M-%S", &timeinfo);
else
_snprintf_s(fileTimeBuf, 80, "%d", 0);
_snprintf_s(fileNameBuf, MAX_PATH, "%s/crash_%s.txt", logPath, fileTimeBuf);
std::ofstream file = (true) ? std::ofstream(fileNameBuf) : std::ofstream(fileNameBuf, std::ios_base::app);
if (!file.good())
{
_MESSAGE("[CI] failed to open file for writing: \"%s\"", fileNameBuf);
return;
}
file << "===================================\n";
file << "Crash info:\n";
file << fileTimeBuf << " - ";
file << std::hex << std::uppercase;
file << info->ContextRecord->Rip;
file << ": ";
file << "V(1); ";
_MESSAGE("CRASHLOG:");
_MESSAGE("RIP(%016I64X)", info->ContextRecord->Rip);
_MESSAGE("RAX(%016I64X)", info->ContextRecord->Rax);
_MESSAGE("RBX(%016I64X)", info->ContextRecord->Rbx);
_MESSAGE("RCX(%016I64X)", info->ContextRecord->Rcx);
_MESSAGE("RDX(%016I64X)", info->ContextRecord->Rdx);
_MESSAGE("RSI(%016I64X)", info->ContextRecord->Rsi);
_MESSAGE("RDI(%016I64X)", info->ContextRecord->Rdi);
_MESSAGE("RBP(%016I64X)", info->ContextRecord->Rbp);
_MESSAGE("RSP(%016I64X)", info->ContextRecord->Rsp);
file << "RAX(" << info->ContextRecord->Rax << "); ";
file << "RBX(" << info->ContextRecord->Rbx << "); ";
file << "RCX(" << info->ContextRecord->Rcx << "); ";
file << "RDX(" << info->ContextRecord->Rdx << "); ";
file << "RSI(" << info->ContextRecord->Rsi << "); ";
file << "RDI(" << info->ContextRecord->Rdi << "); ";
file << "RBP(" << info->ContextRecord->Rbp << "); ";
file << "RSP(" << info->ContextRecord->Rsp << "); ";
std::string stackStr = get_stack_string(info->ContextRecord->Rsp, nullptr, false);
file << "STACK(" << stackStr.c_str() << ");";
file << "\n\nNot so useful info (don't post unless asked):\n";
stackStr = get_stack_string(info->ContextRecord->Rsp, nullptr, true);
file << "STACK_FULL(" << stackStr.c_str() << ");\n";
file.close();
}
Actor * actor = DYNAMIC_CAST(thisObj, TESForm, Actor);
if(0)
{
if(actor->middleProcess) {
DumpClass(actor->middleProcess, 80);
if(actor->middleProcess->unk08) {
DumpClass(actor->middleProcess->unk08, 80);
}
}
for(int i = 0; i < ActorEquipData::kMaxSlots; i++)
{
ActorEquipData::SlotData * slotData = &actor->equipData->slots[i];
if(actor->equipData->slots[i].instanceData)
{
TBO_InstanceData * instanceData = actor->equipData->slots[i].instanceData;
TESObjectWEAP::InstanceData * pWeapInst = (TESObjectWEAP::InstanceData*)Runtime_DynamicCast(instanceData, RTTI_TBO_InstanceData, RTTI_TESObjectWEAP__InstanceData);
if(pWeapInst) {
_MESSAGE("Weapon Slot %d Item %08X", i, actor->equipData->slots[i].item->formID);
}
TESObjectARMO::InstanceData * pArmoInst = (TESObjectARMO::InstanceData*)Runtime_DynamicCast(instanceData, RTTI_TBO_InstanceData, RTTI_TESObjectARMO__InstanceData);
if(pArmoInst) {
_MESSAGE("Armor Slot %d Item %08X", i, actor->equipData->slots[i].item->formID);
}
if(!pWeapInst && !pArmoInst) {
_MESSAGE("Slot %d Item %08X", i, actor->equipData->slots[i].item->formID);
}
}
BGSObjectInstanceExtra * extraData = actor->equipData->slots[i].extraData;
if(extraData)
{
if(extraData->data)
{
for(int i = 0; i < extraData->data->blockSize / sizeof(BGSObjectInstanceExtra::Data::Form); i++)
{
TESForm * form = LookupFormByID(extraData->data->forms[i].formId);
_MESSAGE("Owner %08X InstanceData: %08X", actor->formID, form->formID);
}
}
}
}
return true;
}
if(0)
{
TESNPC * npc = DYNAMIC_CAST(thisObj->baseForm, TESForm, TESNPC);
if(npc) {
_MESSAGE("Actor: %08X ActorBase: %08X BaseContainer", actor->formID, npc->formID);
TESContainer * container = DYNAMIC_CAST(npc, TESNPC, TESContainer);
if(container)
{
for(UInt32 i = 0; i < container->numEntries; i++)
{
_MESSAGE("%016I64X %s - Count: %d", container->entries[i]->form->formID, GetObjectClassName(container->entries[i]->form), container->entries[i]->count);
DumpClass(container->entries[i]->data, sizeof(TESContainer::Entry::Data) >> 3);
}
}
}
_MESSAGE("Actor: %08X Inventory", actor->formID);
auto inventory = actor->inventoryList;
if(inventory) {
for(int i = 0; i < inventory->items.count; i++) {
BGSInventoryItem item;
inventory->items.GetNthItem(i, item);
item.Dump();
}
}
}
//GFxValue posX;
//root->CreateObject(&posX);
//sprintf_s(sResult.get(), MAX_PATH, "POS-X: %.2f", actor->pos.x);
//RegisterString(&posX, root, "text", sResult.get());
//Register<UInt32>(&posX, "filterFlag", 2);
//value.PushBack(&posX);
//GFxValue posY;
//root->CreateObject(&posY);
//sprintf_s(sResult.get(), MAX_PATH, "POS-Y: %.2f", actor->pos.y);
//RegisterString(&posY, root, "text", sResult.get());
//Register<UInt32>(&posY, "filterFlag", 2);
//value.PushBack(&posY);
//GFxValue posZ;
//root->CreateObject(&posZ);
//sprintf_s(sResult.get(), MAX_PATH, "POS-Z: %.2f", actor->pos.z);
//RegisterString(&posZ, root, "text", sResult.get());
//Register<UInt32>(&posZ, "filterFlag", 2);
//value.PushBack(&posZ);
//GFxValue rotX;
//root->CreateObject(&rotX);
//sprintf_s(sResult.get(), MAX_PATH, "ROT-X: %.2f", actor->rot.x);
//RegisterString(&rotX, root, "text", sResult.get());
//Register<UInt32>(&rotX, "filterFlag", 2);
//value.PushBack(&rotX);
//GFxValue rotY;
//root->CreateObject(&rotY);
//sprintf_s(sResult.get(), MAX_PATH, "ROT-Y: %.2f", actor->rot.y);
//RegisterString(&rotY, root, "text", sResult.get());
//Register<UInt32>(&rotY, "filterFlag", 2);
//value.PushBack(&rotY);
//GFxValue rotZ;
//root->CreateObject(&rotZ);
//sprintf_s(sResult.get(), MAX_PATH, "ROT-Z: %.2f", actor->rot.z);
//RegisterString(&rotZ, root, "text", sResult.get());
//Register<UInt32>(&rotZ, "filterFlag", 2);
//value.PushBack(&rotZ);
/*
template <typename T>
PipboyValue * GetValueByMask(T value)
{
if (sizeof(T) <= sizeof(uintptr_t))
{
uintptr_t value = reinterpret_cast<uintptr_t>(T);
UInt32 hash;
CalculateCRC32_64(&hash, value, 0);
Node* pNode = nodes + (hashCode - 1) & hash;
while (pNode && pNode->next)
{
if (pNode->mask == reinterpret_cast<uintptr_t>(T))
{
return pNode->value;
}
pNode = pNode->next;
}
}
return nullptr;
}
//sub_B6BD60
*/
__int64 __fastcall sub_989A0(__int64 a1)
{
__int64 v1; // rdi@1
__int64 v2; // rax@1
int *v3; // rax@2
__int64 v4; // rbx@4
__int64 v5; // rcx@6
__int64 v6; // rax@8
bool v7; // di@10
__int64 v9; // [sp+20h] [bp-18h]@4
int v10; // [sp+48h] [bp+10h]@2
int v11; // [sp+50h] [bp+18h]@3
int v12; // [sp+58h] [bp+20h]@4
v1 = a1;
LODWORD(v2) = sub_436A0(a1, 0x1Cu);
if ( v2 )
{
v10 = *(_DWORD *)(v2 + 24);
v3 = &v10;
}
else
{
v11 = dword_3858084;
v3 = &v11;
}
v12 = *v3;
v9 = 0i64;
sub_AC90(&v12, &v9);
v4 = v9;
if ( v9 && (*(_DWORD *)(v9 + 16) >> 5) & 1 )
v5 = *(_QWORD *)(v9 + 256);
else
v5 = v1;
LODWORD(v6) = sub_436A0(v5, 136u); // ÈÎÕÎïÆ·²»ÓÖØÁ¿
v7 = v6 && (unsigned __int8)sub_C0110(v6);
if ( v4 && !(_InterlockedDecrement((volatile signed __int32 *)(v4 + 40)) & 0x3FF) )
(*(void (**)(void))(*(_QWORD *)(v4 + 32) + 8i64))();
return v7;
}
int __usercall sub_AEB560@<eax>(__int64 *a1@<rdx>, _QWORD *a2@<rcx>, int a3@<r8d>, __int64 a4@<r9>, double a5@<xmm0>, char a6)
{
__int64 v6; // r12@1
__int64 v7; // rbx@1
int v8; // esi@1
__int64 *v9; // r14@1
_QWORD *v10; // r15@1
__int64 v11; // r8@3
__int64 v12; // rax@3
__int64 *v13; // rdi@3
__int64 v14; // r13@5
__int64 v15; // rax@5
char v16; // cl@5
bool v17; // ST20_1@6
unsigned int v18; // ebx@7
float v19; // xmm10_4@11
__int64 *v20; // rbx@16
__int64 v21; // rcx@16
__int64 v22; // rax@24
__int64 v23; // rdi@24
int v24; // eax@24
__int64 *v25; // rbx@24
signed __int64 v26; // rsi@25
__int64 v27; // rdi@27
int v28; // eax@27
_QWORD *v29; // rdx@28
int v30; // edx@31
__int64 *v31; // rbx@32
__int64 v32; // rdi@33
__int64 v33; // rax@33
__int64 v34; // rax@34
float v35; // xmm1_4@35
__int64 v36; // rax@39
__int64 v37; // rsi@41
__int64 v38; // rax@43
__int64 v39; // r14@44
__int64 v40; // rcx@47
__int64 **v41; // r8@47
unsigned __int8 v42; // al@47
bool v43; // cf@47
bool v44; // zf@47
__int64 ***v45; // rax@47
signed __int64 v46; // r9@50
__int64 **v47; // rdx@53
__int64 *v48; // rcx@53
unsigned __int8 v49; // cl@54
__int64 v50; // rax@63
__int64 v51; // rbx@63
__int64 v52; // rax@65
__int64 v53; // r9@68
int v54; // eax@71
char *v55; // rax@74
int v56; // eax@74
__int64 v57; // rax@74
int v58; // ebx@78
float v59; // xmm6_4@79
double v60; // rax@81
double v61; // rbx@81
void *v62; // r8@83
float v63; // xmm7_4@84
float v64; // xmm6_4@86
double v65; // xmm0_8@90
double v66; // xmm7_8@90
__int64 v67; // rax@91
float v68; // xmm6_4@91
double v69; // xmm0_8@95
float v70; // xmm7_4@95
__int64 v71; // rax@96
__int64 v72; // rax@101
__int64 v73; // r14@101
__int64 v74; // rax@102
float v75; // xmm6_4@103
__int64 v76; // rax@103
float v77; // xmm7_4@103
signed __int64 v78; // rcx@105
__int64 v79; // rax@110
signed __int64 v80; // rcx@113
__int64 v81; // rbx@118
signed __int64 v82; // rsi@118
int v83; // edi@123
double v84; // xmm8_8@123
__int64 v85; // rax@125
__int64 v86; // rax@129
char *v87; // rdx@130
int v88; // eax@132
unsigned __int64 v89; // rbx@134
__int64 v90; // rcx@143
__int64 v91; // rcx@147
__int64 v92; // rdx@151
__int64 v93; // rcx@151
__int64 v94; // r9@152
__int64 v95; // rax@154
unsigned int v96; // ecx@155
__int64 *v97; // rbx@155
int v98; // eax@161
__int64 v99; // rdx@161
__int64 v100; // rcx@161
int v101; // eax@162
__int64 v102; // rax@165
__int64 v103; // r14@165
__int64 v104; // rbx@165
__int64 v105; // rax@165
__int64 v106; // rdi@165
void *v107; // rbx@166
_QWORD *v108; // rax@166
char v109; // al@166
bool v110; // r15@168
__int64 **v111; // rbx@168
__int64 v112; // rax@168
signed __int64 v113; // rsi@171
__int64 *v114; // rdi@174
unsigned int v115; // er14@174
__int64 v116; // rax@175
__int64 v117; // rbx@178
signed __int64 v118; // rsi@178
int v119; // edi@183
__int64 v120; // rax@183
float v121; // xmm6_4@183
signed __int64 v122; // rcx@186
__int64 v123; // rax@197
unsigned int v124; // er8@198
__int64 v125; // rax@202
__int64 v126; // rbx@202
__int64 v127; // rsi@202
__int64 v128; // rax@202
__int64 v129; // rax@204
__int64 v130; // rax@208
__int64 v131; // rcx@210
unsigned int v132; // eax@211
__int64 v133; // rbx@211
signed __int64 v134; // rdi@212
__int64 v135; // rbx@217
__int64 v136; // rdi@220
__int64 v137; // rax@220
__int64 v138; // rsi@220
__int64 v139; // rax@224
__int64 v140; // rax@226
_QWORD *v141; // rbx@229
__int64 v142; // rcx@229
signed __int64 v143; // rdi@230
__int64 v144; // rax@234
char *v145; // rdx@235
int v146; // eax@237
unsigned __int64 v147; // rbx@239
signed __int64 v148; // rax@252
float v149; // xmm6_4@256
signed int v150; // ecx@257
__int64 v151; // rcx@260
__int64 v152; // rdi@260
_BYTE *v153; // rax@261
const char *v154; // rax@263
int v155; // eax@264
int v156; // esi@269
__int64 v157; // rax@272
__int64 v158; // rax@273
__int64 v159; // rbx@273
float v160; // xmm6_4@273
float v161; // xmm7_4@277
__int64 v162; // rax@279
__int64 v163; // rbx@279
__int64 v164; // r14@279
__int64 v165; // rax@279
signed int v166; // eax@286
int v167; // ebx@290
void (__fastcall ***v168)(_QWORD, _QWORD); // rcx@299
int result; // eax@306
__int64 v170; // [sp+40h] [bp-898h]@5
unsigned int v171; // [sp+48h] [bp-890h]@5
double v172; // [sp+50h] [bp-888h]@38
bool v173; // [sp+60h] [bp-878h]@5
__int64 v174; // [sp+68h] [bp-870h]@5
unsigned int v175; // [sp+70h] [bp-868h]@5
__int64 v176; // [sp+78h] [bp-860h]@39
__int64 v177; // [sp+88h] [bp-850h]@3
unsigned int v178; // [sp+90h] [bp-848h]@3
__int64 v179; // [sp+98h] [bp-840h]@3
__int64 v180; // [sp+A0h] [bp-838h]@3
unsigned int v181; // [sp+A8h] [bp-830h]@47
__int64 v182; // [sp+B0h] [bp-828h]@16
__int64 v183; // [sp+B8h] [bp-820h]@3
__int64 **v184; // [sp+C0h] [bp-818h]@47
__int64 v185; // [sp+C8h] [bp-810h]@24
unsigned int v186; // [sp+D0h] [bp-808h]@27
int v187; // [sp+D8h] [bp-800h]@24
__int64 v188; // [sp+E0h] [bp-7F8h]@5
__int64 v189; // [sp+E8h] [bp-7F0h]@41
__int64 v190; // [sp+F0h] [bp-7E8h]@151
unsigned int v191; // [sp+F8h] [bp-7E0h]@151
__int64 v192; // [sp+100h] [bp-7D8h]@152
__int64 v193; // [sp+110h] [bp-7C8h]@41
__int64 v194; // [sp+118h] [bp-7C0h]@41
char *v195; // [sp+120h] [bp-7B8h]@235
int v196; // [sp+128h] [bp-7B0h]@235
char *v197; // [sp+130h] [bp-7A8h]@130
int v198; // [sp+138h] [bp-7A0h]@130
__int64 v199; // [sp+140h] [bp-798h]@168
__int64 v200; // [sp+148h] [bp-790h]@168
int v201; // [sp+150h] [bp-788h]@168
unsigned int v202; // [sp+158h] [bp-780h]@168
__int64 v203; // [sp+160h] [bp-778h]@165
__int64 v204; // [sp+168h] [bp-770h]@165
int v205; // [sp+170h] [bp-768h]@165
unsigned int v206; // [sp+178h] [bp-760h]@165
__int64 v207; // [sp+180h] [bp-758h]@101
__int64 v208; // [sp+188h] [bp-750h]@101
int v209; // [sp+190h] [bp-748h]@101
unsigned int v210; // [sp+198h] [bp-740h]@101
__int64 v211; // [sp+1A0h] [bp-738h]@101
__int64 v212; // [sp+1A8h] [bp-730h]@101
int v213; // [sp+1B0h] [bp-728h]@101
unsigned int v214; // [sp+1B8h] [bp-720h]@101
__int64 v215; // [sp+1C0h] [bp-718h]@74
unsigned int v216; // [sp+1C8h] [bp-710h]@74
signed int v217; // [sp+1D0h] [bp-708h]@74
__int64 v218; // [sp+1E0h] [bp-6F8h]@125
unsigned int v219; // [sp+1E8h] [bp-6F0h]@125
int v220; // [sp+1F0h] [bp-6E8h]@125
__int64 v221; // [sp+200h] [bp-6D8h]@132
unsigned int v222; // [sp+208h] [bp-6D0h]@132
char v223; // [sp+210h] [bp-6C8h]@132
__int64 v224; // [sp+220h] [bp-6B8h]@237
unsigned int v225; // [sp+228h] [bp-6B0h]@237
char v226; // [sp+230h] [bp-6A8h]@237
__int64 v227; // [sp+240h] [bp-698h]@197
unsigned int v228; // [sp+248h] [bp-690h]@197
int v229; // [sp+250h] [bp-688h]@197
__int64 v230; // [sp+260h] [bp-678h]@112
__int64 ***v231; // [sp+268h] [bp-670h]@49
__int64 v232; // [sp+270h] [bp-668h]@180
__int64 v233; // [sp+278h] [bp-660h]@185
__int64 v234; // [sp+280h] [bp-658h]@120
__int64 v235; // [sp+288h] [bp-650h]@288
unsigned int v236; // [sp+290h] [bp-648h]@288
signed int v237; // [sp+298h] [bp-640h]@288
__int64 v238; // [sp+2A8h] [bp-630h]@132
__int64 v239; // [sp+2B0h] [bp-628h]@264
__int64 v240; // [sp+2B8h] [bp-620h]@237
__int64 v241; // [sp+2C0h] [bp-618h]@105
void **v242; // [sp+2C8h] [bp-610h]@27
__int64 *v243; // [sp+2D0h] [bp-608h]@27
__int64 *v244; // [sp+2D8h] [bp-600h]@251
__int64 v245; // [sp+2E0h] [bp-5F8h]@74
__int64 **v246; // [sp+2E8h] [bp-5F0h]@170
__int64 v247; // [sp+2F0h] [bp-5E8h]@39
unsigned int v248; // [sp+2F8h] [bp-5E0h]@39
signed int v249; // [sp+300h] [bp-5D8h]@39
__int64 v250; // [sp+310h] [bp-5C8h]@63
__int64 v251; // [sp+318h] [bp-5C0h]@143
char v252; // [sp+320h] [bp-5B8h]@62
__int64 ***v253; // [sp+328h] [bp-5B0h]@62
int *v254; // [sp+330h] [bp-5A8h]@62
__int64 *v255; // [sp+338h] [bp-5A0h]@154
__int64 *v256; // [sp+340h] [bp-598h]@154
__int64 *v257; // [sp+348h] [bp-590h]@210
__int64 *v258; // [sp+350h] [bp-588h]@210
__int64 *v259; // [sp+358h] [bp-580h]@210
__int64 *v260; // [sp+360h] [bp-578h]@229
__int64 *v261; // [sp+368h] [bp-570h]@229
__int64 *v262; // [sp+370h] [bp-568h]@229
__int64 *v263; // [sp+378h] [bp-560h]@220
__int64 *v264; // [sp+380h] [bp-558h]@220
__int64 *v265; // [sp+388h] [bp-550h]@220
__int64 v266; // [sp+390h] [bp-548h]@16
__int64 v267; // [sp+398h] [bp-540h]@16
int v268; // [sp+3A0h] [bp-538h]@16
__int64 v269; // [sp+3A8h] [bp-530h]@16
__int64 *v270; // [sp+3B0h] [bp-528h]@16
__int64 *v271; // [sp+3B8h] [bp-520h]@16
__int64 *v272; // [sp+3C0h] [bp-518h]@16
__int64 *v273; // [sp+3C8h] [bp-510h]@16
__int64 *v274; // [sp+3D0h] [bp-508h]@16
__int16 v275; // [sp+3E0h] [bp-4F8h]@68
_BYTE v276[6]; // [sp+3E2h] [bp-4F6h]@68
__int16 v277; // [sp+4F0h] [bp-3E8h]@34
_BYTE v278[6]; // [sp+4F2h] [bp-3E6h]@34
__int16 v279; // [sp+600h] [bp-2D8h]@204
_BYTE v280[6]; // [sp+602h] [bp-2D6h]@204
__int16 v281; // [sp+710h] [bp-1C8h]@260
_BYTE v282[6]; // [sp+712h] [bp-1C6h]@260