clang-format: Apply formatting

Code submissions have continually suffered from formatting
inconsistencies that constantly have to be addressed.  Using
clang-format simplifies this by making code formatting more consistent,
and allows automation of the code formatting so that maintainers can
focus more on the code itself instead of code formatting.
This commit is contained in:
jp9000
2019-06-22 22:13:45 -07:00
parent 53615ee10f
commit f53df7da64
567 changed files with 34068 additions and 32903 deletions

View File

@@ -6,20 +6,20 @@
typedef IDirect3D8 *(WINAPI *d3d8create_t)(UINT);
struct d3d8_info {
HMODULE module;
HWND hwnd;
IDirect3D8 *d3d8;
HMODULE module;
HWND hwnd;
IDirect3D8 *d3d8;
IDirect3DDevice8 *device;
};
static inline bool d3d8_init(d3d8_info &info)
{
d3d8create_t create;
HRESULT hr;
HRESULT hr;
info.hwnd = CreateWindowExA(0, DUMMY_WNDCLASS, "d3d8 get-addr window",
WS_POPUP, 0, 0, 1, 1, nullptr, nullptr,
GetModuleHandleA(nullptr), nullptr);
WS_POPUP, 0, 0, 1, 1, nullptr, nullptr,
GetModuleHandleA(nullptr), nullptr);
if (!info.hwnd) {
return false;
}
@@ -40,17 +40,18 @@ static inline bool d3d8_init(d3d8_info &info)
}
D3DPRESENT_PARAMETERS pp = {};
pp.Windowed = true;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
pp.BackBufferFormat = D3DFMT_A8R8G8B8;
pp.BackBufferWidth = 2;
pp.BackBufferHeight = 2;
pp.BackBufferCount = 1;
pp.hDeviceWindow = info.hwnd;
pp.Windowed = true;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
pp.BackBufferFormat = D3DFMT_A8R8G8B8;
pp.BackBufferWidth = 2;
pp.BackBufferHeight = 2;
pp.BackBufferCount = 1;
pp.hDeviceWindow = info.hwnd;
hr = info.d3d8->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
info.hwnd, D3DCREATE_HARDWARE_VERTEXPROCESSING, &pp,
&info.device);
info.hwnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING, &pp,
&info.device);
if (FAILED(hr)) {
return false;
}
@@ -70,8 +71,8 @@ static inline void d3d8_free(d3d8_info &info)
void get_d3d8_offsets(struct d3d8_offsets *offsets)
{
d3d8_info info = {};
bool success = d3d8_init(info);
d3d8_info info = {};
bool success = d3d8_init(info);
if (success) {
offsets->present = vtable_offset(info.module, info.device, 15);

View File

@@ -3,24 +3,24 @@
#include <d3d9.h>
#include "get-graphics-offsets.h"
typedef HRESULT (WINAPI *d3d9createex_t)(UINT, IDirect3D9Ex**);
typedef HRESULT(WINAPI *d3d9createex_t)(UINT, IDirect3D9Ex **);
struct d3d9_info {
HMODULE module;
HWND hwnd;
IDirect3D9Ex *d3d9ex;
IDirect3DDevice9Ex *device;
IDirect3DSwapChain9 *swap;
HMODULE module;
HWND hwnd;
IDirect3D9Ex *d3d9ex;
IDirect3DDevice9Ex *device;
IDirect3DSwapChain9 *swap;
};
static inline bool d3d9_init(d3d9_info &info)
{
d3d9createex_t create;
HRESULT hr;
HRESULT hr;
info.hwnd = CreateWindowExA(0, DUMMY_WNDCLASS, "d3d9 get-offset window",
WS_POPUP, 0, 0, 1, 1, nullptr, nullptr,
GetModuleHandleA(nullptr), nullptr);
WS_POPUP, 0, 0, 1, 1, nullptr, nullptr,
GetModuleHandleA(nullptr), nullptr);
if (!info.hwnd) {
return false;
}
@@ -31,7 +31,7 @@ static inline bool d3d9_init(d3d9_info &info)
}
create = (d3d9createex_t)GetProcAddress(info.module,
"Direct3DCreate9Ex");
"Direct3DCreate9Ex");
if (!create) {
return false;
}
@@ -42,19 +42,19 @@ static inline bool d3d9_init(d3d9_info &info)
}
D3DPRESENT_PARAMETERS pp = {};
pp.Windowed = true;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
pp.BackBufferFormat = D3DFMT_A8R8G8B8;
pp.BackBufferWidth = 2;
pp.BackBufferHeight = 2;
pp.BackBufferCount = 1;
pp.hDeviceWindow = info.hwnd;
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
pp.Windowed = true;
pp.SwapEffect = D3DSWAPEFFECT_FLIP;
pp.BackBufferFormat = D3DFMT_A8R8G8B8;
pp.BackBufferWidth = 2;
pp.BackBufferHeight = 2;
pp.BackBufferCount = 1;
pp.hDeviceWindow = info.hwnd;
pp.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE;
hr = info.d3d9ex->CreateDeviceEx(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL,
info.hwnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING |
D3DCREATE_NOWINDOWCHANGES, &pp, nullptr, &info.device);
hr = info.d3d9ex->CreateDeviceEx(
D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, info.hwnd,
D3DCREATE_HARDWARE_VERTEXPROCESSING | D3DCREATE_NOWINDOWCHANGES,
&pp, nullptr, &info.device);
if (FAILED(hr)) {
return false;
}
@@ -84,24 +84,12 @@ static inline void d3d9_free(d3d9_info &info)
#define MAX_CMP_SIZE 22
static const uint8_t mask[][MAX_CMP_SIZE] = {
{
0xF8, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0x00,
0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00
},
{
0xF8, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0x00,
0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00
},
{
0xF8, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00
},
{0xF8, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0x00, 0x00,
0x00, 0x00, 0x00, 0xFF, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00},
{0xF8, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0xF8, 0xF8, 0x00, 0x00, 0x00, 0x00},
{0xF8, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0x00, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00},
};
static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
@@ -112,12 +100,8 @@ static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
* 75 12 jnz short loc_7FF7AA90530
* 41 B8 F9 19 00 00 mov r8d, 19F9h
*/
{
0x48, 0x8B, 0x80, 0x00, 0x00, 0x00, 0x00,
0x44, 0x39, 0x00, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00,
0x40, 0xB8, 0x00, 0x00, 0x00, 0x00
},
{0x48, 0x8B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x44, 0x39, 0x00, 0x00,
0x00, 0x00, 0x00, 0x75, 0x00, 0x40, 0xB8, 0x00, 0x00, 0x00, 0x00},
/*
* Windows ???+
* 49 8B 87 78 41 00 00 mov rax, [r15+4178h]
@@ -125,12 +109,8 @@ static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
* 75 12 jnz short loc_1800AEC9C
* 41 B9 C3 1A 00 00 mov r9d, 1AC3h
*/
{
0x48, 0x8B, 0x80, 0x00, 0x00, 0x00, 0x00,
0x39, 0x80, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00,
0x40, 0xB8, 0x00, 0x00, 0x00, 0x00
},
{0x48, 0x8B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x39, 0x80, 0x00, 0x00,
0x00, 0x00, 0x75, 0x00, 0x40, 0xB8, 0x00, 0x00, 0x00, 0x00},
/*
* Windows 10 April 2018
* 49 8B 87 58 40 00 00 mov rax, [r15+4058h]
@@ -140,13 +120,8 @@ static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
*
* Note: different instructions, last byte skipped due to MAX_CMP_SIZE
*/
{
0x48, 0x8B, 0x80, 0x00, 0x00, 0x00, 0x00,
0x39, 0x80, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00,
0x48, 0x8D, 0x00, 0x00, 0x00, 0x00
}
};
{0x48, 0x8B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x39, 0x80, 0x00, 0x00,
0x00, 0x00, 0x75, 0x00, 0x48, 0x8D, 0x00, 0x00, 0x00, 0x00}};
// Offset into the code for the numbers we're interested in
static const uint32_t code_offsets[][2] = {
@@ -159,24 +134,12 @@ static const uint32_t code_offsets[][2] = {
#define MAX_CMP_SIZE 20
static const uint8_t mask[][MAX_CMP_SIZE] = {
{
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0x00,
0xFF, 0x00, 0x00, 0x00, 0x00
},
{
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00,
0xFF, 0x00, 0x00, 0x00, 0x00
},
{
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF,
0xFF, 0x00,
0xFF, 0x00, 0x00, 0x00, 0x00
},
{0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00,
0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00},
{0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00},
{0xFF, 0xC0, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xC0, 0x00, 0x00,
0x00, 0x00, 0xFF, 0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00},
};
static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
@@ -187,12 +150,8 @@ static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
* 75 14 jnz short loc_754CD9E1
* 68 F9 19 00 00 push 19F9h
*/
{
0x8B, 0x80, 0x00, 0x00, 0x00, 0x00,
0x39, 0x80, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00,
0x68, 0x00, 0x00, 0x00, 0x00
},
{0x8B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x39, 0x80, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00},
/* Windows 10 Creator's Update+
* 8B 86 F8 2B 00 00 mov eax, [esi+2BF8h]
@@ -200,12 +159,8 @@ static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
* 75 0F jnz short loc_100D793C
* 68 C3 1A 00 00 push 1AC3h
*/
{
0x8B, 0x80, 0x00, 0x00, 0x00, 0x00,
0x83, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00,
0x68, 0x00, 0x00, 0x00, 0x00
},
{0x8B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x83, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x75, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00},
/*
* Windows 10 April 2018 Update
@@ -214,13 +169,8 @@ static const uint8_t mask_cmp[][MAX_CMP_SIZE] = {
* 75 0F jnz short loc_100D9A9C
* BA 08 71 01 10 mov edx, offset errMsg
*/
{
0x8B, 0x80, 0x00, 0x00, 0x00, 0x00,
0x83, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00,
0x75, 0x00,
0xBA, 0x00, 0x00, 0x00, 0x00
}
};
{0x8B, 0x80, 0x00, 0x00, 0x00, 0x00, 0x83, 0x80, 0x00, 0x00,
0x00, 0x00, 0x00, 0x75, 0x00, 0xBA, 0x00, 0x00, 0x00, 0x00}};
// Offset into the code for the numbers we're interested in
static const uint32_t code_offsets[][2] = {
@@ -233,7 +183,7 @@ static const uint32_t code_offsets[][2] = {
#define MAX_FUNC_SCAN_BYTES 200
static inline bool pattern_matches(uint8_t *byte, uint32_t *offset1,
uint32_t *offset2)
uint32_t *offset2)
{
for (size_t j = 0; j < sizeof(mask) / sizeof(mask[0]); j++) {
for (size_t i = 0; i < MAX_CMP_SIZE; i++) {
@@ -245,7 +195,7 @@ static inline bool pattern_matches(uint8_t *byte, uint32_t *offset1,
*offset2 = code_offsets[j][1];
return true;
next_signature:;
next_signature:;
}
return false;
@@ -253,23 +203,23 @@ next_signature:;
void get_d3d9_offsets(struct d3d9_offsets *offsets)
{
d3d9_info info = {};
bool success = d3d9_init(info);
d3d9_info info = {};
bool success = d3d9_init(info);
if (success) {
uint8_t **vt = *(uint8_t***)info.device;
uint8_t **vt = *(uint8_t ***)info.device;
uint8_t *crr = vt[125];
offsets->present = vtable_offset(info.module, info.device, 17);
offsets->present_ex = vtable_offset(info.module, info.device,
121);
offsets->present_swap = vtable_offset(info.module, info.swap,
3);
offsets->present_ex =
vtable_offset(info.module, info.device, 121);
offsets->present_swap =
vtable_offset(info.module, info.swap, 3);
uint32_t offset1, offset2;
for (size_t i = 0; i < MAX_FUNC_SCAN_BYTES; i++) {
if (pattern_matches(&crr[i], &offset1, &offset2)) {
#define get_offset(x) *(uint32_t*)&crr[i + x]
#define get_offset(x) *(uint32_t *)&crr[i + x]
uint32_t off1 = get_offset(offset1);
uint32_t off2 = get_offset(offset2);
@@ -278,23 +228,23 @@ void get_d3d9_offsets(struct d3d9_offsets *offsets)
if (off1 > 0xFFFF || off2 > 0xFFFF)
break;
/* check to make sure offsets actually point
/* check to make sure offsets actually point
* toward expected data */
#ifdef _MSC_VER
__try {
uint8_t *ptr = (uint8_t*)(info.device);
uint8_t *ptr = (uint8_t *)(info.device);
uint8_t *d3d9_ptr =
*(uint8_t**)(ptr + off1);
if (d3d9_ptr != (uint8_t*)info.d3d9ex)
*(uint8_t **)(ptr + off1);
if (d3d9_ptr != (uint8_t *)info.d3d9ex)
break;
BOOL &is_d3d9ex =
*(BOOL*)(d3d9_ptr + off2);
*(BOOL *)(d3d9_ptr + off2);
if (is_d3d9ex != TRUE)
break;
} __except(EXCEPTION_EXECUTE_HANDLER) {
} __except (EXCEPTION_EXECUTE_HANDLER) {
break;
}
#endif

View File

@@ -4,33 +4,38 @@
#include <dxgi1_2.h>
#include "get-graphics-offsets.h"
typedef HRESULT (WINAPI *d3d10create_t)(IDXGIAdapter*, D3D10_DRIVER_TYPE,
HMODULE, UINT, UINT, DXGI_SWAP_CHAIN_DESC*,
IDXGISwapChain**, IUnknown**);
typedef HRESULT (WINAPI *create_fac_t)(IID *id, void**);
typedef HRESULT(WINAPI *d3d10create_t)(IDXGIAdapter *, D3D10_DRIVER_TYPE,
HMODULE, UINT, UINT,
DXGI_SWAP_CHAIN_DESC *,
IDXGISwapChain **, IUnknown **);
typedef HRESULT(WINAPI *create_fac_t)(IID *id, void **);
struct dxgi_info {
HMODULE module;
HWND hwnd;
HMODULE module;
HWND hwnd;
IDXGISwapChain *swap;
};
static const IID dxgiFactory2 =
{0x50c83a1c, 0xe072, 0x4c48, {0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6, 0xd0}};
static const IID dxgiFactory2 = {0x50c83a1c,
0xe072,
0x4c48,
{0x87, 0xb0, 0x36, 0x30, 0xfa, 0x36, 0xa6,
0xd0}};
static inline bool dxgi_init(dxgi_info &info)
{
HMODULE d3d10_module;
HMODULE d3d10_module;
d3d10create_t create;
create_fac_t create_factory;
create_fac_t create_factory;
IDXGIFactory1 *factory;
IDXGIAdapter1 *adapter;
IUnknown *device;
HRESULT hr;
IUnknown *device;
HRESULT hr;
info.hwnd = CreateWindowExA(0, DUMMY_WNDCLASS, "d3d10 get-offset window",
WS_POPUP, 0, 0, 2, 2, nullptr, nullptr,
GetModuleHandleA(nullptr), nullptr);
info.hwnd = CreateWindowExA(0, DUMMY_WNDCLASS,
"d3d10 get-offset window", WS_POPUP, 0, 0,
2, 2, nullptr, nullptr,
GetModuleHandleA(nullptr), nullptr);
if (!info.hwnd) {
return false;
}
@@ -40,8 +45,8 @@ static inline bool dxgi_init(dxgi_info &info)
return false;
}
create_factory = (create_fac_t)GetProcAddress(info.module,
"CreateDXGIFactory1");
create_factory =
(create_fac_t)GetProcAddress(info.module, "CreateDXGIFactory1");
d3d10_module = LoadLibraryA("d3d10.dll");
if (!d3d10_module) {
@@ -49,16 +54,15 @@ static inline bool dxgi_init(dxgi_info &info)
}
create = (d3d10create_t)GetProcAddress(d3d10_module,
"D3D10CreateDeviceAndSwapChain");
"D3D10CreateDeviceAndSwapChain");
if (!create) {
return false;
}
IID factory_iid = IsWindows8OrGreater()
? dxgiFactory2
: __uuidof(IDXGIFactory1);
IID factory_iid = IsWindows8OrGreater() ? dxgiFactory2
: __uuidof(IDXGIFactory1);
hr = create_factory(&factory_iid, (void**)&factory);
hr = create_factory(&factory_iid, (void **)&factory);
if (FAILED(hr)) {
return false;
}
@@ -70,17 +74,17 @@ static inline bool dxgi_init(dxgi_info &info)
}
DXGI_SWAP_CHAIN_DESC desc = {};
desc.BufferCount = 2;
desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
desc.BufferDesc.Width = 2;
desc.BufferDesc.Height = 2;
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
desc.OutputWindow = info.hwnd;
desc.SampleDesc.Count = 1;
desc.Windowed = true;
desc.BufferCount = 2;
desc.BufferDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
desc.BufferDesc.Width = 2;
desc.BufferDesc.Height = 2;
desc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT;
desc.OutputWindow = info.hwnd;
desc.SampleDesc.Count = 1;
desc.Windowed = true;
hr = create(adapter, D3D10_DRIVER_TYPE_HARDWARE, nullptr, 0,
D3D10_SDK_VERSION, &desc, &info.swap, &device);
D3D10_SDK_VERSION, &desc, &info.swap, &device);
adapter->Release();
if (FAILED(hr)) {
return false;
@@ -100,17 +104,17 @@ static inline void dxgi_free(dxgi_info &info)
void get_dxgi_offsets(struct dxgi_offsets *offsets)
{
dxgi_info info = {};
bool success = dxgi_init(info);
HRESULT hr;
dxgi_info info = {};
bool success = dxgi_init(info);
HRESULT hr;
if (success) {
offsets->present = vtable_offset(info.module, info.swap, 8);
offsets->resize = vtable_offset(info.module, info.swap, 13);
offsets->resize = vtable_offset(info.module, info.swap, 13);
IDXGISwapChain1 *swap1;
hr = info.swap->QueryInterface(__uuidof(IDXGISwapChain1),
(void**)&swap1);
(void **)&swap1);
if (SUCCEEDED(hr)) {
offsets->present1 =
vtable_offset(info.module, swap1, 22);

View File

@@ -9,10 +9,10 @@ int main(int argc, char *argv[])
struct d3d9_offsets d3d9 = {0};
struct dxgi_offsets dxgi = {0};
WNDCLASSA wc = {0};
wc.style = CS_OWNDC;
wc.hInstance = GetModuleHandleA(NULL);
wc.lpfnWndProc = (WNDPROC)DefWindowProcA;
WNDCLASSA wc = {0};
wc.style = CS_OWNDC;
wc.hInstance = GetModuleHandleA(NULL);
wc.lpfnWndProc = (WNDPROC)DefWindowProcA;
wc.lpszClassName = DUMMY_WNDCLASS;
SetErrorMode(SEM_FAILCRITICALERRORS);
@@ -27,17 +27,17 @@ int main(int argc, char *argv[])
get_dxgi_offsets(&dxgi);
printf("[d3d8]\n");
printf("present=0x%"PRIx32"\n", d3d8.present);
printf("present=0x%" PRIx32 "\n", d3d8.present);
printf("[d3d9]\n");
printf("present=0x%"PRIx32"\n", d3d9.present);
printf("present_ex=0x%"PRIx32"\n", d3d9.present_ex);
printf("present_swap=0x%"PRIx32"\n", d3d9.present_swap);
printf("d3d9_clsoff=0x%"PRIx32"\n", d3d9.d3d9_clsoff);
printf("is_d3d9ex_clsoff=0x%"PRIx32"\n", d3d9.is_d3d9ex_clsoff);
printf("present=0x%" PRIx32 "\n", d3d9.present);
printf("present_ex=0x%" PRIx32 "\n", d3d9.present_ex);
printf("present_swap=0x%" PRIx32 "\n", d3d9.present_swap);
printf("d3d9_clsoff=0x%" PRIx32 "\n", d3d9.d3d9_clsoff);
printf("is_d3d9ex_clsoff=0x%" PRIx32 "\n", d3d9.is_d3d9ex_clsoff);
printf("[dxgi]\n");
printf("present=0x%"PRIx32"\n", dxgi.present);
printf("present1=0x%"PRIx32"\n", dxgi.present1);
printf("resize=0x%"PRIx32"\n", dxgi.resize);
printf("present=0x%" PRIx32 "\n", dxgi.present);
printf("present1=0x%" PRIx32 "\n", dxgi.present1);
printf("resize=0x%" PRIx32 "\n", dxgi.resize);
(void)argc;
(void)argv;

View File

@@ -15,9 +15,9 @@ extern "C" {
#endif
static inline uint32_t vtable_offset(HMODULE module, void *cls,
unsigned int offset)
unsigned int offset)
{
uintptr_t *vtable = *(uintptr_t**)cls;
uintptr_t *vtable = *(uintptr_t **)cls;
return (uint32_t)(vtable[offset] - (uintptr_t)module);
}