From 8b8656c9d2b600246af9e854c31de7cdbb3495e1 Mon Sep 17 00:00:00 2001 From: Tau Date: Tue, 5 Nov 2019 19:31:11 -0500 Subject: [PATCH] platform: Shift config structs around --- platform/amvideo.h | 6 +++- platform/clock.c | 1 - platform/clock.h | 8 ++++- platform/config.c | 10 ++++++ platform/config.h | 77 ++++++--------------------------------------- platform/dns.c | 1 - platform/dns.h | 12 +++++-- platform/hwmon.c | 1 - platform/hwmon.h | 6 +++- platform/misc.h | 6 +++- platform/netenv.c | 2 +- platform/netenv.h | 9 +++++- platform/nusec.c | 1 - platform/nusec.h | 16 +++++++++- platform/pcbid.h | 10 +++++- platform/platform.c | 1 - platform/platform.h | 22 ++++++++++++- platform/vfs.c | 1 - platform/vfs.h | 9 +++++- 19 files changed, 114 insertions(+), 85 deletions(-) diff --git a/platform/amvideo.h b/platform/amvideo.h index d14268f..f07dd74 100644 --- a/platform/amvideo.h +++ b/platform/amvideo.h @@ -2,6 +2,10 @@ #include -#include "platform/config.h" +#include + +struct amvideo_config { + bool enable; +}; HRESULT amvideo_hook_init(const struct amvideo_config *cfg, HMODULE redir_mod); diff --git a/platform/clock.c b/platform/clock.c index 0647396..b67b111 100644 --- a/platform/clock.c +++ b/platform/clock.c @@ -6,7 +6,6 @@ #include "hook/table.h" #include "platform/clock.h" -#include "platform/config.h" #include "util/dprintf.h" diff --git a/platform/clock.h b/platform/clock.h index 902c58c..4d67754 100644 --- a/platform/clock.h +++ b/platform/clock.h @@ -2,6 +2,12 @@ #include -#include "platform/config.h" +#include + +struct clock_config { + bool timezone; + bool timewarp; + bool writeable; +}; HRESULT clock_hook_init(const struct clock_config *cfg); diff --git a/platform/config.c b/platform/config.c index ac8927c..6c6e5d7 100644 --- a/platform/config.c +++ b/platform/config.c @@ -9,7 +9,17 @@ #include #include +#include "platform/amvideo.h" +#include "platform/clock.h" #include "platform/config.h" +#include "platform/dns.h" +#include "platform/hwmon.h" +#include "platform/misc.h" +#include "platform/netenv.h" +#include "platform/nusec.h" +#include "platform/pcbid.h" +#include "platform/platform.h" +#include "platform/vfs.h" void platform_config_load(struct platform_config *cfg, const wchar_t *filename) { diff --git a/platform/config.h b/platform/config.h index 7fcd377..9aeb5d3 100644 --- a/platform/config.h +++ b/platform/config.h @@ -6,73 +6,16 @@ #include #include -struct amvideo_config { - bool enable; -}; - -struct clock_config { - bool timezone; - bool timewarp; - bool writeable; -}; - -struct dns_config { - bool enable; - wchar_t router[128]; - wchar_t startup[128]; - wchar_t billing[128]; - wchar_t aimedb[128]; -}; - -struct hwmon_config { - bool enable; -}; - -struct misc_config { - bool enable; -}; - -struct netenv_config { - bool enable; - uint8_t addr_suffix; - uint8_t router_suffix; - uint8_t mac_addr[6]; -}; - -struct nusec_config { - bool enable; - char keychip_id[16]; - char game_id[4]; - char platform_id[4]; - uint8_t region; - uint8_t system_flag; - uint32_t subnet; - wchar_t billing_ca[MAX_PATH]; - wchar_t billing_pub[MAX_PATH]; -}; - -struct pcbid_config { - bool enable; - wchar_t serial_no[17]; -}; - -struct vfs_config { - bool enable; - wchar_t amfs[MAX_PATH]; - wchar_t appdata[MAX_PATH]; -}; - -struct platform_config { - struct amvideo_config amvideo; - struct clock_config clock; - struct dns_config dns; - struct hwmon_config hwmon; - struct misc_config misc; - struct pcbid_config pcbid; - struct netenv_config netenv; - struct nusec_config nusec; - struct vfs_config vfs; -}; +#include "platform/amvideo.h" +#include "platform/clock.h" +#include "platform/dns.h" +#include "platform/hwmon.h" +#include "platform/misc.h" +#include "platform/netenv.h" +#include "platform/nusec.h" +#include "platform/pcbid.h" +#include "platform/platform.h" +#include "platform/vfs.h" void platform_config_load( struct platform_config *cfg, diff --git a/platform/dns.c b/platform/dns.c index a69d47e..51f64f8 100644 --- a/platform/dns.c +++ b/platform/dns.c @@ -4,7 +4,6 @@ #include "hooklib/dns.h" -#include "platform/config.h" #include "platform/dns.h" HRESULT dns_platform_hook_init(const struct dns_config *cfg) diff --git a/platform/dns.h b/platform/dns.h index ab12edb..416fe73 100644 --- a/platform/dns.h +++ b/platform/dns.h @@ -2,7 +2,15 @@ #include -#include "platform/config.h" +#include +#include + +struct dns_config { + bool enable; + wchar_t router[128]; + wchar_t startup[128]; + wchar_t billing[128]; + wchar_t aimedb[128]; +}; HRESULT dns_platform_hook_init(const struct dns_config *cfg); - diff --git a/platform/hwmon.c b/platform/hwmon.c index 7f1ea7b..ac125d3 100644 --- a/platform/hwmon.c +++ b/platform/hwmon.c @@ -5,7 +5,6 @@ #include "hook/iohook.h" -#include "platform/config.h" #include "platform/hwmon.h" #include "util/dprintf.h" diff --git a/platform/hwmon.h b/platform/hwmon.h index a0274e6..14357bd 100644 --- a/platform/hwmon.h +++ b/platform/hwmon.h @@ -2,6 +2,10 @@ #include -#include "platform/config.h" +#include + +struct hwmon_config { + bool enable; +}; HRESULT hwmon_hook_init(const struct hwmon_config *cfg); diff --git a/platform/misc.h b/platform/misc.h index 1b8adfd..ce4aec4 100644 --- a/platform/misc.h +++ b/platform/misc.h @@ -1,5 +1,9 @@ #pragma once -#include "platform/config.h" +#include + +struct misc_config { + bool enable; +}; HRESULT misc_hook_init(const struct misc_config *cfg, const char *platform_id); diff --git a/platform/netenv.c b/platform/netenv.c index f44c653..d3d06c4 100644 --- a/platform/netenv.c +++ b/platform/netenv.c @@ -9,8 +9,8 @@ #include "hook/table.h" -#include "platform/config.h" #include "platform/netenv.h" +#include "platform/nusec.h" #include "util/dprintf.h" diff --git a/platform/netenv.h b/platform/netenv.h index b84d748..977a3f6 100644 --- a/platform/netenv.h +++ b/platform/netenv.h @@ -5,7 +5,14 @@ #include #include -#include "platform/config.h" +#include "platform/nusec.h" + +struct netenv_config { + bool enable; + uint8_t addr_suffix; + uint8_t router_suffix; + uint8_t mac_addr[6]; +}; HRESULT netenv_hook_init( const struct netenv_config *cfg, diff --git a/platform/nusec.c b/platform/nusec.c index f9ff413..7f888a4 100644 --- a/platform/nusec.c +++ b/platform/nusec.c @@ -7,7 +7,6 @@ #include "hooklib/reg.h" -#include "platform/config.h" #include "platform/nusec.h" #include "util/dprintf.h" diff --git a/platform/nusec.h b/platform/nusec.h index 68f54ed..60886b1 100644 --- a/platform/nusec.h +++ b/platform/nusec.h @@ -2,7 +2,21 @@ #include -#include "platform/config.h" +#include +#include +#include + +struct nusec_config { + bool enable; + char keychip_id[16]; + char game_id[4]; + char platform_id[4]; + uint8_t region; + uint8_t system_flag; + uint32_t subnet; + wchar_t billing_ca[MAX_PATH]; + wchar_t billing_pub[MAX_PATH]; +}; HRESULT nusec_hook_init( const struct nusec_config *cfg, diff --git a/platform/pcbid.h b/platform/pcbid.h index 90f2f83..2c8b78d 100644 --- a/platform/pcbid.h +++ b/platform/pcbid.h @@ -1,5 +1,13 @@ #pragma once -#include "platform/config.h" +#include + +#include +#include + +struct pcbid_config { + bool enable; + wchar_t serial_no[17]; +}; HRESULT pcbid_hook_init(const struct pcbid_config *cfg); diff --git a/platform/platform.c b/platform/platform.c index 09f956a..218204c 100644 --- a/platform/platform.c +++ b/platform/platform.c @@ -4,7 +4,6 @@ #include "platform/amvideo.h" #include "platform/clock.h" -#include "platform/config.h" #include "platform/dns.h" #include "platform/hwmon.h" #include "platform/misc.h" diff --git a/platform/platform.h b/platform/platform.h index 4f3f7a4..aaaff51 100644 --- a/platform/platform.h +++ b/platform/platform.h @@ -2,7 +2,27 @@ #include -#include "platform/config.h" +#include "platform/amvideo.h" +#include "platform/clock.h" +#include "platform/dns.h" +#include "platform/hwmon.h" +#include "platform/misc.h" +#include "platform/netenv.h" +#include "platform/nusec.h" +#include "platform/pcbid.h" +#include "platform/vfs.h" + +struct platform_config { + struct amvideo_config amvideo; + struct clock_config clock; + struct dns_config dns; + struct hwmon_config hwmon; + struct misc_config misc; + struct pcbid_config pcbid; + struct netenv_config netenv; + struct nusec_config nusec; + struct vfs_config vfs; +}; HRESULT platform_hook_init( const struct platform_config *cfg, diff --git a/platform/vfs.c b/platform/vfs.c index 84e8f16..59ee163 100644 --- a/platform/vfs.c +++ b/platform/vfs.c @@ -8,7 +8,6 @@ #include "hooklib/path.h" #include "hooklib/reg.h" -#include "platform/config.h" #include "platform/vfs.h" #include "util/dprintf.h" diff --git a/platform/vfs.h b/platform/vfs.h index c46c1f9..acdd99a 100644 --- a/platform/vfs.h +++ b/platform/vfs.h @@ -2,6 +2,13 @@ #include -#include "platform/config.h" +#include +#include + +struct vfs_config { + bool enable; + wchar_t amfs[MAX_PATH]; + wchar_t appdata[MAX_PATH]; +}; HRESULT vfs_hook_init(const struct vfs_config *config);