diff --git a/.github/workflows/format.yml b/.github/workflows/format.yml index 35eb3ad..7d2e77d 100644 --- a/.github/workflows/format.yml +++ b/.github/workflows/format.yml @@ -13,4 +13,4 @@ jobs: - uses: DeterminateSystems/nix-installer-action@v11 - uses: DeterminateSystems/magic-nix-cache-action@v6 - name: Check formatting - run: nix develop --command clang-format --dry-run -Werror src/**.c src/**.h + run: nix develop --command clang-format --dry-run -Werror src/**/*.c src/**/*.h diff --git a/src/common-fnptr.h b/src/common-fnptr.h index 012710c..2e8fcec 100644 --- a/src/common-fnptr.h +++ b/src/common-fnptr.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + /* * This file contains many function pointer types and structures for Windows * APIs. Many of these structures are not actually needed for this patcher, diff --git a/src/common.c b/src/common.c index 225a8c3..ec2f41f 100644 --- a/src/common.c +++ b/src/common.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "common.h" #define LOG_FILENAME "gglog.txt" diff --git a/src/common.h b/src/common.h index 91ee95b..3843e71 100644 --- a/src/common.h +++ b/src/common.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef COMMON_H #define COMMON_H diff --git a/src/config.c b/src/config.c index 4d57f14..e46ed07 100644 --- a/src/config.c +++ b/src/config.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "config.h" #include "hex.h" #include "json.h" diff --git a/src/config.h b/src/config.h index c2149ab..8440d63 100644 --- a/src/config.h +++ b/src/config.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef CONFIG_H #define CONFIG_H diff --git a/src/dll/rugburn/main.c b/src/dll/rugburn/main.c index 4f51c95..1930400 100644 --- a/src/dll/rugburn/main.c +++ b/src/dll/rugburn/main.c @@ -1,5 +1,21 @@ /** - * This is a shim for ijl15.dll that hooks various things. Its objectives are: + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + +/** + * This is a replacement for ijl15.dll that hooks various things. Its objectives are: * * - To fully disable GameGuard. * - To make using unmodified PangYa™ with custom servers easier. @@ -41,7 +57,6 @@ extern BOOL STDCALL DllMain(HANDLE hInstance, DWORD dwReason, LPVOID reserved) { return TRUE; } - InitLog(); InitEnvironment(); InitHooks(); diff --git a/src/exe/test/main.c b/src/exe/test/main.c index 66c088a..edd37a9 100644 --- a/src/exe/test/main.c +++ b/src/exe/test/main.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "../../common.h" #include "../../hex.h" #include "../../json.h" diff --git a/src/hex.c b/src/hex.c index 41a1db8..7c12779 100644 --- a/src/hex.c +++ b/src/hex.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "hex.h" static BOOL ParseHex(CHAR ch, LPDWORD pOutValue) { diff --git a/src/hex.h b/src/hex.h index 4dcf61f..c2b22c0 100644 --- a/src/hex.h +++ b/src/hex.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HEX_H #define HEX_H diff --git a/src/hooks/comctl32/dynamic_patch.c b/src/hooks/comctl32/dynamic_patch.c index d8e2cbb..96fd903 100644 --- a/src/hooks/comctl32/dynamic_patch.c +++ b/src/hooks/comctl32/dynamic_patch.c @@ -1,3 +1,22 @@ +/** + * Copyright 2018-2024 John Chadwick + * Copyright 2020 Luiz Lopes + * Copyright 2020-2021 fumitti + * Copyright 2024 Acrisio Filho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "dynamic_patch.h" #include "../../config.h" #include "../../hooks/projectg/us852/ranking.h" diff --git a/src/hooks/comctl32/dynamic_patch.h b/src/hooks/comctl32/dynamic_patch.h index 34538d3..a05d38f 100644 --- a/src/hooks/comctl32/dynamic_patch.h +++ b/src/hooks/comctl32/dynamic_patch.h @@ -1,3 +1,20 @@ +/** + * Copyright 2018-2024 John Chadwick + * Copyright 2024 Acrisio Filho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_COMCTL32_DYNAMIC_PATH #define HOOKS_COMCTL32_DYNAMIC_PATH diff --git a/src/hooks/hooks.c b/src/hooks/hooks.c index c387d39..3e9c375 100644 --- a/src/hooks/hooks.c +++ b/src/hooks/hooks.c @@ -1,11 +1,27 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "hooks.h" +#include "comctl32/dynamic_patch.h" #include "kernel32/inject.h" #include "msvcr100/msvcr100.h" #include "user32/window.h" #include "wininet/netredir.h" #include "ws2_32/redir.h" -#include "comctl32/dynamic_patch.h" VOID InitHooks() { InitInjectHook(); diff --git a/src/hooks/hooks.h b/src/hooks/hooks.h index b7ecac5..09b87ef 100644 --- a/src/hooks/hooks.h +++ b/src/hooks/hooks.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_HOOKS_H #define HOOKS_HOOKS_H diff --git a/src/hooks/kernel32/inject.c b/src/hooks/kernel32/inject.c index c51d0b0..d801189 100644 --- a/src/hooks/kernel32/inject.c +++ b/src/hooks/kernel32/inject.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "inject.h" #include "../../patch.h" @@ -36,8 +52,16 @@ static BOOL StrContains(LPCSTR lpHaystack, LPCSTR lpNeedle) { return FALSE; } -static BOOL STDCALL CreateProcessAHook(LPCSTR lpApplicationName, LPSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, LPSTARTUPINFOA lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation) { - Log("CreateProcessA(%s, %s, %08x, %08x, %d, %08x, %p, %s, %p, %p);\r\n", lpApplicationName, lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); +static BOOL STDCALL CreateProcessAHook(LPCSTR lpApplicationName, LPSTR lpCommandLine, + LPSECURITY_ATTRIBUTES lpProcessAttributes, + LPSECURITY_ATTRIBUTES lpThreadAttributes, + BOOL bInheritHandles, DWORD dwCreationFlags, + LPVOID lpEnvironment, LPCSTR lpCurrentDirectory, + LPSTARTUPINFOA lpStartupInfo, + LPPROCESS_INFORMATION lpProcessInformation) { + Log("CreateProcessA(%s, %s, %08x, %08x, %d, %08x, %p, %s, %p, %p);\r\n", lpApplicationName, + lpCommandLine, lpProcessAttributes, lpThreadAttributes, bInheritHandles, dwCreationFlags, + lpEnvironment, lpCurrentDirectory, lpStartupInfo, lpProcessInformation); if (lpApplicationName != NULL && StrContains(lpApplicationName, "GameGuard.des")) { lpProcessInformation->hProcess = hGameguardFakeHandle; } else { diff --git a/src/hooks/kernel32/inject.h b/src/hooks/kernel32/inject.h index c3dafc8..0c72ee7 100644 --- a/src/hooks/kernel32/inject.h +++ b/src/hooks/kernel32/inject.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_KERNEL32_INJECT_H #define HOOKS_KERNEL32_INJECT_H diff --git a/src/hooks/msvcr100/msvcr100.c b/src/hooks/msvcr100/msvcr100.c index e8035ad..ae60895 100644 --- a/src/hooks/msvcr100/msvcr100.c +++ b/src/hooks/msvcr100/msvcr100.c @@ -1,23 +1,39 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "msvcr100.h" #include "../../patch.h" -typedef int (__cdecl* STRICMPFNPTR)(const char *s1, const char *s2); -typedef char *(__cdecl* SETLOCALEFNPTR)(int category, const char *locale); +typedef int(__cdecl *STRICMPFNPTR)(const char *s1, const char *s2); +typedef char *(__cdecl *SETLOCALEFNPTR)(int category, const char *locale); static HMODULE hMsvcrModule = NULL; static STRICMPFNPTR pStricmp = NULL; static SETLOCALEFNPTR pSetLocale = NULL; -int lower(int c) { - return (c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c; -} +int lower(int c) { return (c >= 'A' && c <= 'Z') ? c + 'a' - 'A' : c; } int __cdecl StricmpHook(const char *s1, const char *s2) { int result = 0; - if (!s1 || !s2) return 0x7fffffff; + if (!s1 || !s2) + return 0x7fffffff; while (!result) { result = lower(*s1) - lower(*s2); - if (!*s1 || !*s2) break; + if (!*s1 || !*s2) + break; s1++, s2++; } return result; @@ -40,7 +56,9 @@ VOID InitMsvcr100Hook() { Log("Not checking for Wine _stricmp bug: msvcr100 functions not found.\n"); } - Log("Checking for Wine _stricmp bug in msvcr100; current locale: %s - Temporarily switching to Kor.\n", oldlocale); + Log("Checking for Wine _stricmp bug in msvcr100; current locale: %s - Temporarily switching to " + "Kor.\n", + oldlocale); pSetLocale(2, "Kor"); result = pStricmp("\xB3\xA1", "\xBC\xBC"); @@ -71,7 +89,9 @@ VOID InitMsvcr71Hook() { Log("Not checking for Wine _stricmp bug: msvcr71 functions not found.\n"); } - Log("Checking for Wine _stricmp bug in msvcr71; current locale: %s - Temporarily switching to Kor.\n", oldlocale); + Log("Checking for Wine _stricmp bug in msvcr71; current locale: %s - Temporarily switching to " + "Kor.\n", + oldlocale); pSetLocale(2, "Kor"); result = pStricmp("\xB3\xA1", "\xBC\xBC"); diff --git a/src/hooks/msvcr100/msvcr100.h b/src/hooks/msvcr100/msvcr100.h index ac0c56d..da53baf 100644 --- a/src/hooks/msvcr100/msvcr100.h +++ b/src/hooks/msvcr100/msvcr100.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_MSVCR100_MSVCR100_H #define HOOKS_MSVCR100_MSVCR100_H diff --git a/src/hooks/projectg/us852/ranking.c b/src/hooks/projectg/us852/ranking.c index 5f7fdf6..a3e4d78 100644 --- a/src/hooks/projectg/us852/ranking.c +++ b/src/hooks/projectg/us852/ranking.c @@ -1,3 +1,19 @@ +/** + * Copyright 2023 Acrisio Filho + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "ranking.h" #include "../../../patch.h" @@ -8,7 +24,8 @@ typedef struct _stMsgObject { DWORD m_time; } stMsgObject; -inline static stMsgObject MakeMsgObject(LPVOID _pIActor, DWORD _id, DWORD _c0, DWORD _c1, DWORD _c2, DWORD _c3, DWORD _c4) { +inline static stMsgObject MakeMsgObject(LPVOID _pIActor, DWORD _id, DWORD _c0, DWORD _c1, DWORD _c2, + DWORD _c3, DWORD _c4) { stMsgObject obj; obj.m_pIActor = _pIActor; obj.m_id = _id; @@ -23,26 +40,26 @@ inline static stMsgObject MakeMsgObject(LPVOID _pIActor, DWORD _id, DWORD _c0, D #define GETTHISPOINTERMEMBER(_type_, _addr_, _this_) (_type_ *)(((BYTE *)(_this_)) + (_addr_)) -typedef LPVOID (__cdecl *PFNMAKEINSTANCEFRLOGINRSDLG)(void); -typedef LPCSTR (STDCALL *PFNBRASILTRANSLATESTRINGPROC)(LPCSTR _str); -typedef VOID (STDCALL *PFNFRLOGINRSDLGSETSTATEPROC)(DWORD _state); - -typedef LPVOID (STDCALL *PFNFRFORM_INITPROC)(LPVOID, LPVOID, LPVOID, LPCSTR, LPVOID); -typedef LPVOID (STDCALL *PFNIOBJECTDYNAMICCASTPROC)(LPVOID, LPCVOID); -typedef LPVOID (STDCALL *PFNFRFORMLOGINRSDLGSCALARDELETINGDESTRUCTORPROC)(LPVOID, DWORD); - -typedef DWORD64 (STDCALL *PFNCSHAREDDOCISCONTROLSERVERSERVICEPROC)(LPVOID, DWORD64); -typedef VOID (STDCALL *PFNVIRTUALIACTORHANDLEMSGPROC)(LPVOID, stMsgObject *); -typedef VOID (STDCALL *PFNVIRTUALIACTORCLOSEALLDIALOGSPROC)(LPVOID); -typedef BOOL (STDCALL *PFNWNETWORKSYSTEMISCONNECTEDPROC)(LPVOID, DWORD); -typedef BOOL (STDCALL *PFNWNETWORKSYSTEMINITPROC)(LPVOID, DWORD); -typedef BOOL (STDCALL *PFNWNETWORKSYSTEMSENDMESSAGEAPROC)(LPVOID, DWORD, DWORD); -typedef VOID (STDCALL *PFNCONSTRUCTORWSENDPACKETPROC)(LPVOID, DWORD); -typedef VOID (STDCALL *PFNDESTRUCTORWSENDPACKETPROC)(LPVOID); -typedef VOID (STDCALL *PFNWSENDPACKETSENDPROC)(LPVOID, DWORD); -typedef VOID (STDCALL *PFNCLOBBYMAINCLEARTOOLTIPPROC)(LPVOID, LPVOID); -typedef BOOL (STDCALL *PFNFRLOGINRSDLGONLOGINRSDLGRESULTPROC)(LPVOID, DWORD, LPVOID); -typedef BOOL (STDCALL *PFNFRFORMOPENPROC)(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD); +typedef LPVOID(__cdecl *PFNMAKEINSTANCEFRLOGINRSDLG)(void); +typedef LPCSTR(STDCALL *PFNBRASILTRANSLATESTRINGPROC)(LPCSTR _str); +typedef VOID(STDCALL *PFNFRLOGINRSDLGSETSTATEPROC)(DWORD _state); + +typedef LPVOID(STDCALL *PFNFRFORM_INITPROC)(LPVOID, LPVOID, LPVOID, LPCSTR, LPVOID); +typedef LPVOID(STDCALL *PFNIOBJECTDYNAMICCASTPROC)(LPVOID, LPCVOID); +typedef LPVOID(STDCALL *PFNFRFORMLOGINRSDLGSCALARDELETINGDESTRUCTORPROC)(LPVOID, DWORD); + +typedef DWORD64(STDCALL *PFNCSHAREDDOCISCONTROLSERVERSERVICEPROC)(LPVOID, DWORD64); +typedef VOID(STDCALL *PFNVIRTUALIACTORHANDLEMSGPROC)(LPVOID, stMsgObject *); +typedef VOID(STDCALL *PFNVIRTUALIACTORCLOSEALLDIALOGSPROC)(LPVOID); +typedef BOOL(STDCALL *PFNWNETWORKSYSTEMISCONNECTEDPROC)(LPVOID, DWORD); +typedef BOOL(STDCALL *PFNWNETWORKSYSTEMINITPROC)(LPVOID, DWORD); +typedef BOOL(STDCALL *PFNWNETWORKSYSTEMSENDMESSAGEAPROC)(LPVOID, DWORD, DWORD); +typedef VOID(STDCALL *PFNCONSTRUCTORWSENDPACKETPROC)(LPVOID, DWORD); +typedef VOID(STDCALL *PFNDESTRUCTORWSENDPACKETPROC)(LPVOID); +typedef VOID(STDCALL *PFNWSENDPACKETSENDPROC)(LPVOID, DWORD); +typedef VOID(STDCALL *PFNCLOBBYMAINCLEARTOOLTIPPROC)(LPVOID, LPVOID); +typedef BOOL(STDCALL *PFNFRLOGINRSDLGONLOGINRSDLGRESULTPROC)(LPVOID, DWORD, LPVOID); +typedef BOOL(STDCALL *PFNFRFORMOPENPROC)(LPVOID, LPVOID, DWORD, DWORD, DWORD, DWORD); static PFNMAKEINSTANCEFRLOGINRSDLG pMakeInstanceFrLoginRsDlg = NULL; static PFNFRFORM_INITPROC p_Init = NULL; @@ -96,18 +113,16 @@ VOID InitUS852RankingHook() { pPerformLoginRsDlgScalarDeletingDestructor = (PFNFRFORMLOGINRSDLGSCALARDELETINGDESTRUCTORPROC)BuildStdcallToVirtualThiscallThunk(0x04u); - pIActorHandleMsg = - (PFNVIRTUALIACTORHANDLEMSGPROC)BuildStdcallToVirtualThiscallThunk(0x2Cu); + pIActorHandleMsg = (PFNVIRTUALIACTORHANDLEMSGPROC)BuildStdcallToVirtualThiscallThunk(0x2Cu); pIActorCloseAllDialogs = (PFNVIRTUALIACTORCLOSEALLDIALOGSPROC)BuildStdcallToVirtualThiscallThunk(0x3Cu); - pFrFormOpen = - (PFNFRFORMOPENPROC)BuildStdcallToVirtualThiscallThunk(0x64u); + pFrFormOpen = (PFNFRFORMOPENPROC)BuildStdcallToVirtualThiscallThunk(0x64u); InstallHook((LPVOID)0x00655630, (LPVOID)pOnUnderBar_RankingUpThunk); } static LPVOID CreateFormFrLoginRsDlg(LPVOID _pFrWndManager, LPVOID _pFrCmdTarget, LPCSTR _name, - LPVOID _pFrWnd) { + LPVOID _pFrWnd) { static LPVOID g_pFrLoginRsDlgObject = NULL; LPCVOID pFrLoginRsDlg_m_RTTI = (LPCVOID)0x00ECA148u; diff --git a/src/hooks/projectg/us852/ranking.h b/src/hooks/projectg/us852/ranking.h index 0e75745..ea7b2ae 100644 --- a/src/hooks/projectg/us852/ranking.h +++ b/src/hooks/projectg/us852/ranking.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_PROJECTG_US852_RANKING_H #define HOOKS_PROJECTG_US852_RANKING_H diff --git a/src/hooks/user32/window.c b/src/hooks/user32/window.c index 78d8078..6bed904 100644 --- a/src/hooks/user32/window.c +++ b/src/hooks/user32/window.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "window.h" #include "../../patch.h" @@ -8,9 +24,13 @@ static PFNCREATEWINDOWEXAPROC pCreateWindowExA = NULL; * CreateWindowExAHook is a convenience patch that prevents PangYa from * creating topmost windows. */ -HWND STDCALL CreateWindowExAHook(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, DWORD dwStyle, int X, int Y, int nWidth, int nHeight, HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, LPVOID lpParam) { +HWND STDCALL CreateWindowExAHook(DWORD dwExStyle, LPCSTR lpClassName, LPCSTR lpWindowName, + DWORD dwStyle, int X, int Y, int nWidth, int nHeight, + HWND hWndParent, HMENU hMenu, HINSTANCE hInstance, + LPVOID lpParam) { dwExStyle &= (~WS_EX_TOPMOST); - return pCreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); + return pCreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, + hWndParent, hMenu, hInstance, lpParam); } VOID InitWindowHook() { diff --git a/src/hooks/user32/window.h b/src/hooks/user32/window.h index 1a997cb..685c582 100644 --- a/src/hooks/user32/window.h +++ b/src/hooks/user32/window.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_USER32_WINDOW_H #define HOOKS_USER32_WINDOW_H diff --git a/src/hooks/wininet/netredir.c b/src/hooks/wininet/netredir.c index d15bec1..c4046c2 100644 --- a/src/hooks/wininet/netredir.c +++ b/src/hooks/wininet/netredir.c @@ -1,6 +1,22 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "netredir.h" -#include "../../patch.h" #include "../../config.h" +#include "../../patch.h" HMODULE hWinINet = NULL; PFNINTERNETOPENURLAPROC pInternetOpenUrlA = NULL; @@ -8,18 +24,21 @@ PFNINTERNETOPENURLAPROC pInternetOpenUrlA = NULL; /** * InternetOpenUrlAHook redirects HTTP calls to localhost. */ -HINTERNET STDCALL InternetOpenUrlAHook(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lpszHeaders, DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext) { +HINTERNET STDCALL InternetOpenUrlAHook(HINTERNET hInternet, LPCSTR lpszUrl, LPCSTR lpszHeaders, + DWORD dwHeadersLength, DWORD dwFlags, DWORD_PTR dwContext) { LPCSTR newURL; HINTERNET hResult; newURL = RewriteURL(lpszUrl); if (newURL != NULL) { Log("InternetOpenUrlA(%s -> %s)\r\n", lpszUrl, newURL); - hResult = pInternetOpenUrlA(hInternet, newURL, lpszHeaders, dwHeadersLength, dwFlags, dwContext); + hResult = + pInternetOpenUrlA(hInternet, newURL, lpszHeaders, dwHeadersLength, dwFlags, dwContext); FreeMem((HLOCAL)newURL); } else { Log("InternetOpenUrlA(%s) // (no rewrite rules matched)\r\n", lpszUrl, newURL); - hResult = pInternetOpenUrlA(hInternet, newURL, lpszHeaders, dwHeadersLength, dwFlags, dwContext); + hResult = + pInternetOpenUrlA(hInternet, newURL, lpszHeaders, dwHeadersLength, dwFlags, dwContext); } return hResult; } diff --git a/src/hooks/wininet/netredir.h b/src/hooks/wininet/netredir.h index 4d9403a..a605c1a 100644 --- a/src/hooks/wininet/netredir.h +++ b/src/hooks/wininet/netredir.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_WININET_NETREDIR_H #define HOOKS_WININET_NETREDIR_H diff --git a/src/hooks/ws2_32/redir.c b/src/hooks/ws2_32/redir.c index aab150b..f8ca3d3 100644 --- a/src/hooks/ws2_32/redir.c +++ b/src/hooks/ws2_32/redir.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "redir.h" #include "../../config.h" #include "../../patch.h" diff --git a/src/hooks/ws2_32/redir.h b/src/hooks/ws2_32/redir.h index f3449ce..6fbf1ae 100644 --- a/src/hooks/ws2_32/redir.h +++ b/src/hooks/ws2_32/redir.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef HOOKS_WS2_32_REDIR_H #define HOOKS_WS2_32_REDIR_H diff --git a/src/json.c b/src/json.c index 4342af3..0745577 100644 --- a/src/json.c +++ b/src/json.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + /* * Simple JSON parsing utilities for C. Supports most of JSON, but not * floating point numbers. diff --git a/src/json.h b/src/json.h index ce026be..78bf702 100644 --- a/src/json.h +++ b/src/json.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef JSON_H #define JSON_H diff --git a/src/ld.c b/src/ld.c index 74d73b9..6efa582 100644 --- a/src/ld.c +++ b/src/ld.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + /* * x86 length disassembler, adapted from * https://github.com/Nomade040/length-disassembler diff --git a/src/ld.h b/src/ld.h index 3cfd454..3054d73 100644 --- a/src/ld.h +++ b/src/ld.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef LD_H #define LD_H diff --git a/src/patch.c b/src/patch.c index 5891516..c0ac822 100644 --- a/src/patch.c +++ b/src/patch.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "patch.h" #include "ld.h" diff --git a/src/patch.h b/src/patch.h index a703368..a89f52d 100644 --- a/src/patch.h +++ b/src/patch.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef PATCH_H #define PATCH_H diff --git a/src/regex.c b/src/regex.c index c10010e..cbdffa2 100644 --- a/src/regex.c +++ b/src/regex.c @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #include "regex.h" #define MAXRETOKENS 64 diff --git a/src/regex.h b/src/regex.h index 71e02dc..3903d38 100644 --- a/src/regex.h +++ b/src/regex.h @@ -1,3 +1,19 @@ +/** + * Copyright 2018-2024 John Chadwick + * + * Permission to use, copy, modify, and/or distribute this software for any purpose + * with or without fee is hereby granted, provided that the above copyright notice + * and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH + * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, + * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF + * THIS SOFTWARE. + */ + #ifndef RE_H #define RE_H