Spellforce-Spell-framework
Toggle main menu visibility
Loading...
Searching...
No Matches
sf_console_hook.c
Go to the documentation of this file.
1
6
7
#include "
../sf_wrappers.h
"
8
#include "
sf_console_hook.h
"
9
13
static
console_print_ptr
s_console_print;
14
18
void
console_log
(
const
char
*message)
19
{
20
if
(s_console_print != NULL)
21
{
22
uint32_t _application =
ASI::AddrOf
(0x925C64);
23
s_console_print(_application, message);
24
}
25
else
26
{
27
OutputDebugStringA(message);
28
}
29
// Appened to log file
30
log_message
(
"sfsf.log"
, message);
31
}
32
36
void
initialize_console_data_hooks
()
37
{
38
//uint32_t CAppMain_ptr = ASI::AddrOf(0x9229A8);
39
//uint32_t CAppMenu_ptr = *(uint32_t *)(CAppMain_ptr + 0x4);
40
//uint32_t CMnuScrConsole_ptr = *(uint32_t *)(CAppMenu_ptr + 0x80);
41
s_console_print = (
console_print_ptr
)
ASI::AddrOf
(0x1b58f0);
42
g_create_sf_string
= (
SF_String_ctor_ptr
)
ASI::AddrOf
(0x3837e0);
43
g_destroy_sf_string
= (
SF_String_dtor_ptr
)
ASI::AddrOf
(0x3839c0);
44
}
initialize_console_data_hooks
void initialize_console_data_hooks()
Definition
sf_console_hook.c:36
console_log
void console_log(const char *message)
Definition
sf_console_hook.c:18
log_message
void log_message(const char *filename, const char *format,...)
Definition
sf_wrappers.c:91
g_create_sf_string
SF_String_ctor_ptr g_create_sf_string
Definition
sf_wrappers.c:29
g_destroy_sf_string
SF_String_dtor_ptr g_destroy_sf_string
Definition
sf_wrappers.c:30
ASI::AddrOf
int AddrOf(int offset)
returns "real" virtual address of given memory offset
Definition
sf_asi.h:135
sf_console_hook.h
console_print_ptr
void(__thiscall * console_print_ptr)(uint32_t, const char *)
Definition
sf_general_structures.h:1694
sf_wrappers.h
SF_String_ctor_ptr
SF_String *(__thiscall * SF_String_ctor_ptr)(SF_String *, const char *)
Definition
sf_wrappers.h:13
SF_String_dtor_ptr
void(__thiscall * SF_String_dtor_ptr)(SF_String *)
Definition
sf_wrappers.h:14
src
internal
core
hooks
sf_console_hook.c
Generated by
1.17.0