This commit is contained in:
ineed bots 2023-09-18 00:52:18 -06:00
parent c1adb9aee3
commit c5195b4983
4 changed files with 17 additions and 16 deletions

View File

@ -3,7 +3,7 @@
#include "utils/hook.hpp"
//#include "codsrc/clientscript/cscr_animtree.hpp"
#ifndef DISABLE_RE_CSCR_YACC
#ifndef DISABLE_RE_CSCR_ANIMTREE
namespace re_cscr_animtree
{
utils::hook::detour AnimTreeCompileError_hook;

View File

@ -199,17 +199,17 @@ namespace re_cscr_yacc
public:
void post_unpack() override
{
LowerCase_hook.create(game::LowerCase(), LowerCase_stub);
LowerCase_hook.create(game::LowerCase_ADDR(), LowerCase_stub);
yyparse_hook.create(game::yyparse.get(), yyparse_stub);
StringValue_hook.create(game::StringValue(), StringValue_stub);
StringValue_hook.create(game::StringValue_ADDR(), StringValue_stub);
yylex_hook.create(game::yylex.get(), yylex_stub);
yy_get_next_buffer_hook.create(game::yy_get_next_buffer.get(), yy_get_next_buffer_stub);
yy_get_previous_state_hook.create(game::yy_get_previous_state.get(), yy_get_previous_state_stub);
yy_try_NUL_trans_hook.create(game::yy_try_NUL_trans(), yy_try_NUL_trans_stub);
yy_try_NUL_trans_hook.create(game::yy_try_NUL_trans_ADDR(), yy_try_NUL_trans_stub);
yyrestart_hook.create(game::yyrestart.get(), yyrestart_stub);
yy_create_buffer_hook.create(game::yy_create_buffer.get(), yy_create_buffer_stub);
yy_flush_buffer_hook.create(game::yy_flush_buffer(), yy_flush_buffer_stub);
ScriptParse_hook.create(game::ScriptParse(), ScriptParse_stub);
yy_flush_buffer_hook.create(game::yy_flush_buffer_ADDR(), yy_flush_buffer_stub);
ScriptParse_hook.create(game::ScriptParse_ADDR(), ScriptParse_stub);
//Original hook function addresses
LowerCase_original = LowerCase_hook.get_original();

View File

@ -9,16 +9,16 @@ namespace game
WEAK symbol<void()>yyrestart{ 0x0, 0x69D5C0 };
WEAK symbol<yy_buffer_state* ()>yy_create_buffer{ 0x0, 0x69D620 };
inline void* LowerCase() { return CALL_ADDR(0x0, 0x69AEA0); }
unsigned int LowerCase(unsigned int strVal, void* call_addr = LowerCase());
inline void* StringValue() { return CALL_ADDR(0x0, 0x69BFF0); }
int StringValue(int len, const char* str_, void* call_addr = StringValue());
inline void* yy_try_NUL_trans() { return CALL_ADDR(0x0, 0x69D520); }
int yy_try_NUL_trans(int yy_current_state, void* call_addr = yy_try_NUL_trans());
inline void* yy_flush_buffer() { return CALL_ADDR(0x0, 0x69D690); }
void yy_flush_buffer(yy_buffer_state* result, void* call_addr = yy_flush_buffer());
inline void* ScriptParse() { return CALL_ADDR(0x0, 0x69D710); }
void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr = ScriptParse());
inline void* LowerCase_ADDR() { return CALL_ADDR(0x0, 0x69AEA0); }
unsigned int LowerCase(unsigned int strVal, void* call_addr = LowerCase_ADDR());
inline void* StringValue_ADDR() { return CALL_ADDR(0x0, 0x69BFF0); }
int StringValue(int len, const char* str_, void* call_addr = StringValue_ADDR());
inline void* yy_try_NUL_trans_ADDR() { return CALL_ADDR(0x0, 0x69D520); }
int yy_try_NUL_trans(int yy_current_state, void* call_addr = yy_try_NUL_trans_ADDR());
inline void* yy_flush_buffer_ADDR() { return CALL_ADDR(0x0, 0x69D690); }
void yy_flush_buffer(yy_buffer_state* result, void* call_addr = yy_flush_buffer_ADDR());
inline void* ScriptParse_ADDR() { return CALL_ADDR(0x0, 0x69D710); }
void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr = ScriptParse_ADDR());
FILE* yy_load_buffer_state();
void yy_fatal_error(const char* err);

View File

@ -41,6 +41,7 @@
//#define DISABLE_RE_CSCR_PARSETREE
//#define DISABLE_RE_CSCR_READWRITE
//#define DISABLE_RE_CSCR_STRINGLIST
//#define DISABLE_RE_CSCR_VARIABLE
//#define DISABLE_RE_CSCR_VM
//#define DISABLE_RE_CSCR_YACC