Skip to content

Commit

Permalink
Switch to #pragma once
Browse files Browse the repository at this point in the history
  • Loading branch information
jchv committed Aug 6, 2024
1 parent c8490da commit 1a81f8a
Show file tree
Hide file tree
Showing 16 changed files with 16 additions and 64 deletions.
5 changes: 1 addition & 4 deletions src/common-fnptr.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,7 @@
* hook various APIs to manipulate or inspect behavior.
*/

#ifndef COMMON_FNPTR_H
#define COMMON_FNPTR_H
#pragma once

#include <windows.h>
#include <ws2tcpip.h>
Expand Down Expand Up @@ -157,5 +156,3 @@ typedef int(STDCALL *PFNIJLFREEPROC)(int);
typedef int(STDCALL *PFNIJLREADPROC)(int, int);
typedef int(STDCALL *PFNIJLWRITEPROC)(int, int);
typedef int(STDCALL *PFNIJLERRORSTRPROC)(int);

#endif
5 changes: 1 addition & 4 deletions src/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* THIS SOFTWARE.
*/

#ifndef COMMON_H
#define COMMON_H
#pragma once

#define STDCALL __stdcall
#define EXPORT __export
Expand Down Expand Up @@ -76,5 +75,3 @@ VOID Exit(DWORD dwExitCode);
PANGYAVER DetectPangyaVersion();
PSTR GetPangyaArg(PANGYAVER pangyaVersion);
PSTR GetSelfPath();

#endif
5 changes: 1 addition & 4 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* THIS SOFTWARE.
*/

#ifndef CONFIG_H
#define CONFIG_H
#pragma once

#include "common.h"
#include "regex.h"
Expand Down Expand Up @@ -58,5 +57,3 @@ void LoadJsonRugburnConfig();
LPCSTR RewriteURL(LPCSTR url);
BOOL RewriteAddr(LPSOCKADDR_IN addr);
void PatchAddress();

#endif
5 changes: 1 addition & 4 deletions src/hex.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* THIS SOFTWARE.
*/

#ifndef HEX_H
#define HEX_H
#pragma once

#include "common.h"

Expand All @@ -24,5 +23,3 @@ DWORD FromHex(LPCSTR pHex, PVOID pData);

DWORD ParseAddress(LPCSTR lpszText);
void ParsePatch(LPCSTR lpszText, LPSTR *pDataOut, DWORD *pSizeOut);

#endif
5 changes: 1 addition & 4 deletions src/hooks/comctl32/dynamic_patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_COMCTL32_DYNAMIC_PATH
#define HOOKS_COMCTL32_DYNAMIC_PATH
#pragma once

#include "../../common.h"

VOID InitComCtl32Hook();

#endif // !HOOKS_COMCTL32_DYNAMIC_PATH
5 changes: 1 addition & 4 deletions src/hooks/hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_HOOKS_H
#define HOOKS_HOOKS_H
#pragma once

#include "../common.h"

VOID InitHooks();

#endif
5 changes: 1 addition & 4 deletions src/hooks/kernel32/inject.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_KERNEL32_INJECT_H
#define HOOKS_KERNEL32_INJECT_H
#pragma once

#include "../../common.h"

VOID InitInjectHook();

#endif
5 changes: 1 addition & 4 deletions src/hooks/msvcr100/msvcr100.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_MSVCR100_MSVCR100_H
#define HOOKS_MSVCR100_MSVCR100_H
#pragma once

#include "../../common.h"

VOID InitMsvcrHook();

#endif
5 changes: 1 addition & 4 deletions src/hooks/projectg/us852/ranking.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_PROJECTG_US852_RANKING_H
#define HOOKS_PROJECTG_US852_RANKING_H
#pragma once

#include "../../../common.h"

VOID InitUS852RankingHook();

#endif
5 changes: 1 addition & 4 deletions src/hooks/user32/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_USER32_WINDOW_H
#define HOOKS_USER32_WINDOW_H
#pragma once

#include "../../common.h"

VOID InitWindowHook();

#endif
5 changes: 1 addition & 4 deletions src/hooks/wininet/netredir.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_WININET_NETREDIR_H
#define HOOKS_WININET_NETREDIR_H
#pragma once

#include "../../common.h"

VOID InitNetRedirHook();

#endif
5 changes: 1 addition & 4 deletions src/hooks/ws2_32/redir.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef HOOKS_WS2_32_REDIR_H
#define HOOKS_WS2_32_REDIR_H
#pragma once

#include "../../common.h"

VOID InitRedirHook();

#endif
5 changes: 1 addition & 4 deletions src/json.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* THIS SOFTWARE.
*/

#ifndef JSON_H
#define JSON_H
#pragma once

#include "common.h"

Expand Down Expand Up @@ -50,5 +49,3 @@ int JsonReadInteger(LPSTR *json);
BOOL JsonReadBool(LPSTR *json);
void JsonReadMap(LPSTR *json, LFNREADMAPVALUECB valuefn);
void JsonReadArray(LPSTR *json, LFNREADARRAYVALUECB valuefn);

#endif
5 changes: 1 addition & 4 deletions src/ld.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* THIS SOFTWARE.
*/

#ifndef LD_H
#define LD_H
#pragma once

#include "common.h"

unsigned int LenDisasm(LPVOID address);

#endif
5 changes: 1 addition & 4 deletions src/patch.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* THIS SOFTWARE.
*/

#ifndef PATCH_H
#define PATCH_H
#pragma once

#include "common.h"

Expand All @@ -28,5 +27,3 @@ PVOID HookProc(HMODULE hModule, LPCSTR szName, PVOID pfnTargetProc);
PVOID BuildThiscallToStdcallThunk(PVOID pfnProc);
PVOID BuildStdcallToThiscallThunk(PVOID pfnProc);
PVOID BuildStdcallToVirtualThiscallThunk(DWORD dwVtblOffset);

#endif
5 changes: 1 addition & 4 deletions src/regex.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@
* THIS SOFTWARE.
*/

#ifndef RE_H
#define RE_H
#pragma once

#include "common.h"

Expand All @@ -28,5 +27,3 @@ LPSTR ReReplace(REGEX *find, LPCSTR replace, LPCSTR text);
int ReGetNumCaptures(REGEX *pattern);
int ReGetCaptureLen(REGEX *pattern, int i);
void ReGetCaptureData(REGEX *pattern, int i, LPSTR buffer);

#endif

0 comments on commit 1a81f8a

Please sign in to comment.