1
0
mirror of https://gitea.tendokyu.moe/Dniel97/segatools.git synced 2024-11-11 23:17:08 +01:00

Add j_printf spike flavor

This commit is contained in:
Tau 2018-11-28 11:49:10 -05:00
parent 51e4eca7dd
commit 25a1898747

View File

@ -26,6 +26,17 @@ static void spike_fn_fputs(const char *msg)
OutputDebugStringA(msg);
}
static void spike_fn_printf(const char *fmt, ...)
{
char line[512];
va_list ap;
va_start(ap, fmt);
vsprintf_s(line, _countof(line), fmt, ap);
strcat(line, "\n");
OutputDebugStringA(line);
}
static void spike_fn_vprintf(
const char *proc,
int line_no,
@ -167,6 +178,12 @@ void spike_hook_init(const char *path)
spike_insert_jmp((ptrdiff_t) rva, spike_fn_vwprintf);
}
match = sscanf(line, "j_printf %i", &rva);
if (match == 1) {
spike_insert_jmp((ptrdiff_t) rva, spike_fn_printf);
}
match = sscanf(line, "j_puts %i", &rva);
if (match == 1) {