Commit f8e0385 1 parent fced13e commit f8e0385 Copy full SHA for f8e0385
File tree 3 files changed +7
-6
lines changed
3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const DeviceProcs* getDeviceProcs(ID3D11Device* pDevice) {
50
50
return &g_deviceProcs;
51
51
}
52
52
53
- // This game hates and crashes when other shaders
53
+ // This game hates when other shaders
54
54
// don't have a vertex shader when doing
55
55
// pixel shader changes, but it's fine the other way around.
56
56
Original file line number Diff line number Diff line change 2
2
#define IMPL_H
3
3
4
4
#include < bit>
5
+ #include < cstdint>
5
6
#include < d3d11.h>
6
7
7
8
#include " log.h"
@@ -10,7 +11,6 @@ namespace atfix {
10
11
11
12
void hookDevice (ID3D11Device* pDevice);
12
13
ID3D11DeviceContext* hookContext (ID3D11DeviceContext* pContext);
13
- inline const std::uintptr_t modulebase = std::bit_cast<std::uintptr_t >(GetModuleHandleA(" dragonnest_x64.exe" ));
14
14
inline void * SettingsAddress = nullptr ;
15
15
16
16
/* lives in main.cpp */
Original file line number Diff line number Diff line change @@ -85,12 +85,13 @@ D3D11Proc loadSystemD3D11() {
85
85
86
86
}
87
87
void sigscan () {
88
+ const std::uintptr_t modulebase = std::bit_cast<std::uintptr_t >(GetModuleHandleA (0 ));
88
89
const auto scanner = LightningScanner::Scanner (" 83 3d ?? ?? ?? ?? ?? 41 0f 9c c0" );
89
- void * result = scanner.Find (std::bit_cast<void *>(atfix:: modulebase), 0x154B000 ).Get <void *>();
90
+ void * result = scanner.Find (std::bit_cast<void *>(modulebase), 0x154B000 ).Get <void *>();
90
91
91
- DWORD RVA = *std::bit_cast<DWORD*>(std::bit_cast<uintptr_t >(result) + 2 );
92
- DWORD AbsoAddress = ( DWORD) ((RVA + (DWORD)(std::bit_cast<uintptr_t >(result) + 7 )) - atfix:: modulebase);
93
- atfix::SettingsAddress = ( void *)(atfix:: modulebase + AbsoAddress);
92
+ const DWORD RVA = *std::bit_cast<DWORD*>(std::bit_cast<uintptr_t >(result) + 2 );
93
+ const DWORD AbsoAddress = static_cast < DWORD> ((RVA + (DWORD)(std::bit_cast<uintptr_t >(result) + 7 )) - modulebase);
94
+ atfix::SettingsAddress = std::bit_cast< void *>( modulebase + AbsoAddress);
94
95
}
95
96
extern " C" {
96
97
You can’t perform that action at this time.
0 commit comments