mirror of
https://github.com/djhackersdev/bemanitools.git
synced 2026-04-27 08:17:28 -05:00
chore: Apply code formatting to entire code base
This commit is contained in:
parent
47bfb4e9b2
commit
b0564b97c6
|
|
@ -162,14 +162,16 @@ static HRESULT ezusb_ioctl(struct irp *irp)
|
|||
|
||||
// Sanity check and visibility, in case this ever overflows
|
||||
if (irp->write.nbytes > sizeof(write_buffer_local)) {
|
||||
log_fatal("Insufficient local write buffer available for ioctl, local "
|
||||
log_fatal(
|
||||
"Insufficient local write buffer available for ioctl, local "
|
||||
"size %d, ioctl buffer size %d",
|
||||
sizeof(write_buffer_local),
|
||||
irp->write.nbytes);
|
||||
}
|
||||
|
||||
if (irp->read.nbytes > sizeof(read_buffer_local)) {
|
||||
log_fatal("Insufficient local read buffer available for ioctl, local "
|
||||
log_fatal(
|
||||
"Insufficient local read buffer available for ioctl, local "
|
||||
"size %d, ioctl buffer size %d",
|
||||
sizeof(read_buffer_local),
|
||||
irp->read.nbytes);
|
||||
|
|
|
|||
|
|
@ -73,8 +73,8 @@ static uint8_t ezusb_iidx_emu_msg_read_cur_node = 0;
|
|||
|
||||
/* ------------------------------------------------------------------------ */
|
||||
|
||||
struct ezusb_emu_msg_hook *ezusb_iidx_emu_msg_init(
|
||||
enum ezusb_iidx_emu_msg_io_board_type io_board_type)
|
||||
struct ezusb_emu_msg_hook *
|
||||
ezusb_iidx_emu_msg_init(enum ezusb_iidx_emu_msg_io_board_type io_board_type)
|
||||
{
|
||||
if (io_board_type < 0 ||
|
||||
io_board_type >= EZUSB_IIDX_EMU_MSG_IO_BOARD_TYPE_COUNT) {
|
||||
|
|
@ -94,8 +94,8 @@ struct ezusb_emu_msg_hook *ezusb_iidx_emu_msg_init(
|
|||
|
||||
ezusb_iidx_emu_node_handler = ezusb_iidx_emu_msg_nodes;
|
||||
|
||||
log_info("Initialized, io board type: %d",
|
||||
ezusb_iidx_emu_msg_io_board_type);
|
||||
log_info(
|
||||
"Initialized, io board type: %d", ezusb_iidx_emu_msg_io_board_type);
|
||||
|
||||
return &ezusb_iidx_emu_msg_hook;
|
||||
}
|
||||
|
|
@ -186,7 +186,8 @@ static HRESULT ezusb_iidx_emu_msg_interrupt_read(struct iobuf *read)
|
|||
|
||||
case EZUSB_IIDX_EMU_MSG_IO_BOARD_TYPE_COUNT:
|
||||
default:
|
||||
log_fatal("Illegal state, unhandled board type: %d",
|
||||
log_fatal(
|
||||
"Illegal state, unhandled board type: %d",
|
||||
ezusb_iidx_emu_msg_io_board_type);
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ enum ezusb_iidx_emu_msg_io_board_type {
|
|||
* @return ezusb_emu_msg_hook structure with hook calls for ezusb msg
|
||||
* dispatching
|
||||
*/
|
||||
struct ezusb_emu_msg_hook *ezusb_iidx_emu_msg_init(
|
||||
enum ezusb_iidx_emu_msg_io_board_type io_board_type);
|
||||
struct ezusb_emu_msg_hook *
|
||||
ezusb_iidx_emu_msg_init(enum ezusb_iidx_emu_msg_io_board_type io_board_type);
|
||||
|
||||
/**
|
||||
* Init the fully emulated IIDX msg backend for a EZUSB (C02) board. This
|
||||
|
|
|
|||
|
|
@ -161,8 +161,10 @@ _Static_assert(
|
|||
sizeof(struct ezusb_iidx_emu_node_serial_get_version_resp) == 13,
|
||||
"ezusb_iidx_emu_node_serial_get_version_resp is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_keyboard_get_buffer_size_resp) == 2,
|
||||
"ezusb_iidx_emu_node_serial_keyboard_get_buffer_size_resp is the wrong size");
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_keyboard_get_buffer_size_resp) ==
|
||||
2,
|
||||
"ezusb_iidx_emu_node_serial_keyboard_get_buffer_size_resp is the wrong "
|
||||
"size");
|
||||
_Static_assert(
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_keyboard_read_data_req) == 1,
|
||||
"ezusb_iidx_emu_node_serial_keyboard_read_data_req is the wrong size");
|
||||
|
|
@ -173,10 +175,12 @@ _Static_assert(
|
|||
sizeof(struct ezusb_iidx_emu_node_serial_card_slot_state_req) == 1,
|
||||
"ezusb_iidx_emu_node_serial_card_slot_state_req is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_card_read_resp) == 1 + MAG_CARD_DATA_SIZE,
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_card_read_resp) ==
|
||||
1 + MAG_CARD_DATA_SIZE,
|
||||
"ezusb_iidx_emu_node_serial_card_read_resp is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_card_write_req) == MAG_CARD_DATA_SIZE,
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_card_write_req) ==
|
||||
MAG_CARD_DATA_SIZE,
|
||||
"ezusb_iidx_emu_node_serial_card_write_req is the wrong size");
|
||||
_Static_assert(
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_common_req) == 0,
|
||||
|
|
@ -460,8 +464,10 @@ calc_serial_buffer_checksum(const uint8_t *buffer, uint16_t length)
|
|||
static struct ezusb_iidx_emu_node_serial_msg *create_generic_node_response_ok(
|
||||
const struct ezusb_iidx_emu_node_serial_msg *msg_in, uint16_t *msg_out_len)
|
||||
{
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_common_status_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp = xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(struct ezusb_iidx_emu_node_serial_common_status_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_NODE_RESP;
|
||||
resp->node_id = msg_in->node_id;
|
||||
resp->node_cmd = msg_in->node_cmd;
|
||||
|
|
@ -484,7 +490,10 @@ static struct ezusb_iidx_emu_node_serial_msg *process_serial_msg(
|
|||
switch (msg_in->node_cmd) {
|
||||
case H8_CMD_NODE_ENUM: {
|
||||
log_misc("H8_CMD_NODE_ENUM");
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_node_enum_resp);
|
||||
*msg_out_len =
|
||||
NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(
|
||||
struct ezusb_iidx_emu_node_serial_node_enum_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_H8_RESP;
|
||||
|
|
@ -499,7 +508,10 @@ static struct ezusb_iidx_emu_node_serial_msg *process_serial_msg(
|
|||
|
||||
case H8_CMD_GET_VERSION: {
|
||||
log_misc("H8_CMD_GET_VERSION: %d", msg_in->node_id);
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_get_version_resp);
|
||||
*msg_out_len =
|
||||
NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(
|
||||
struct ezusb_iidx_emu_node_serial_get_version_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_H8_RESP;
|
||||
|
|
@ -524,7 +536,9 @@ static struct ezusb_iidx_emu_node_serial_msg *process_serial_msg(
|
|||
case H8_CMD_PROG_EXEC: {
|
||||
log_misc("H8_CMD_PROG_EXEC: %d", msg_in->node_id);
|
||||
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_common_status_resp);
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(struct
|
||||
ezusb_iidx_emu_node_serial_common_status_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_H8_RESP;
|
||||
|
|
@ -600,7 +614,9 @@ static struct ezusb_iidx_emu_node_serial_msg *process_serial_msg(
|
|||
case NODE_CMD_CARD_RW_UNIT_GET_STATUS: {
|
||||
/* report front and back sensor states */
|
||||
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_common_status_resp);
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(struct
|
||||
ezusb_iidx_emu_node_serial_common_status_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_NODE_RESP;
|
||||
|
|
@ -719,7 +735,10 @@ static struct ezusb_iidx_emu_node_serial_msg *process_serial_msg(
|
|||
}
|
||||
|
||||
case NODE_CMD_CARD_READ: {
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_card_read_resp);
|
||||
*msg_out_len =
|
||||
NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(
|
||||
struct ezusb_iidx_emu_node_serial_card_read_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_NODE_RESP;
|
||||
|
|
@ -871,7 +890,11 @@ static struct ezusb_iidx_emu_node_serial_msg *process_serial_msg(
|
|||
}
|
||||
|
||||
case NODE_CMD_KEYBOARD_GET_BUFFER_SIZE: {
|
||||
*msg_out_len = NODE_SERIAL_MSG_HEADER_SIZE + sizeof(struct ezusb_iidx_emu_node_serial_keyboard_get_buffer_size_resp);
|
||||
*msg_out_len =
|
||||
NODE_SERIAL_MSG_HEADER_SIZE +
|
||||
sizeof(
|
||||
struct
|
||||
ezusb_iidx_emu_node_serial_keyboard_get_buffer_size_resp);
|
||||
struct ezusb_iidx_emu_node_serial_msg *resp =
|
||||
xmalloc(sizeof(struct ezusb_iidx_emu_node_serial_msg));
|
||||
resp->msg_cmd = CMD_NODE_RESP;
|
||||
|
|
|
|||
|
|
@ -181,14 +181,16 @@ static HRESULT ezusb_ioctl(struct irp *irp)
|
|||
|
||||
// Sanity check and visibility, in case this ever overflows
|
||||
if (irp->write.nbytes > sizeof(write_buffer_local)) {
|
||||
log_fatal("Insufficient local write buffer available for ioctl, local "
|
||||
log_fatal(
|
||||
"Insufficient local write buffer available for ioctl, local "
|
||||
"size %d, ioctl buffer size %d",
|
||||
sizeof(write_buffer_local),
|
||||
irp->write.nbytes);
|
||||
}
|
||||
|
||||
if (irp->read.nbytes > sizeof(read_buffer_local)) {
|
||||
log_fatal("Insufficient local read buffer available for ioctl, local "
|
||||
log_fatal(
|
||||
"Insufficient local read buffer available for ioctl, local "
|
||||
"size %d, ioctl buffer size %d",
|
||||
sizeof(read_buffer_local),
|
||||
irp->read.nbytes);
|
||||
|
|
|
|||
|
|
@ -164,8 +164,6 @@ static HRESULT ezusb2_popn_emu_msg_bulk_read(struct iobuf *read)
|
|||
return HRESULT_FROM_WIN32(ERROR_INSUFFICIENT_BUFFER);
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (!ezusb2_popn_emu_msg_nodes[ezusb2_popn_emu_msg_read_cur_node]) {
|
||||
log_warning(
|
||||
"Bulk read unsupported on cur_node = %d",
|
||||
|
|
|
|||
|
|
@ -262,13 +262,15 @@ static void chart_patch_execute_patch_checksum()
|
|||
log_warning("Could not find checksum row for %s", chart_patch_file_1_name);
|
||||
}
|
||||
|
||||
static enum song_data_path_format chart_patch_is_song_data_path(const wchar_t *path, wchar_t *song_id)
|
||||
static enum song_data_path_format
|
||||
chart_patch_is_song_data_path(const wchar_t *path, wchar_t *song_id)
|
||||
{
|
||||
log_assert(path);
|
||||
log_assert(song_id);
|
||||
|
||||
// Song data path for 09 to 17
|
||||
// data folder next to revision folder and working dir set to revision folder
|
||||
// data folder next to revision folder and working dir set to revision
|
||||
// folder
|
||||
if (swscanf(
|
||||
path,
|
||||
// Ensure to match %lc and not %c to extract wide string chars
|
||||
|
|
@ -328,7 +330,8 @@ static enum song_data_path_format chart_patch_is_song_data_path(const wchar_t *p
|
|||
return SONG_DATA_PATH_INVALID;
|
||||
}
|
||||
|
||||
static void chart_patch_get_song_chart_file_name(const wchar_t *song_id, wchar_t *chart_file_name)
|
||||
static void chart_patch_get_song_chart_file_name(
|
||||
const wchar_t *song_id, wchar_t *chart_file_name)
|
||||
{
|
||||
log_assert(song_id);
|
||||
log_assert(chart_file_name);
|
||||
|
|
@ -340,7 +343,8 @@ static void chart_patch_get_song_chart_file_name(const wchar_t *song_id, wchar_t
|
|||
chart_file_name[6] = L'\0';
|
||||
}
|
||||
|
||||
static enum song_data_file_type chart_patch_get_song_data_file_type(const wchar_t *path, const wchar_t *song_id)
|
||||
static enum song_data_file_type
|
||||
chart_patch_get_song_data_file_type(const wchar_t *path, const wchar_t *song_id)
|
||||
{
|
||||
wchar_t chart_file[7];
|
||||
|
||||
|
|
@ -360,34 +364,25 @@ static enum song_data_file_type chart_patch_get_song_data_file_type(const wchar_
|
|||
return SONG_DATA_FILE_TYPE_UNKNKOWN;
|
||||
}
|
||||
|
||||
static void chart_patch_get_path_dot_1_file(const wchar_t *song_id, enum song_data_path_format path_format, wchar_t *path)
|
||||
static void chart_patch_get_path_dot_1_file(
|
||||
const wchar_t *song_id,
|
||||
enum song_data_path_format path_format,
|
||||
wchar_t *path)
|
||||
{
|
||||
switch (path_format) {
|
||||
case SONG_DATA_PATH_09_TO_17:
|
||||
// Note: These use %s also for wide strings!
|
||||
wsprintfW(
|
||||
path,
|
||||
L"..\\data\\sd_data\\%s\\%s.1",
|
||||
song_id,
|
||||
song_id);
|
||||
wsprintfW(path, L"..\\data\\sd_data\\%s\\%s.1", song_id, song_id);
|
||||
break;
|
||||
|
||||
case SONG_DATA_PATH_18:
|
||||
// Note: These use %s also for wide strings!
|
||||
wsprintfW(
|
||||
path,
|
||||
L".\\data\\sd_data\\%s\\%s.1",
|
||||
song_id,
|
||||
song_id);
|
||||
wsprintfW(path, L".\\data\\sd_data\\%s\\%s.1", song_id, song_id);
|
||||
break;
|
||||
|
||||
case SONG_DATA_PATH_19:
|
||||
// Note: These use %s also for wide strings!
|
||||
wsprintfW(
|
||||
path,
|
||||
L".\\data\\sound\\%s\\%s.1",
|
||||
song_id,
|
||||
song_id);
|
||||
wsprintfW(path, L".\\data\\sound\\%s\\%s.1", song_id, song_id);
|
||||
break;
|
||||
|
||||
case SONG_DATA_FILE_TYPE_UNKNKOWN:
|
||||
|
|
@ -397,31 +392,25 @@ static void chart_patch_get_path_dot_1_file(const wchar_t *song_id, enum song_da
|
|||
}
|
||||
}
|
||||
|
||||
static void chart_patch_get_path_checksum_file(const wchar_t *song_id, enum song_data_path_format path_format, wchar_t *path)
|
||||
static void chart_patch_get_path_checksum_file(
|
||||
const wchar_t *song_id,
|
||||
enum song_data_path_format path_format,
|
||||
wchar_t *path)
|
||||
{
|
||||
switch (path_format) {
|
||||
case SONG_DATA_PATH_09_TO_17:
|
||||
// Note: These use %s also for wide strings!
|
||||
wsprintfW(
|
||||
path,
|
||||
L"..\\data\\sd_data\\%s\\osprey.bin",
|
||||
song_id);
|
||||
wsprintfW(path, L"..\\data\\sd_data\\%s\\osprey.bin", song_id);
|
||||
break;
|
||||
|
||||
case SONG_DATA_PATH_18:
|
||||
// Note: These use %s also for wide strings!
|
||||
wsprintfW(
|
||||
path,
|
||||
L".\\data\\sd_data\\%s\\osprey.bin",
|
||||
song_id);
|
||||
wsprintfW(path, L".\\data\\sd_data\\%s\\osprey.bin", song_id);
|
||||
break;
|
||||
|
||||
case SONG_DATA_PATH_19:
|
||||
// Note: These use %s also for wide strings!
|
||||
wsprintfW(
|
||||
path,
|
||||
L".\\data\\sound\\%s\\osprey.bin",
|
||||
song_id);
|
||||
wsprintfW(path, L".\\data\\sound\\%s\\osprey.bin", song_id);
|
||||
break;
|
||||
|
||||
case SONG_DATA_FILE_TYPE_UNKNKOWN:
|
||||
|
|
@ -456,10 +445,16 @@ static bool chart_patch_file_trap(struct irp *irp)
|
|||
if (path_format != SONG_DATA_PATH_INVALID) {
|
||||
EnterCriticalSection(&chart_patch_lock);
|
||||
|
||||
file_type = chart_patch_get_song_data_file_type(irp->open_filename, song_id);
|
||||
file_type =
|
||||
chart_patch_get_song_data_file_type(irp->open_filename, song_id);
|
||||
|
||||
// %S for printing wide strings
|
||||
log_misc("Trapping song ID %S, path format %d, file type %d, path %S", song_id, path_format, file_type, irp->open_filename);
|
||||
log_misc(
|
||||
"Trapping song ID %S, path format %d, file type %d, path %S",
|
||||
song_id,
|
||||
path_format,
|
||||
file_type,
|
||||
irp->open_filename);
|
||||
|
||||
/* Block a second open call to either .1 or checksum file if detouring
|
||||
is already active */
|
||||
|
|
@ -489,12 +484,16 @@ static bool chart_patch_file_trap(struct irp *irp)
|
|||
return true;
|
||||
}
|
||||
|
||||
if (file_type == SONG_DATA_FILE_TYPE_DOT_1 || file_type == SONG_DATA_FILE_TYPE_CHECKSUM) {
|
||||
log_misc("Preparing in-memory chart data for song ID %S...", song_id);
|
||||
if (file_type == SONG_DATA_FILE_TYPE_DOT_1 ||
|
||||
file_type == SONG_DATA_FILE_TYPE_CHECKSUM) {
|
||||
log_misc(
|
||||
"Preparing in-memory chart data for song ID %S...", song_id);
|
||||
|
||||
chart_patch_get_song_chart_file_name(song_id, chart_file_name);
|
||||
chart_patch_get_path_dot_1_file(song_id, path_format, buffer_1_path);
|
||||
chart_patch_get_path_checksum_file(song_id, path_format, buffer_checksum_path);
|
||||
chart_patch_get_path_dot_1_file(
|
||||
song_id, path_format, buffer_1_path);
|
||||
chart_patch_get_path_checksum_file(
|
||||
song_id, path_format, buffer_checksum_path);
|
||||
|
||||
if (!chart_patch_file_load(
|
||||
irp, &chart_patch_file_1, buffer_1_path)) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,8 @@
|
|||
#include "util/log.h"
|
||||
#include "util/mem.h"
|
||||
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_API_CALL_MONITORING_KEY "ezusb.api_call_monitoring"
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_API_CALL_MONITORING_KEY \
|
||||
"ezusb.api_call_monitoring"
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_IO_BOARD_TYPE_KEY "ezusb.io_board_type"
|
||||
|
||||
#define IIDXHOOK_UTIL_CONFIG_EZUSB_DEFAULT_API_CALL_MONITORING_VALUE false
|
||||
|
|
|
|||
|
|
@ -50,7 +50,8 @@ static void settings_build_new_path(
|
|||
strcpy(new_path, settings_path);
|
||||
strcat(new_path, orig_path);
|
||||
|
||||
/* Fix only the part of the original path which comes after the leading settings path */
|
||||
/* Fix only the part of the original path which comes after the leading
|
||||
* settings path */
|
||||
orig_appended_path = new_path + settings_path_len;
|
||||
|
||||
/* Duplicate \ in paths is fine because the win32 file API applies path
|
||||
|
|
@ -77,7 +78,10 @@ BOOL WINAPI my_CreateDirectoryA(
|
|||
|
||||
settings_build_new_path(lpPathName, new_path, sizeof(new_path));
|
||||
|
||||
log_misc("(CreateDir) Remapped settings path %s -> %s", lpPathName, new_path);
|
||||
log_misc(
|
||||
"(CreateDir) Remapped settings path %s -> %s",
|
||||
lpPathName,
|
||||
new_path);
|
||||
|
||||
return real_CreateDirectoryA(new_path, lpSecurityAttributes);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
|
||||
#include "iidxhook-util/chart-patch.h"
|
||||
#include "iidxhook-util/clock.h"
|
||||
#include "iidxhook-util/config-ezusb.h"
|
||||
#include "iidxhook-util/config-eamuse.h"
|
||||
#include "iidxhook-util/config-ezusb.h"
|
||||
#include "iidxhook-util/config-gfx.h"
|
||||
#include "iidxhook-util/config-misc.h"
|
||||
#include "iidxhook-util/config-sec.h"
|
||||
|
|
|
|||
|
|
@ -22,8 +22,8 @@ static int my_usbSecuritySelectDone();
|
|||
static int my_usbGetPCBID(char *buffer);
|
||||
static int my_usbGetSecurity(char *buffer);
|
||||
static int my_usbGetSecurityKey(char *buffer);
|
||||
static int my_usbBootSecurity(
|
||||
const char* boot_code, int seed_1, int seed_2, int seed_3);
|
||||
static int
|
||||
my_usbBootSecurity(const char *boot_code, int seed_1, int seed_2, int seed_3);
|
||||
static int my_usbSetupSecurityComplete(int val1, int val2, int val3, int val4);
|
||||
static int my_usbMute(int val);
|
||||
static int my_usbFirmResult();
|
||||
|
|
@ -36,7 +36,8 @@ static int (*real_usbGetSecurity)(char* buffer);
|
|||
static int (*real_usbGetSecurityKey)(char *buffer);
|
||||
static int (*real_usbBootSecurity)(
|
||||
const char *boot_code, int seed_1, int seed_2, int seed_3);
|
||||
static int (*real_usbSetupSecurityComplete)(int val1, int val2, int val3, int val4);
|
||||
static int (*real_usbSetupSecurityComplete)(
|
||||
int val1, int val2, int val3, int val4);
|
||||
static int (*real_usbMute)(int val);
|
||||
static int (*real_usbFirmResult)();
|
||||
|
||||
|
|
@ -70,9 +71,7 @@ static const struct hook_symbol ezusb_mon_hook_syms[] = {
|
|||
{.name = "usbSetupSecurityComplete",
|
||||
.patch = my_usbSetupSecurityComplete,
|
||||
.link = (void **) &real_usbSetupSecurityComplete},
|
||||
{.name = "usbMute",
|
||||
.patch = my_usbMute,
|
||||
.link = (void **) &real_usbMute},
|
||||
{.name = "usbMute", .patch = my_usbMute, .link = (void **) &real_usbMute},
|
||||
{.name = "usbFirmResult",
|
||||
.patch = my_usbFirmResult,
|
||||
.link = (void **) &real_usbFirmResult},
|
||||
|
|
@ -158,14 +157,17 @@ static int my_usbGetSecurityKey(char* buffer)
|
|||
return res;
|
||||
}
|
||||
|
||||
static int my_usbBootSecurity(
|
||||
const char* boot_code, int seed_1, int seed_2, int seed_3)
|
||||
static int
|
||||
my_usbBootSecurity(const char *boot_code, int seed_1, int seed_2, int seed_3)
|
||||
{
|
||||
int res;
|
||||
|
||||
log_misc(
|
||||
"BEFORE usbBootSecurity, boot_code %s, seed_1 %d, seed_2 %d, seed_3 %d",
|
||||
boot_code, seed_1, seed_2, seed_3);
|
||||
boot_code,
|
||||
seed_1,
|
||||
seed_2,
|
||||
seed_3);
|
||||
|
||||
res = real_usbBootSecurity(boot_code, seed_1, seed_2, seed_3);
|
||||
|
||||
|
|
@ -180,7 +182,10 @@ static int my_usbSetupSecurityComplete(int val1, int val2, int val3, int val4)
|
|||
|
||||
log_misc(
|
||||
"BEFORE usbSetupSecurityComplete, val1 %d, val2 %d, val3 %d, val4 %d",
|
||||
val1, val2, val3, val4);
|
||||
val1,
|
||||
val2,
|
||||
val3,
|
||||
val4);
|
||||
|
||||
res = real_usbSetupSecurityComplete(val1, val2, val3, val4);
|
||||
|
||||
|
|
|
|||
|
|
@ -29,8 +29,8 @@
|
|||
#include "iidxhook-util/acio.h"
|
||||
#include "iidxhook-util/chart-patch.h"
|
||||
#include "iidxhook-util/clock.h"
|
||||
#include "iidxhook-util/config-ezusb.h"
|
||||
#include "iidxhook-util/config-eamuse.h"
|
||||
#include "iidxhook-util/config-ezusb.h"
|
||||
#include "iidxhook-util/config-gfx.h"
|
||||
#include "iidxhook-util/config-misc.h"
|
||||
#include "iidxhook-util/config-sec.h"
|
||||
|
|
|
|||
|
|
@ -21,7 +21,8 @@ static bool patch_memory_check_data(
|
|||
for (size_t i = 0; i < len; i++) {
|
||||
if (dest[i] != data_expected[i]) {
|
||||
log_warning(
|
||||
"Memcheck error: base %lluX + address %lluX + offset %d: expected %X, found %X",
|
||||
"Memcheck error: base %lluX + address %lluX + offset %d: "
|
||||
"expected %X, found %X",
|
||||
(uint64_t) base_address,
|
||||
(uint64_t) address,
|
||||
// this cast is technically wrong
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user