diff --git a/aimeio/meson.build b/aimeio/meson.build index ddbb66a..46b0beb 100644 --- a/aimeio/meson.build +++ b/aimeio/meson.build @@ -3,7 +3,6 @@ aimeio_lib = static_library( name_prefix : '', include_directories: inc, implicit_include_directories : false, - c_pch : '../precompiled.h', link_with : [ util_lib, ], diff --git a/amcus/amcus.c b/amcus/amcus.c index 9dbfd0a..d8ede49 100644 --- a/amcus/amcus.c +++ b/amcus/amcus.c @@ -1,4 +1,5 @@ #include +#include #include #include #include diff --git a/amcus/iauth.c b/amcus/iauth.c index 7089926..2ac5c31 100644 --- a/amcus/iauth.c +++ b/amcus/iauth.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "amcus/iauth.h" #include "amcus/amcus.h" diff --git a/amcus/meson.build b/amcus/meson.build index 3e1fec3..6862a41 100644 --- a/amcus/meson.build +++ b/amcus/meson.build @@ -2,7 +2,6 @@ amcus_lib = static_library( 'gfxhook', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), ], diff --git a/board/bpreader.c b/board/bpreader.c index 9f57fb8..c9be995 100644 --- a/board/bpreader.c +++ b/board/bpreader.c @@ -1,4 +1,5 @@ #include +#include #include #include diff --git a/board/meson.build b/board/meson.build index a1e7956..2f0aa24 100644 --- a/board/meson.build +++ b/board/meson.build @@ -2,7 +2,6 @@ board_lib = static_library( 'board', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), ], diff --git a/board/najv4.c b/board/najv4.c index c341610..e2c0b46 100644 --- a/board/najv4.c +++ b/board/najv4.c @@ -1,5 +1,6 @@ #include +#include #include #include #include diff --git a/board/qr.c b/board/qr.c index 72fbc3d..7af7c15 100644 --- a/board/qr.c +++ b/board/qr.c @@ -1,6 +1,7 @@ #include #include #include +#include #include "board/qr.h" diff --git a/board/sg-nfc.c b/board/sg-nfc.c index 9709c81..de99115 100644 --- a/board/sg-nfc.c +++ b/board/sg-nfc.c @@ -354,13 +354,13 @@ static HRESULT sg_nfc_poll_felica( felica->type = 0x20; felica->id_len = sizeof(felica->IDm) + sizeof(felica->PMm); felica->IDm = _byteswap_uint64(IDm); - felica->PMm = _byteswap_uint64(felica_get_generic_PMm()); + felica->PMm = _byteswap_uint64(felica_get_amusement_ic_PMm()); /* Initialize FeliCa IC emulator */ nfc->felica.IDm = IDm; - nfc->felica.PMm = felica_get_generic_PMm(); - nfc->felica.system_code = 0x0000; + nfc->felica.PMm = felica_get_amusement_ic_PMm(); + nfc->felica.system_code = 0x88b4; return S_OK; } diff --git a/board/vfd.c b/board/vfd.c index 8c6ea29..e6e365b 100644 --- a/board/vfd.c +++ b/board/vfd.c @@ -10,7 +10,7 @@ */ #include - +#include #include #include diff --git a/exvs2hook/config.c b/exvs2hook/config.c index d3c737a..36025b4 100644 --- a/exvs2hook/config.c +++ b/exvs2hook/config.c @@ -1,4 +1,5 @@ #include +#include #include #include "exvs2hook/config.h" diff --git a/exvs2hook/meson.build b/exvs2hook/meson.build index 7408c98..3b45849 100644 --- a/exvs2hook/meson.build +++ b/exvs2hook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'exvs2hook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/exvs2io/meson.build b/exvs2io/meson.build index 736528e..8f33ab4 100644 --- a/exvs2io/meson.build +++ b/exvs2io/meson.build @@ -3,7 +3,6 @@ exvs2io_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ xinput_lib, ], diff --git a/ferrumhook/config.c b/ferrumhook/config.c index 7ded244..5c3ee5a 100644 --- a/ferrumhook/config.c +++ b/ferrumhook/config.c @@ -1,5 +1,6 @@ #include #include +#include #include "ferrumhook/config.h" diff --git a/ferrumhook/meson.build b/ferrumhook/meson.build index daff604..26032b4 100644 --- a/ferrumhook/meson.build +++ b/ferrumhook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'ferrumhook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/ferrumhook/xinput.c b/ferrumhook/xinput.c index 4564aae..2adbe1f 100644 --- a/ferrumhook/xinput.c +++ b/ferrumhook/xinput.c @@ -1,4 +1,6 @@ #include +#include +#include #include #include diff --git a/ferrumio/meson.build b/ferrumio/meson.build index 8f9e4af..e4b3998 100644 --- a/ferrumio/meson.build +++ b/ferrumio/meson.build @@ -3,7 +3,6 @@ ferrumio_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ xinput_lib, ], diff --git a/gfxhook/gfx.c b/gfxhook/gfx.c index 18b7bd3..b2f6b2c 100644 --- a/gfxhook/gfx.c +++ b/gfxhook/gfx.c @@ -130,12 +130,29 @@ static HWND WINAPI hook_CreateWindowExA( LPVOID lpParam ) { + RECT rect; dprintf("Gfx: CreateWindowExA hook hit\n"); - DWORD windowStyle = 0; + + if (gfx_config.windowed) { + if (gfx_config.framed) + dwStyle |= WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU; + else + dwStyle = WS_POPUP; + + rect.left = ((X == CW_USEDEFAULT) ? 0 : X); + rect.top = ((Y == CW_USEDEFAULT) ? 0 : Y); + rect.right = rect.left + nWidth; + rect.bottom = rect.top + nHeight; - windowStyle = WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; - - return next_CreateWindowExA(dwExStyle, lpClassName, lpWindowName, windowStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); + AdjustWindowRect(&rect, dwStyle, !!hMenu); + + X = ((X == CW_USEDEFAULT) ? X : rect.left); + Y = ((Y == CW_USEDEFAULT) ? Y : rect.top); + nWidth = rect.right - rect.left; + nHeight = rect.bottom - rect.top; + } + + return next_CreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); } static HWND WINAPI hook_CreateWindowExW( @@ -153,10 +170,27 @@ static HWND WINAPI hook_CreateWindowExW( LPVOID lpParam ) { + RECT rect; dprintf("Gfx: CreateWindowExW hook hit\n"); - DWORD windowStyle = 0; + + if (gfx_config.windowed) { + if (gfx_config.framed) + dwStyle |= WS_BORDER | WS_CAPTION | WS_MINIMIZEBOX | WS_SYSMENU; + else + dwStyle = WS_POPUP; + + rect.left = ((X == CW_USEDEFAULT) ? 0 : X); + rect.top = ((Y == CW_USEDEFAULT) ? 0 : Y); + rect.right = rect.left + nWidth; + rect.bottom = rect.top + nHeight; - windowStyle = WS_VISIBLE | WS_POPUP | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX; + AdjustWindowRect(&rect, dwStyle, !!hMenu); + + X = ((X == CW_USEDEFAULT) ? X : rect.left); + Y = ((Y == CW_USEDEFAULT) ? Y : rect.top); + nWidth = rect.right - rect.left; + nHeight = rect.bottom - rect.top; + } - return next_CreateWindowExW(dwExStyle, lpClassName, lpWindowName, windowStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); + return next_CreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); } \ No newline at end of file diff --git a/gfxhook/meson.build b/gfxhook/meson.build index b973ddd..5c28103 100644 --- a/gfxhook/meson.build +++ b/gfxhook/meson.build @@ -2,7 +2,6 @@ gfxhook_lib = static_library( 'gfxhook', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), dxguid_lib, diff --git a/hooklib/meson.build b/hooklib/meson.build index 47c4cab..b4f9f2c 100644 --- a/hooklib/meson.build +++ b/hooklib/meson.build @@ -2,7 +2,6 @@ hooklib_lib = static_library( 'hooklib', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), ], diff --git a/hooklib/reg.c b/hooklib/reg.c index fe890a5..bcce057 100644 --- a/hooklib/reg.c +++ b/hooklib/reg.c @@ -214,6 +214,7 @@ static bool reg_hook_initted; static CRITICAL_SECTION reg_hook_lock; static struct reg_hook_key *reg_hook_keys; static size_t reg_hook_nkeys; +static FARPROC n_RegOpenKeyExW; HRESULT reg_hook_push_key( HKEY root, @@ -229,6 +230,15 @@ HRESULT reg_hook_push_key( assert(name != NULL); assert(vals != NULL || nvals == 0); + + /* + Some games do a funny thing where they query keys as W but open then as A, and never + import RegOpenKeyExW, meaning next_RegOpenKeyExW is null. This checks for that and, in + those cases, uses GetProcAddress. + */ + HMODULE adv = LoadLibrary("ADVAPI32.DLL"); + n_RegOpenKeyExW = GetProcAddress(adv, "RegOpenKeyExW"); + reg_hook_init(); /*dprintf("Pushing reg key %ls:\n", name); @@ -382,13 +392,11 @@ static LSTATUS reg_hook_open_locked( this virtual registry key. We open a read-only handle to an arbitrary registry key that we can reliably assume exists and isn't one of the hardcoded root handles. HKLM\SOFTWARE will suffice for this purpose. */ - - err = next_RegOpenKeyExW( - HKEY_LOCAL_MACHINE, - L"SOFTWARE", - 0, - KEY_READ, - out); + if (next_RegOpenKeyExW == NULL) { + err = n_RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE", 0, KEY_READ, out); + } else { + err = next_RegOpenKeyExW(HKEY_LOCAL_MACHINE, L"SOFTWARE", 0, KEY_READ, out); + } if (err == ERROR_SUCCESS) { key->handle = *out; @@ -482,7 +490,11 @@ static LSTATUS WINAPI hook_RegOpenKeyExW( if (*out != NULL) { //dprintf("Registry: Opened virtual key %S\n", name); } else { - err = next_RegOpenKeyExW(parent, name, flags, access, out); + if (next_RegOpenKeyExW == NULL) { + err = n_RegOpenKeyExW(parent, name, flags, access, out); + } else { + err = next_RegOpenKeyExW(parent, name, flags, access, out); + } } } @@ -899,6 +911,11 @@ static LSTATUS WINAPI hook_RegGetValueW( key = reg_hook_match_key_locked(handle); } else { err = hook_RegOpenKeyExW(handle, subkey, flags, 1, &tmp); + if (err != ERROR_SUCCESS && err != ERROR_SHARING_VIOLATION) { + dprintf("Registry: hook_RegOpenKeyExW ERROR %08ld -> %ls\\%ls\n", err, subkey, name); + return err; + } + key = reg_hook_match_key_locked(tmp); } diff --git a/hooklib/spike.c b/hooklib/spike.c index f06166c..d86afbb 100644 --- a/hooklib/spike.c +++ b/hooklib/spike.c @@ -1,5 +1,5 @@ #include - +#include #include #include #include diff --git a/iccard/aime.c b/iccard/aime.c index 9957dd3..d32e5cf 100644 --- a/iccard/aime.c +++ b/iccard/aime.c @@ -1,3 +1,5 @@ +#include +#include #include #include #include diff --git a/iccard/felica.c b/iccard/felica.c index 09e3a77..9b8cedc 100644 --- a/iccard/felica.c +++ b/iccard/felica.c @@ -1,5 +1,6 @@ #include +#include #include #include #include @@ -21,11 +22,21 @@ static HRESULT felica_cmd_get_system_code( struct const_iobuf *req, struct iobuf *res); -static HRESULT felica_cmd_nda_a4( +static HRESULT felica_cmd_active( struct felica *f, struct const_iobuf *req, struct iobuf *res); +static HRESULT felica_cmd_read_without_encryption( + struct felica *f, + struct const_iobuf *req, + struct iobuf *res); + +static HRESULT felica_cmd_write_without_encryption( + struct felica* f, + struct const_iobuf* req, + struct iobuf* res); + uint64_t felica_get_generic_PMm(void) { /* A FeliCa PMm contains low-level protocol timing information for @@ -40,6 +51,16 @@ uint64_t felica_get_generic_PMm(void) return 0x01168B868FBECBFFULL; } +uint64_t felica_get_amusement_ic_PMm(void) +{ + /* + * AIC Card PMm, if this is returned from the card, + * the aimelib will access the actual blocks for authentication. + */ + + return 0x00F1000000014300; +} + HRESULT felica_transact( struct felica *f, struct const_iobuf *req, @@ -90,8 +111,8 @@ HRESULT felica_transact( case FELICA_CMD_GET_SYSTEM_CODE: return felica_cmd_get_system_code(f, req, res); - case FELICA_CMD_NDA_A4: - return felica_cmd_nda_a4(f, req, res); + case FELICA_CMD_ACTIVE: + return felica_cmd_active(f, req, res); default: dprintf("FeliCa: Unimplemented command %02x, payload:\n", code); @@ -184,7 +205,7 @@ static HRESULT felica_cmd_get_system_code( return S_OK; } -static HRESULT felica_cmd_nda_a4( +static HRESULT felica_cmd_active( struct felica *f, struct const_iobuf *req, struct iobuf *res) @@ -194,3 +215,127 @@ static HRESULT felica_cmd_nda_a4( return iobuf_write_8(res, 0); } + +static HRESULT felica_cmd_read_without_encryption( + struct felica *f, + struct const_iobuf *req, + struct iobuf *res) +{ + HRESULT hr; + uint8_t system_code_count; + uint16_t* system_codes; + uint8_t read_block_count; + uint8_t* blocks; + size_t i; + + hr = iobuf_read_8(req, &system_code_count); + + if (FAILED(hr)) { + goto fail; + } + + system_codes = malloc(sizeof(uint16_t) * system_code_count); + if (!system_codes) goto fail; + + for (i = 0; i < system_code_count; i++) { + hr = iobuf_read_be16(req, system_codes + i); + + if (FAILED(hr)) { + goto fail; + } + } + + hr = iobuf_read_8(req, &read_block_count); + + if (FAILED(hr)) { + goto fail; + } + + blocks = malloc(read_block_count); + if (!system_codes) goto fail; + + for (i = 0; i < read_block_count; i++) { + // 0x80 + hr = iobuf_read_8(req, blocks + i); + + if (FAILED(hr)) { + goto fail; + } + + // actual block num + hr = iobuf_read_8(req, blocks + i); + + if (FAILED(hr)) { + goto fail; + } + } + + // status + hr = iobuf_write_be16(res, 0); + + if (FAILED(hr)) { + goto fail; + } + + // block count + hr = iobuf_write_8(res, read_block_count); + + if (FAILED(hr)) { + goto fail; + } + + // block data + for (i = 0; i < read_block_count; i++) + { + dprintf("FeliCa: Read block %x\n", blocks[i]); + + switch (blocks[i]) { + case 0x82: { + hr = iobuf_write_be64(res, f->IDm); + + if (FAILED(hr)) + { + goto fail; + } + + hr = iobuf_write_be64(res, 0x0078000000000000ull); + + if (FAILED(hr)) + { + goto fail; + } + } + default: { + hr = iobuf_write_be64(res, 0); + + if (FAILED(hr)) + { + goto fail; + } + + hr = iobuf_write_be64(res, 0); + + if (FAILED(hr)) + { + goto fail; + } + } + } + } + + hr = S_OK; + +fail: + if (system_codes) free(system_codes); + if (blocks) free(blocks); + + return hr; +} + +static HRESULT felica_cmd_write_without_encryption( + struct felica* f, + struct const_iobuf* req, + struct iobuf* res) +{ + return iobuf_write_be16(res, 0); +} diff --git a/iccard/felica.h b/iccard/felica.h index 33be201..be4f4e1 100644 --- a/iccard/felica.h +++ b/iccard/felica.h @@ -8,9 +8,11 @@ #include "hook/iobuf.h" enum { - FELICA_CMD_POLL = 0x00, - FELICA_CMD_GET_SYSTEM_CODE = 0x0c, - FELICA_CMD_NDA_A4 = 0xa4, + FELICA_CMD_POLL = 0x00, + FELICA_READ_WITHOUT_ENCRYPTION = 0x06, + FELICA_WRITE_WITHOUT_ENCRYPTION = 0x08, + FELICA_CMD_GET_SYSTEM_CODE = 0x0c, + FELICA_CMD_ACTIVE = 0xa4, }; struct felica { @@ -25,3 +27,4 @@ HRESULT felica_transact( struct iobuf *res); uint64_t felica_get_generic_PMm(void); +uint64_t felica_get_amusement_ic_PMm(void); diff --git a/iccard/meson.build b/iccard/meson.build index 6cad0a0..a5c1681 100644 --- a/iccard/meson.build +++ b/iccard/meson.build @@ -2,7 +2,6 @@ iccard_lib = static_library( 'iccard', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), ], diff --git a/jvs/meson.build b/jvs/meson.build index 49737a0..14a7f66 100644 --- a/jvs/meson.build +++ b/jvs/meson.build @@ -2,7 +2,6 @@ jvs_lib = static_library( 'jvs', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), ], diff --git a/kizunahook/config.c b/kizunahook/config.c index a1f75ec..a093b24 100644 --- a/kizunahook/config.c +++ b/kizunahook/config.c @@ -1,4 +1,5 @@ #include +#include #include #include "kizunahook/config.h" diff --git a/kizunahook/meson.build b/kizunahook/meson.build index 059e0a4..601d73e 100644 --- a/kizunahook/meson.build +++ b/kizunahook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'kizunahook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/kizunaio/meson.build b/kizunaio/meson.build index e7a2316..037141e 100644 --- a/kizunaio/meson.build +++ b/kizunaio/meson.build @@ -3,7 +3,6 @@ kizunaio_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ xinput_lib, ], diff --git a/meson.build b/meson.build index 3894773..89077f0 100644 --- a/meson.build +++ b/meson.build @@ -13,7 +13,7 @@ add_project_arguments( '-DWIN32_LEAN_AND_MEAN', '-D_WIN32_WINNT=_WIN32_WINNT_WIN7', '-DMINGW_HAS_SECURE_API=1', - '-Wno-unused', + '-Db_pch=false', language: 'c', ) @@ -21,6 +21,7 @@ if meson.get_compiler('c').get_id() != 'msvc' add_project_arguments( '-ffunction-sections', '-fdata-sections', + '-Wno-unused', language: 'c', ) diff --git a/mkachook/config.c b/mkachook/config.c index f2df06a..b0c04a8 100644 --- a/mkachook/config.c +++ b/mkachook/config.c @@ -1,5 +1,6 @@ #include #include +#include #include "mkachook/config.h" diff --git a/mkachook/meson.build b/mkachook/meson.build index e1e2231..f2d2fef 100644 --- a/mkachook/meson.build +++ b/mkachook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'mkachook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/mkachook/xinput.c b/mkachook/xinput.c index 78eb5fb..6b01752 100644 --- a/mkachook/xinput.c +++ b/mkachook/xinput.c @@ -1,6 +1,8 @@ #include #include #include +#include +#include #ifdef __GNUC__ #include diff --git a/mkacio/meson.build b/mkacio/meson.build index fed8e6c..8f86a84 100644 --- a/mkacio/meson.build +++ b/mkacio/meson.build @@ -3,7 +3,6 @@ mkacio_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ xinput_lib, ], diff --git a/msvc-build.bat b/msvc-build.bat new file mode 100644 index 0000000..669b31e --- /dev/null +++ b/msvc-build.bat @@ -0,0 +1,73 @@ +@echo off +set BUILD_DIR=build +set BUILD_DIR_32=%BUILD_DIR%\build32 +set BUILD_DIR_64=%BUILD_DIR%\build64 +set BUILD_DIR_ZIP=%BUILD_DIR%\zip +set DIST_DIR=dist +set DOC_DIR=doc + +REM Set Your Visual Studio install path if this one was wrong +if "%VS_INSTALLATION%"=="" set VS_INSTALLATION=C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools + +if /I "%1"=="build" ( + call :build + exit /b +) +if /I "%1"=="zip" ( + powershell -NoProfile -ExecutionPolicy Bypass -Command "& './package.ps1'" + exit /b +) + +echo %~nx0 [action] +echo build: Build the for both x86 and x64 +echo zip: Make zip file +exit /b + +:build ( + REM Check VC++ + set VSVARALL="%VS_INSTALLATION%\VC\Auxiliary\Build\vcvarsall.bat" + if not exist %VSVARALL% ( + echo Build tools for Microsoft Visual C++ 2022 is not Installed + echo Edit this file to change the VS_INSTALLATION if you are installed the Visual Studio in other path + goto end + ) + + REM Check Meson + for /f "tokens=* usebackq" %%i in (`where meson`) do set MESON="%%i" + if not exist %MESON% ( + echo Meson is not Installed + goto end + ) + + :build_x64 ( + call %VSVARALL% x64 + + if exist %BUILD_DIR_64% ( + %MESON% setup %BUILD_DIR_64% --backend vs --buildtype release --reconfigure + ) else ( + %MESON% setup %BUILD_DIR_64% --backend vs --buildtype release + ) + + pushd %BUILD_DIR_64% + msbuild /m /p:Configuration=release /p:Platform=x64 segatools.sln + popd + ) + + :build_x86 ( + call %VSVARALL% x86 + + if exist %BUILD_DIR_32% ( + %MESON% setup %BUILD_DIR_32% --backend vs --buildtype release --reconfigure + ) else ( + %MESON% setup %BUILD_DIR_32% --backend vs --buildtype release + ) + + pushd %BUILD_DIR_32% + msbuild /m /p:Configuration=release /p:Platform=Win32 segatools.sln + popd + ) + + :end ( + endlocal + ) +) diff --git a/package.ps1 b/package.ps1 new file mode 100644 index 0000000..bae0e6c --- /dev/null +++ b/package.ps1 @@ -0,0 +1,96 @@ +if ($null -eq $env:BUILD_DIR) { + $BUILD_DIR="build" + $BUILD_DIR_32="$BUILD_DIR\build32" + $BUILD_DIR_64="$BUILD_DIR\build64" + $BUILD_DIR_ZIP="$BUILD_DIR\zip" + $DIST_DIR="dist" + $DOC_DIR="doc" +} else { + $BUILD_DIR = $env:BUILD_DIR; + $BUILD_DIR_32 = $env:BUILD_DIR_32; + $BUILD_DIR_64 = $env:BUILD_DIR_64; + $BUILD_DIR_ZIP = $env:BUILD_DIR_ZIP; + $DIST_DIR = $env:DIST_DIR; + $DOC_DIR = $env:DOC_DIR; +} + +$target = $null; +$line = ''; +[System.Collections.ArrayList]$files = @(); +$folder = Get-Location + +cat .\Package.mk | % { + $trimmed = $_.TrimEnd('\'). + TrimStart("`t "). + Replace('$(V)', ''). + Replace('$(BUILD_DIR)', $BUILD_DIR). + Replace('$(BUILD_DIR_32)', $BUILD_DIR_32). + Replace('$(BUILD_DIR_64)', $BUILD_DIR_64). + Replace('$(BUILD_DIR_ZIP)', $BUILD_DIR_ZIP). + Replace('$(DIST_DIR)', $DIST_DIR). + Replace('$(DOC_DIR)', $DOC_DIR). + Replace('$@', $target). + Replace('/', '\'); + + if ($trimmed.EndsWith(': ') -or $trimmed.EndsWith(':')) { + $target = $trimmed.TrimEnd(': '); + $line = ''; + $files.Clear(); + cd $folder; + + return; + } + + if (-not $trimmed.StartsWith('|')) { + $line += $trimmed; + + if ($_.EndsWith('\')) { + return; + } + } + + $line.Split(';') | % { + $cmd = $_.Trim(' '); + if ($cmd.StartsWith('echo')) { + echo $cmd.TrimStart('echo ') + } elseif ($cmd.StartsWith('mkdir')) { + $cmd = $cmd.Replace('-p', '-Force') + echo " - $cmd" + Invoke-Expression $cmd | Out-Null + } elseif ($cmd.StartsWith('cp')) { + $tokens = $cmd.Replace('cp ', '').Split(' '); + $srcs = $tokens[0..($tokens.Count - 2)]; + $dest = $tokens[$tokens.Count - 1]; + echo " - cp -Path $srcs -Destination $dest"; + cp -Path $srcs -Destination $dest + } elseif ($cmd.StartsWith('cd')) { + echo " - $cmd" + Invoke-Expression $cmd | Out-Null + } elseif ($cmd.StartsWith('zip ')) { + $tokens = $cmd.Substring(4, $cmd.Length - 4).Replace('-r ', '').Replace('-j ', '').Replace('*', '.\*'); + $tokens = $tokens.Split(' '); + $target = $tokens[0] + + if (-not $tokens.Contains('$^')) { + $files.AddRange($tokens[1..($tokens.Count - 1)]); + } + + echo " - Compress-Archive -Path $files -DestinationPath $target -Force" + Compress-Archive -Path $files -DestinationPath $target -Force + } else { + $allExists = $true + $args = $cmd.Split(' '); + $args | ? { -not $_ -eq '' } | % { + if (-not (Test-Path $_)) { + $allExists = $false + } + } + + if ($allExists) { + $files.AddRange($args); + } + } + } + + $line = ''; +} diff --git a/platform/amactivator.c b/platform/amactivator.c new file mode 100644 index 0000000..20216f6 --- /dev/null +++ b/platform/amactivator.c @@ -0,0 +1,179 @@ +#include "platform/amactivator.h" +#include "platform/es3sec.h" + +#include +#include +#include +#include + +#include "hook/table.h" +#include "util/dprintf.h" + +HANDLE amactivator_handle; + +static HANDLE my_AMActivator_Create(); +static uint64_t my_AMActivator_SetUSBSerialID(HANDLE amactivator, char* serial); +static uint64_t my_AMActivator_SetUSBProductID(HANDLE amactivator, char* product_id); +static uint64_t my_AMActivator_SetUSBVendorID(HANDLE amactivator, char* vendor_id); +static uint64_t my_AMActivator_SetUSBBitLockerPassword(HANDLE amactivator, char* password); +/*static uint64_t my_AMActivator_SetDevelopmentMode(); +static uint64_t my_AMActivator_BitLockerUnlock(); +static uint64_t my_AMActivator_RequestSignature(); +static uint64_t my_AMActivator_Update(); +static uint64_t my_AMActivator_IsBusy(); +static uint64_t my_AMActivator_RequestOneTimeKey(); +static uint64_t my_AMActivator_Restore(); +static uint64_t my_AMActivator_GetSignatureGeneration(); +static uint64_t my_AMActivator_GetSignatureLastStatus(); +static uint64_t my_AMActivator_GetOneTimeKey(); +static uint64_t my_AMActivator_GetOneTimeKeyExpiration(); +static uint64_t my_AMActivator_GetOneTimeKeyLastStatus();*/ + +static HANDLE (*next_AMActivator_Create)(); +static uint64_t (*next_AMActivator_SetUSBSerialID)(HANDLE amactivator, char* serial); +static uint64_t (*next_AMActivator_SetUSBProductID)(HANDLE amactivator, char* product_id); +static uint64_t (*next_AMActivator_SetUSBVendorID)(HANDLE amactivator, char* vendor_id); +static uint64_t (*next_AMActivator_SetUSBBitLockerPassword)(HANDLE amactivator, char* password); +/*static uint64_t (*next_AMActivator_SetDevelopmentMode)(); +static uint64_t (*next_AMActivator_BitLockerUnlock)(); +static uint64_t (*next_AMActivator_RequestSignature)(); +static uint64_t (*next_AMActivator_Update)(); +static uint64_t (*next_AMActivator_IsBusy)(); +static uint64_t (*next_AMActivator_RequestOneTimeKey)(); +static uint64_t (*next_AMActivator_Restore)(); +static uint64_t (*next_AMActivator_GetSignatureGeneration)(); +static uint64_t (*next_AMActivator_GetSignatureLastStatus)(); +static uint64_t (*next_AMActivator_GetOneTimeKey)(); +static uint64_t (*next_AMActivator_GetOneTimeKeyExpiration)(); +static uint64_t (*next_AMActivator_GetOneTimeKeyLastStatus)();*/ + +static const struct hook_symbol activator_syms[] = { + { + .name = "AMActivator_Create", + .patch = my_AMActivator_Create, + .link = (void **) &next_AMActivator_Create, + }, + { + .name = "AMActivator_SetUSBSerialID", + .patch = my_AMActivator_SetUSBSerialID, + .link = (void **) &next_AMActivator_SetUSBSerialID, + }, + { + .name = "AMActivator_SetUSBProductID", + .patch = my_AMActivator_SetUSBProductID, + .link = (void **) &next_AMActivator_SetUSBProductID, + }, + { + .name = "AMActivator_SetUSBVendorID", + .patch = my_AMActivator_SetUSBVendorID, + .link = (void **) &next_AMActivator_SetUSBVendorID, + }, + { + .name = "AMActivator_SetUSBBitLockerPassword", + .patch = my_AMActivator_SetUSBBitLockerPassword, + .link = (void **) &next_AMActivator_SetUSBBitLockerPassword, + }/*, + { + .name = "AMActivator_SetDevelopmentMode", + .patch = my_AMActivator_SetDevelopmentMode, + .link = (void **) &next_AMActivator_SetDevelopmentMode, + }, + { + .name = "AMActivator_BitLockerUnlock", + .patch = my_AMActivator_BitLockerUnlock, + .link = (void **) &next_AMActivator_BitLockerUnlock, + }, + { + .name = "AMActivator_RequestSignature", + .patch = my_AMActivator_RequestSignature, + .link = (void **) &next_AMActivator_RequestSignature, + }, + { + .name = "AMActivator_Update", + .patch = my_AMActivator_Update, + .link = (void **) &next_AMActivator_Update, + }, + { + .name = "AMActivator_IsBusy", + .patch = my_AMActivator_IsBusy, + .link = (void **) &next_AMActivator_IsBusy, + }, + { + .name = "AMActivator_RequestOneTimeKey", + .patch = my_AMActivator_RequestOneTimeKey, + .link = (void **) &next_AMActivator_RequestOneTimeKey, + }, + { + .name = "AMActivator_Restore", + .patch = my_AMActivator_Restore, + .link = (void **) &next_AMActivator_Restore, + }, + { + .name = "AMActivator_GetSignatureGeneration", + .patch = my_AMActivator_GetSignatureGeneration, + .link = (void **) &next_AMActivator_GetSignatureGeneration, + }, + { + .name = "AMActivator_GetSignatureLastStatus", + .patch = my_AMActivator_GetSignatureLastStatus, + .link = (void **) &next_AMActivator_GetSignatureLastStatus, + }, + { + .name = "AMActivator_GetOneTimeKey", + .patch = my_AMActivator_GetOneTimeKey, + .link = (void **) &next_AMActivator_GetOneTimeKey, + }, + { + .name = "AMActivator_GetOneTimeKeyExpiration", + .patch = my_AMActivator_GetOneTimeKeyExpiration, + .link = (void **) &next_AMActivator_GetOneTimeKeyExpiration, + }, + { + .name = "AMActivator_GetOneTimeKeyLastStatus", + .patch = my_AMActivator_GetOneTimeKeyLastStatus, + .link = (void **) &next_AMActivator_GetOneTimeKeyLastStatus, + }*/ +}; + +HRESULT amactivator_hook_init(const struct amactivator_config* cfg, const struct es3sec_config* dong_cfg) { + if (!cfg->enable) { + return S_OK; + } + + dprintf("AMActivator: init\n"); + + hook_table_apply( + NULL, + "amactivator.dll", + activator_syms, + _countof(activator_syms)); + + return S_OK; +} + +static HANDLE my_AMActivator_Create() { + dprintf("AMActivator: Create\n"); + amactivator_handle = next_AMActivator_Create(); + return amactivator_handle; +} + +static uint64_t my_AMActivator_SetUSBSerialID(HANDLE amactivator, char* serial) { + dprintf("AMActivator: SetUSBSerialID %s\n", serial); + //return next_AMActivator_SetUSBSerialID(amactivator, serial); + return 0; +} + +static uint64_t my_AMActivator_SetUSBProductID(HANDLE amactivator, char* product_id) { + dprintf("AMActivator: SetUSBProductID %s\n", product_id); + return next_AMActivator_SetUSBProductID(amactivator, product_id); +} + +static uint64_t my_AMActivator_SetUSBVendorID(HANDLE amactivator, char* vendor_id) { + dprintf("AMActivator: SetUSBVendorID %s\n", vendor_id); + return next_AMActivator_SetUSBVendorID(amactivator, vendor_id); +} + +static uint64_t my_AMActivator_SetUSBBitLockerPassword(HANDLE amactivator, char* password) { + dprintf("AMActivator: SetUSBBitLockerPassword %s\n", password); + return next_AMActivator_SetUSBBitLockerPassword(amactivator, password); +} diff --git a/platform/amactivator.h b/platform/amactivator.h new file mode 100644 index 0000000..f7f84da --- /dev/null +++ b/platform/amactivator.h @@ -0,0 +1,12 @@ +#pragma once +#include +#include +#include + +#include "platform/es3sec.h" + +struct amactivator_config { + bool enable; +}; + +HRESULT amactivator_hook_init(const struct amactivator_config* cfg, const struct es3sec_config* dong_cfg); diff --git a/platform/clock.c b/platform/clock.c index e163961..0a07870 100644 --- a/platform/clock.c +++ b/platform/clock.c @@ -1,5 +1,5 @@ #include - +#include #include #include diff --git a/platform/config.c b/platform/config.c index df820a9..f399348 100644 --- a/platform/config.c +++ b/platform/config.c @@ -33,6 +33,7 @@ void platform_config_load(struct platform_config *cfg, const wchar_t *filename) misc_config_load(&cfg->misc, filename); es3sec_config_load(&cfg->dongle, filename); epay_config_load(&cfg->epay, filename); + amactivator_config_load(&cfg->amactivator, filename); } void vfs_config_load(struct vfs_config *cfg, const wchar_t *filename) @@ -251,3 +252,8 @@ void epay_config_load(struct epay_config *cfg, const wchar_t *filename) { cfg->enable = GetPrivateProfileIntW(L"dongle", L"enable", 1, filename); } + +void amactivator_config_load(struct amactivator_config *cfg, const wchar_t *filename) +{ + cfg->enable = GetPrivateProfileIntW(L"amactivator", L"enable", 1, filename); +} diff --git a/platform/config.h b/platform/config.h index 3868e1e..dfae401 100644 --- a/platform/config.h +++ b/platform/config.h @@ -1,12 +1,13 @@ #pragma once #include - +#include #include #include #include #include "platform/vfs.h" +#include "platform/amactivator.h" #include "platform/netenv.h" #include "platform/locale.h" #include "platform/clock.h" @@ -37,3 +38,5 @@ void misc_config_load(struct misc_config *cfg, const wchar_t *filename); void es3sec_config_load(struct es3sec_config *cfg, const wchar_t *filename); void epay_config_load(struct epay_config *cfg, const wchar_t *filename); + +void amactivator_config_load(struct amactivator_config *cfg, const wchar_t *filename); diff --git a/platform/es3sec.c b/platform/es3sec.c index 447bdfb..c1b116e 100644 --- a/platform/es3sec.c +++ b/platform/es3sec.c @@ -1,6 +1,9 @@ #include +#include +#include #include #include +#include #include "hook/table.h" #include "hook/iohook.h" diff --git a/platform/locale.c b/platform/locale.c index dcb6535..550e7e1 100644 --- a/platform/locale.c +++ b/platform/locale.c @@ -1,4 +1,5 @@ #include +#include #include "hook/table.h" diff --git a/platform/meson.build b/platform/meson.build index 45cb228..a921299 100644 --- a/platform/meson.build +++ b/platform/meson.build @@ -2,7 +2,6 @@ platform_lib = static_library( 'platform', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), shlwapi_lib, @@ -35,5 +34,7 @@ platform_lib = static_library( 'vfs.h', 'es3sec.c', 'es3sec.h', + 'amactivator.c', + 'amactivator.h', ], ) diff --git a/platform/misc.c b/platform/misc.c index e7281af..60e304a 100644 --- a/platform/misc.c +++ b/platform/misc.c @@ -1,8 +1,9 @@ #include - +#include #include #include #include +#include #include "hook/table.h" #include "hooklib/reg.h" @@ -22,6 +23,9 @@ static int my_snprintf(char *const buffer, const size_t buffer_count, const char static int (*next_snprintf)(char *const buffer, const size_t buffer_count, const char *const format, ...); static HRESULT reg_read_sys_ver(void *bytes, uint32_t *nbytes); +static HRESULT reg_read_display_ver(void *bytes, uint32_t *nbytes); +static HRESULT reg_read_product_name(void *bytes, uint32_t *nbytes); +static HRESULT reg_read_release_id(void *bytes, uint32_t *nbytes); static BOOL (WINAPI *next_BlockInput)(BOOL fBlockIt); static int (WINAPI *next_ShowCursor)(BOOL bShow); @@ -71,6 +75,24 @@ static const struct reg_hook_val nbgi_reg[] = { } }; +static const struct reg_hook_val winver_reg[] = { + { + .name = L"DisplayVersion", + .type = REG_SZ, + .read = reg_read_display_ver + }, + { + .name = L"ProductName", + .type = REG_SZ, + .read = reg_read_product_name + }, + { + .name = L"ReleaseId", + .type = REG_SZ, + .read = reg_read_release_id + } +}; + HRESULT misc_hook_init(const struct misc_config *cfg) { assert(cfg != NULL); @@ -102,6 +124,12 @@ HRESULT misc_hook_init(const struct misc_config *cfg) L"SOFTWARE\\NBGI", nbgi_reg, _countof(nbgi_reg)); + + reg_hook_push_key( + HKEY_LOCAL_MACHINE, + L"SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion", + winver_reg, + _countof(winver_reg)); return S_OK; } @@ -159,6 +187,24 @@ static HRESULT reg_read_sys_ver(void *bytes, uint32_t *nbytes) return reg_hook_read_wstr(bytes, nbytes, config.system_version); } +static HRESULT reg_read_display_ver(void *bytes, uint32_t *nbytes) +{ + dprintf("Misc: Get display version\n"); + return reg_hook_read_wstr(bytes, nbytes, L"22H2"); +} + +static HRESULT reg_read_product_name(void *bytes, uint32_t *nbytes) +{ + dprintf("Misc: Get system version\n"); + return reg_hook_read_wstr(bytes, nbytes, L"Windows 10 Enterprise 2016 LTSB"); +} + +static HRESULT reg_read_release_id(void *bytes, uint32_t *nbytes) +{ + dprintf("Misc: Get release ID\n"); + return reg_hook_read_wstr(bytes, nbytes, L"1607"); +} + static UINT WINAPI my_GetDriveTypeA(LPCSTR lpRootPathName) { dprintf("Misc: Get Drive Type for %s\n", lpRootPathName); diff --git a/platform/netenv.c b/platform/netenv.c index 0801011..a4fa16e 100644 --- a/platform/netenv.c +++ b/platform/netenv.c @@ -1,14 +1,17 @@ +#include #include #include #include #include -#include +#include #include #include #include +#include #include #include +#include #include "hook/table.h" @@ -68,7 +71,7 @@ static uint32_t WINAPI hook_IcmpSendEcho( static uint32_t WINAPI hook_IcmpSendEcho2( HANDLE IcmpHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, + FARPROC ApcRoutine, void *ApcContext, uint32_t DestinationAddress, void *RequestData, @@ -106,7 +109,7 @@ static uint32_t (WINAPI *next_GetIfTable)( static uint32_t (WINAPI *next_IcmpSendEcho2)( HANDLE IcmpHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, + FARPROC ApcRoutine, void *ApcContext, uint32_t DestinationAddress, void *RequestData, @@ -465,7 +468,7 @@ static uint32_t WINAPI hook_GetIfTable( static uint32_t WINAPI hook_IcmpSendEcho2( HANDLE IcmpHandle, HANDLE Event, - PIO_APC_ROUTINE ApcRoutine, + FARPROC ApcRoutine, void *ApcContext, uint32_t DestinationAddress, void *RequestData, diff --git a/platform/platform.c b/platform/platform.c index 4e9b8de..5a71f56 100644 --- a/platform/platform.c +++ b/platform/platform.c @@ -1,3 +1,5 @@ +#include + #include "platform/platform.h" HRESULT platform_hook_init( @@ -69,5 +71,11 @@ HRESULT platform_hook_init( return hr; } + hr = amactivator_hook_init(&cfg->amactivator, &cfg->dongle); + + if (FAILED(hr)) { + return hr; + } + return S_OK; } diff --git a/platform/platform.h b/platform/platform.h index bc6356a..7e32a98 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -9,6 +9,7 @@ #include "platform/vfs.h" #include "platform/es3sec.h" #include "platform/epay.h" +#include "platform/amactivator.h" struct dongle_info { USHORT pid; @@ -27,6 +28,7 @@ struct platform_config { struct vfs_config vfs; struct es3sec_config dongle; struct epay_config epay; + struct amactivator_config amactivator; }; enum platform_type { diff --git a/saohook/config.c b/saohook/config.c index 79c3d58..4652cfc 100644 --- a/saohook/config.c +++ b/saohook/config.c @@ -1,5 +1,6 @@ #include #include +#include #include "saohook/config.h" diff --git a/saohook/meson.build b/saohook/meson.build index 5b16d4a..9e215fc 100644 --- a/saohook/meson.build +++ b/saohook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'saohook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/saohook/systype.c b/saohook/systype.c index 7828774..2b6a09c 100644 --- a/saohook/systype.c +++ b/saohook/systype.c @@ -1,4 +1,5 @@ #include +#include #include "hook/table.h" #include "hooklib/reg.h" diff --git a/saohook/touch.c b/saohook/touch.c index 3c6665d..d1e7716 100644 --- a/saohook/touch.c +++ b/saohook/touch.c @@ -1,4 +1,6 @@ #include +#include +#include #include "hook/table.h" #include "hooklib/reg.h" diff --git a/saoio/meson.build b/saoio/meson.build index afa481f..359f9a3 100644 --- a/saoio/meson.build +++ b/saoio/meson.build @@ -3,7 +3,6 @@ saoio_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ xinput_lib, ], diff --git a/subprojects/capnhook.wrap b/subprojects/capnhook.wrap index 296df09..2358a9b 100644 --- a/subprojects/capnhook.wrap +++ b/subprojects/capnhook.wrap @@ -1,4 +1,4 @@ [wrap-git] directory = capnhook url = https://github.com/Hay1tsme/capnhook -revision = f060250e1b92dcb06946eb77742f0ab51755e158 \ No newline at end of file +revision = b595e4bf8a274ba3bdaf583e13a7ebc7efe0f48f \ No newline at end of file diff --git a/taikohook/config.c b/taikohook/config.c index 2eca9b2..dfbcca8 100644 --- a/taikohook/config.c +++ b/taikohook/config.c @@ -1,5 +1,6 @@ #include #include +#include #include "taikohook/config.h" diff --git a/taikohook/meson.build b/taikohook/meson.build index 8e57d00..e23c98d 100644 --- a/taikohook/meson.build +++ b/taikohook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'taikohook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/taikohook/network.c b/taikohook/network.c index 8351d13..959853c 100644 --- a/taikohook/network.c +++ b/taikohook/network.c @@ -1,4 +1,5 @@ #include +#include #include "taikohook/network.h" diff --git a/taikoio/meson.build b/taikoio/meson.build index 2cea435..0505576 100644 --- a/taikoio/meson.build +++ b/taikoio/meson.build @@ -3,7 +3,6 @@ taikoio_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ xinput_lib, ], diff --git a/tekkenhook/config.c b/tekkenhook/config.c index f3c7be4..f34e244 100644 --- a/tekkenhook/config.c +++ b/tekkenhook/config.c @@ -1,5 +1,6 @@ #include #include +#include #include "tekkenhook/config.h" diff --git a/tekkenhook/meson.build b/tekkenhook/meson.build index 036fcfa..7db4311 100644 --- a/tekkenhook/meson.build +++ b/tekkenhook/meson.build @@ -4,7 +4,6 @@ shared_library( include_directories : inc, implicit_include_directories : false, vs_module_defs : 'tekkenhook.def', - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), capnhook.get_variable('hooklib_dep'), diff --git a/tekkenio/meson.build b/tekkenio/meson.build index 58a8a24..f03b25f 100644 --- a/tekkenio/meson.build +++ b/tekkenio/meson.build @@ -3,7 +3,6 @@ tekkenio_lib = static_library( name_prefix : '', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', sources : [ 'tekkenio.c', 'tekkenio.h', diff --git a/util/hexstr.c b/util/hexstr.c index 1c41588..558725c 100644 --- a/util/hexstr.c +++ b/util/hexstr.c @@ -1,4 +1,5 @@ #include +#include #include #include #include "util/hexstr.h" diff --git a/util/lib.c b/util/lib.c index bd7a5eb..42f5c66 100644 --- a/util/lib.c +++ b/util/lib.c @@ -1,6 +1,7 @@ #include #include +#include wchar_t *module_file_name(HMODULE module) { diff --git a/util/meson.build b/util/meson.build index d7a646f..95f08b2 100644 --- a/util/meson.build +++ b/util/meson.build @@ -2,7 +2,6 @@ util_lib = static_library( 'util', include_directories : inc, implicit_include_directories : false, - c_pch : '../precompiled.h', dependencies : [ capnhook.get_variable('hook_dep'), ],