mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-07-04 18:21:50 +00:00
Added yacc and animtree detours
This commit is contained in:
@ -2254,6 +2254,7 @@ namespace game
|
||||
WEAK symbol<dvar_s*> sv_clientside{ 0x0, 0x3882B6C };
|
||||
WEAK symbol<char> error_message_buff{ 0x0, 0x3BE1E30 };
|
||||
WEAK symbol<scrCompileGlob_t> gScrCompileGlob{ 0x0, 0x3701FE0 };
|
||||
WEAK symbol<scrAnimGlob_t> gScrAnimGlob{ 0x0, 0x36BF320 };
|
||||
|
||||
WEAK symbol<unsigned char> g_parse_user{ 0x0, 0x234F72E };
|
||||
WEAK symbol<scriptInstance_t> gInst{ 0x0, 0x3BE624C };
|
||||
@ -2298,11 +2299,6 @@ namespace game
|
||||
WEAK symbol<int(jmp_buf buf, int count)>_setjmp3{ 0x0, 0x7E1894 };
|
||||
WEAK symbol<void(jmp_buf Buf, int Value)>longjmp{ 0x0, 0x7AD57C };
|
||||
|
||||
inline void* ScriptParse_ADDR() { return CALL_ADDR(0x0, 0x69D710); }
|
||||
void ScriptParse(scriptInstance_t inst, sval_u* parseData, void* call_addr = ScriptParse_ADDR());
|
||||
inline void* Scr_LoadAnimTreeAtIndex_ADDR() { return CALL_ADDR(0x0, 0x67E7D0); }
|
||||
void Scr_LoadAnimTreeAtIndex(scriptInstance_t inst, int user, unsigned int index, void* (__cdecl* Alloc)(int), int modCheckSum, void* call_addr = Scr_LoadAnimTreeAtIndex_ADDR());
|
||||
|
||||
inline void* CScr_SetEntityField_ADDR() { return CALL_ADDR(0x0, 0x671470); }
|
||||
int CScr_SetEntityField(int ofs, int entnum, unsigned int clientnum, void* call_addr = CScr_SetEntityField_ADDR());
|
||||
inline void* Scr_SetObjectField_ADDR() { return CALL_ADDR(0x0, 0x5469C0); }
|
||||
@ -2324,4 +2320,6 @@ namespace game
|
||||
#include "cscr_variable.hpp"
|
||||
#include "cscr_vm.hpp"
|
||||
#include "cscr_compiler.hpp"
|
||||
#include "cscr_yacc.hpp"
|
||||
#include "cscr_animtree.hpp"
|
||||
#endif
|
||||
|
@ -2,33 +2,6 @@
|
||||
|
||||
namespace game
|
||||
{
|
||||
// void __usercall ScriptParse(scriptInstance_t a1@<eax>, sval_u *parseData)
|
||||
void ScriptParse(scriptInstance_t inst, sval_u* parseData, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push parseData;
|
||||
mov eax, inst;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_LoadAnimTreeAtIndex(scriptInstance_t inst@<ecx>, int a2@<eax>, int a3, int (__cdecl *a4)(int), int a5)
|
||||
void Scr_LoadAnimTreeAtIndex(scriptInstance_t inst, int user, unsigned int index, void* (__cdecl* Alloc)(int), int modCheckSum, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push modCheckSum;
|
||||
push Alloc;
|
||||
push index;
|
||||
mov eax, user;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
int CScr_SetEntityField/*@<eax>*/(int ofs/*@<edx>*/, int entnum/*@<ecx>*/, unsigned int clientnum, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
35
src/game/clientscript/cscr_animtree.hpp
Normal file
35
src/game/clientscript/cscr_animtree.hpp
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<void(scriptInstance_t inst, const char * errorMsg)>AnimTreeCompileError{ 0x0, 0x67D4B0};
|
||||
WEAK symbol<int(scriptInstance_t inst)>GetAnimTreeParseProperties{ 0x0, 0x67D510};
|
||||
WEAK symbol<char(scriptInstance_t inst, int parentId, int names, int bIncludeParent, int bLoop, int bComplete)>AnimTreeParseInternal{ 0x0, 0x67D770};
|
||||
WEAK symbol<int(scriptInstance_t inst, unsigned int parentNode)>Scr_GetAnimTreeSize{ 0x0, 0x67DE20};
|
||||
WEAK symbol<int(scriptInstance_t inst, unsigned int parentNode, unsigned int rootData, XAnim_s* animtree, unsigned int childIndex, const char* name, unsigned int parentIndex, unsigned int filename, int treeIndex, int flags)>Scr_CreateAnimationTree{ 0x0, 0x67DFB0};
|
||||
WEAK symbol<void(scriptInstance_t inst, unsigned int parentNode)>Scr_PrecacheAnimationTree{ 0x0, 0x67E360};
|
||||
WEAK symbol<void(const char * animtreeName)>Scr_SetAnimTreeConfigstring{ 0x0, 0x67E670};
|
||||
|
||||
inline void* Scr_EmitAnimationInternal_ADDR() { return CALL_ADDR(0x0, 0x67D6B0); }
|
||||
void Scr_EmitAnimationInternal(scriptInstance_t inst, const char * pos, unsigned int animName, unsigned int names, void* call_addr = Scr_EmitAnimationInternal_ADDR());
|
||||
inline void* Scr_AnimTreeParse_ADDR() { return CALL_ADDR(0x0, 0x67DDA0); }
|
||||
void Scr_AnimTreeParse(scriptInstance_t inst, const char * pos, unsigned int parentNode, unsigned int names, void* call_addr = Scr_AnimTreeParse_ADDR());
|
||||
inline void* ConnectScriptToAnim_ADDR() { return CALL_ADDR(0x0, 0x67DEC0); }
|
||||
void ConnectScriptToAnim(unsigned int name, unsigned int names, scriptInstance_t inst, int index, unsigned int filename, int treeIndex, void* call_addr = ConnectScriptToAnim_ADDR());
|
||||
inline void* Scr_GetAnimsIndex_ADDR() { return CALL_ADDR(0x0, 0x67DF90); }
|
||||
int Scr_GetAnimsIndex(XAnim_s * anim, void* call_addr = Scr_GetAnimsIndex_ADDR());
|
||||
inline void* Scr_CheckAnimsDefined_ADDR() { return CALL_ADDR(0x0, 0x67E260); }
|
||||
void Scr_CheckAnimsDefined(unsigned int names, scriptInstance_t a2, unsigned int filename, void* call_addr = Scr_CheckAnimsDefined_ADDR());
|
||||
inline void* Scr_UsingTreeInternal_ADDR() { return CALL_ADDR(0x0, 0x67E420); }
|
||||
unsigned int Scr_UsingTreeInternal(const char * filename, int user, scriptInstance_t inst, unsigned int * index, void* call_addr = Scr_UsingTreeInternal_ADDR());
|
||||
inline void* Scr_UsingTree_ADDR() { return CALL_ADDR(0x0, 0x67E5F0); }
|
||||
void Scr_UsingTree(scriptInstance_t a1, const char * filename, unsigned int sourcePos, void* call_addr = Scr_UsingTree_ADDR());
|
||||
inline void* Scr_LoadAnimTreeInternal_ADDR() { return CALL_ADDR(0x0, 0x67E710); }
|
||||
bool Scr_LoadAnimTreeInternal(const char * animtreeName, scriptInstance_t inst, unsigned int parentNode, unsigned int names, void* call_addr = Scr_LoadAnimTreeInternal_ADDR());
|
||||
inline void* Scr_LoadAnimTreeAtIndex_ADDR() { return CALL_ADDR(0x0, 0x67E7D0); }
|
||||
void Scr_LoadAnimTreeAtIndex(scriptInstance_t inst, int user, unsigned int index, void *(__cdecl * Alloc)(int), int modCheckSum, void* call_addr = Scr_LoadAnimTreeAtIndex_ADDR());
|
||||
inline void* Scr_FindAnimTree_ADDR() { return CALL_ADDR(0x0, 0x67EA70); }
|
||||
scr_animtree_t Scr_FindAnimTree(const char * filename, void* call_addr = Scr_FindAnimTree_ADDR());
|
||||
inline void* Scr_FindAnim_ADDR() { return CALL_ADDR(0x0, 0x67EB10); }
|
||||
void Scr_FindAnim(const char * animName, scr_anim_s a2, int user, void* call_addr = Scr_FindAnim_ADDR());
|
||||
}
|
172
src/game/clientscript/cscr_animtree_w.cpp
Normal file
172
src/game/clientscript/cscr_animtree_w.cpp
Normal file
@ -0,0 +1,172 @@
|
||||
#include <stdinc.hpp>
|
||||
//#include "codsrc/clientscript/cscr_animtree.hpp"
|
||||
|
||||
namespace game
|
||||
{
|
||||
// void __usercall Scr_EmitAnimationInternal(scriptInstance_t inst@<edi>, const char *pos, unsigned int animName, unsigned int names)
|
||||
void Scr_EmitAnimationInternal(scriptInstance_t inst, const char * pos, unsigned int animName, unsigned int names, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push names;
|
||||
push animName;
|
||||
push pos;
|
||||
mov edi, inst;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall Scr_AnimTreeParse(scriptInstance_t inst@<eax>, const char *pos@<edi>, unsigned int parentNode, unsigned int names)
|
||||
void Scr_AnimTreeParse(scriptInstance_t inst, const char * pos, unsigned int parentNode, unsigned int names, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push names;
|
||||
push parentNode;
|
||||
mov eax, inst;
|
||||
mov edi, pos;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall ConnectScriptToAnim(unsigned int name@<eax>, unsigned int names@<edi>, scriptInstance_t inst, int index, unsigned int filename, int treeIndex)
|
||||
void ConnectScriptToAnim(unsigned int name, unsigned int names, scriptInstance_t inst, int index, unsigned int filename, int treeIndex, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push treeIndex;
|
||||
push filename;
|
||||
push index;
|
||||
push inst;
|
||||
mov eax, name;
|
||||
mov edi, names;
|
||||
call call_addr;
|
||||
add esp, 0x10;
|
||||
}
|
||||
}
|
||||
|
||||
// int __usercall Scr_GetAnimsIndex@<eax>(XAnim_s *anim@<ecx>)
|
||||
int Scr_GetAnimsIndex(XAnim_s * anim, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, anim;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_CheckAnimsDefined(unsigned int names@<eax>, scriptInstance_t a2@<ecx>, unsigned int filename)
|
||||
void Scr_CheckAnimsDefined(unsigned int names, scriptInstance_t a2, unsigned int filename, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push filename;
|
||||
mov eax, names;
|
||||
mov ecx, a2;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
|
||||
// unsigned int __usercall Scr_UsingTreeInternal@<eax>(const char *filename@<eax>, int user@<ecx>, scriptInstance_t inst, unsigned int *index)
|
||||
unsigned int Scr_UsingTreeInternal(const char * filename, int user, scriptInstance_t inst, unsigned int * index, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push index;
|
||||
push inst;
|
||||
mov eax, filename;
|
||||
mov ecx, user;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_UsingTree(scriptInstance_t a1@<edi>, const char *filename, unsigned int sourcePos)
|
||||
void Scr_UsingTree(scriptInstance_t a1, const char * filename, unsigned int sourcePos, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push sourcePos;
|
||||
push filename;
|
||||
mov edi, a1;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
// bool __usercall Scr_LoadAnimTreeInternal@<al>(const char *animtreeName@<eax>, scriptInstance_t inst@<ecx>, unsigned int parentNode, unsigned int names)
|
||||
bool Scr_LoadAnimTreeInternal(const char * animtreeName, scriptInstance_t inst, unsigned int parentNode, unsigned int names, void* call_addr)
|
||||
{
|
||||
bool answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
push names;
|
||||
push parentNode;
|
||||
mov eax, animtreeName;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
mov answer, al;
|
||||
add esp, 0x8;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_LoadAnimTreeAtIndex(scriptInstance_t inst@<ecx>, int a2@<eax>, int a3, int (__cdecl *a4)(int), int a5)
|
||||
void Scr_LoadAnimTreeAtIndex(scriptInstance_t inst, int user, unsigned int index, void* (__cdecl* Alloc)(int), int modCheckSum, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push modCheckSum;
|
||||
push Alloc;
|
||||
push index;
|
||||
mov eax, user;
|
||||
mov ecx, inst;
|
||||
call call_addr;
|
||||
add esp, 0xC;
|
||||
}
|
||||
}
|
||||
|
||||
// XAnim_s *__usercall Scr_FindAnimTree@<eax>(const char *filename@<eax>)
|
||||
scr_animtree_t Scr_FindAnimTree(const char * filename, void* call_addr)
|
||||
{
|
||||
scr_animtree_t answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, filename;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall Scr_FindAnim(const char *animName@<edx>, scr_anim_s a2, int user)
|
||||
void Scr_FindAnim(const char * animName, scr_anim_s a2, int user, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push user;
|
||||
push a2;
|
||||
mov edx, animName;
|
||||
call call_addr;
|
||||
add esp, 0x8;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
22
src/game/clientscript/cscr_yacc.hpp
Normal file
22
src/game/clientscript/cscr_yacc.hpp
Normal file
@ -0,0 +1,22 @@
|
||||
#pragma once
|
||||
|
||||
namespace game
|
||||
{
|
||||
WEAK symbol<int()>yyparse{ 0x0, 0x69AEC0 };
|
||||
WEAK symbol<int()>yylex{ 0x0, 0x69C0D0 };
|
||||
WEAK symbol<int()>yy_get_next_buffer{ 0x0, 0x69D300 };
|
||||
WEAK symbol<int()>yy_get_previous_state{ 0x0, 0x69D450 };
|
||||
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());
|
||||
}
|
73
src/game/clientscript/cscr_yacc_w.cpp
Normal file
73
src/game/clientscript/cscr_yacc_w.cpp
Normal file
@ -0,0 +1,73 @@
|
||||
#include <stdinc.hpp>
|
||||
//#include "codsrc/clientscript/cscr_yacc.hpp"
|
||||
|
||||
namespace game
|
||||
{
|
||||
// unsigned int __usercall LowerCase@<eax>(unsigned int strVal@<ecx>)
|
||||
unsigned int LowerCase(unsigned int strVal, void* call_addr)
|
||||
{
|
||||
unsigned int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, strVal;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall StringValue@<eax>(int len@<ecx>, const char *str@<edx>)
|
||||
int StringValue(int len, const char* str_, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov ecx, len;
|
||||
mov edx, str_;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// int __usercall yy_try_NUL_trans@<eax>(int yy_current_state@<eax>)
|
||||
int yy_try_NUL_trans(int yy_current_state, void* call_addr)
|
||||
{
|
||||
int answer;
|
||||
|
||||
__asm
|
||||
{
|
||||
mov eax, yy_current_state;
|
||||
call call_addr;
|
||||
mov answer, eax;
|
||||
}
|
||||
|
||||
return answer;
|
||||
}
|
||||
|
||||
// void __usercall yy_flush_buffer(yy_buffer_state *result@<eax>)
|
||||
void yy_flush_buffer(yy_buffer_state* result, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
mov eax, result;
|
||||
call call_addr;
|
||||
}
|
||||
}
|
||||
|
||||
// void __usercall ScriptParse(scriptInstance_t a1@<eax>, sval_u *parseData)
|
||||
void ScriptParse(scriptInstance_t a1, sval_u* parseData, void* call_addr)
|
||||
{
|
||||
__asm
|
||||
{
|
||||
push parseData;
|
||||
mov eax, a1;
|
||||
call call_addr;
|
||||
add esp, 0x4;
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user