mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-07-03 09:41:49 +00:00
370 lines
7.8 KiB
C++
370 lines
7.8 KiB
C++
#include <stdinc.hpp>
|
|
#include "codsrc/clientscript/cscr_stringlist.hpp"
|
|
|
|
namespace game
|
|
{
|
|
// char *__usercall SL_ConvertToString@<eax>(unsigned int id@<eax>, scriptInstance_t inst@<ecx>)
|
|
char* SL_ConvertToString(unsigned int id, scriptInstance_t inst, void* call_addr)
|
|
{
|
|
char* answer;
|
|
|
|
__asm
|
|
{
|
|
mov eax, id;
|
|
mov ecx, inst;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// int __usercall SL_GetStringLen@<eax>(unsigned int a1@<eax>, scriptInstance_t a2@<ecx>)
|
|
int SL_GetStringLen(unsigned int a1, scriptInstance_t a2, void* call_addr)
|
|
{
|
|
int answer;
|
|
|
|
__asm
|
|
{
|
|
mov eax, a1;
|
|
mov ecx, a2;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall GetHashCode@<eax>(unsigned int a1@<eax>, char *a2@<edx>)
|
|
unsigned int GetHashCode(unsigned int a1, const char* a2, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
mov eax, a1;
|
|
mov edx, a2;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// void __usercall SL_Init(scriptInstance_t a1@<eax>)
|
|
void SL_Init(scriptInstance_t a1, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
mov eax, a1;
|
|
call call_addr;
|
|
}
|
|
}
|
|
|
|
// unsigned int __usercall SL_FindStringOfSize@<eax>(scriptInstance_t inst@<eax>, const char *str, unsigned int len)
|
|
unsigned int SL_FindStringOfSize(scriptInstance_t inst, const char* str_, unsigned int len, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push len;
|
|
push str_;
|
|
mov eax, inst;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x8;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_FindString@<eax>(char *a1@<edx>, scriptInstance_t a2)
|
|
unsigned int SL_FindString(const char* a1, scriptInstance_t a2, void* call_addr)
|
|
{
|
|
#if 0
|
|
cscr_stringlist::SL_FindString
|
|
#endif
|
|
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push a2;
|
|
mov edx, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x4;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// signed __int32 __usercall SL_AddUserInternal@<eax>(int user@<eax>, volatile signed __int32 *a2@<edx>)
|
|
signed __int32 SL_AddUserInternal(unsigned int user, RefString* a2, void* call_addr)
|
|
{
|
|
signed __int32 answer;
|
|
|
|
__asm
|
|
{
|
|
mov eax, user;
|
|
mov edx, a2;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// int __usercall Mark_ScriptStringCustom@<eax>(int a1@<eax>)
|
|
int Mark_ScriptStringCustom(unsigned int a1, void* call_addr)
|
|
{
|
|
int answer;
|
|
|
|
__asm
|
|
{
|
|
mov eax, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_GetString_@<eax>(char *a1@<edx>, scriptInstance_t a2, int user)
|
|
unsigned int SL_GetString_(const char* a1, scriptInstance_t a2, unsigned int user, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push user;
|
|
push a2;
|
|
mov edx, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x8;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_GetString__0@<eax>(char *a1@<edx>, int user, scriptInstance_t a3)
|
|
unsigned int SL_GetString__0(const char* a1, unsigned int user, scriptInstance_t a3, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push a3;
|
|
push user;
|
|
mov edx, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x8;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_GetLowercaseString@<eax>(const char *a2@<edx>)
|
|
unsigned int SL_GetLowercaseString(const char* a2, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
mov edx, a2;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// void __usercall SL_TransferRefToUser(unsigned int stringValue@<eax>, int user@<ecx>, scriptInstance_t inst)
|
|
void SL_TransferRefToUser(unsigned int stringValue, int user, scriptInstance_t inst, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
push inst;
|
|
mov eax, stringValue;
|
|
mov ecx, user;
|
|
call call_addr;
|
|
add esp, 0x4;
|
|
}
|
|
}
|
|
|
|
// void __usercall SL_RemoveRefToString(unsigned int stringVal@<edx>, scriptInstance_t inst@<esi>)
|
|
void SL_RemoveRefToString(unsigned int stringVal/*@<edx>*/, scriptInstance_t inst/*@<esi>*/, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
mov edx, stringVal;
|
|
mov esi, inst;
|
|
call call_addr;
|
|
}
|
|
}
|
|
|
|
// void __usercall Scr_SetString(scriptInstance_t inst@<eax>, unsigned int from@<edi>, unsigned __int16 *to)
|
|
void Scr_SetString(scriptInstance_t inst, unsigned int from, unsigned __int16* to, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
push to;
|
|
mov eax, inst;
|
|
mov edi, from;
|
|
call call_addr;
|
|
add esp, 0x4;
|
|
}
|
|
}
|
|
|
|
// unsigned int __usercall Scr_SetStringFromCharString@<eax>(char *a1@<edi>, _WORD *a2)
|
|
void Scr_SetStringFromCharString(const char* a1, unsigned short* a2, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
push a2;
|
|
mov edi, a1;
|
|
call call_addr;
|
|
add esp, 0x4;
|
|
}
|
|
}
|
|
|
|
// unsigned int __usercall GScr_AllocString@<eax>(char *a1@<edx>, scriptInstance_t inst)
|
|
unsigned int GScr_AllocString(const char* a1, scriptInstance_t inst, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push inst;
|
|
mov edx, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x4;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_GetStringForFloat@<eax>(float a1@<xmm0>, scriptInstance_t a2)
|
|
unsigned int SL_GetStringForFloat(float a1, scriptInstance_t a2, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push a2;
|
|
movsd xmm0, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x4;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_GetStringForInt@<eax>(int a1@<eax>, scriptInstance_t a2)
|
|
unsigned int SL_GetStringForInt(int a1, scriptInstance_t a2, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push a2;
|
|
mov eax, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x4;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// unsigned int __usercall SL_GetStringForVector@<eax>(float *a1@<eax>, scriptInstance_t a2)
|
|
unsigned int SL_GetStringForVector(float* a1, scriptInstance_t a2, void* call_addr)
|
|
{
|
|
unsigned int answer;
|
|
|
|
__asm
|
|
{
|
|
push a2;
|
|
mov eax, a1;
|
|
call call_addr;
|
|
mov answer, eax;
|
|
add esp, 0x4;
|
|
}
|
|
|
|
return answer;
|
|
}
|
|
|
|
// void __usercall SL_ShutdownSystem(scriptInstance_t a1@<edi>, unsigned int a2)
|
|
void SL_ShutdownSystem(scriptInstance_t a1, unsigned int a2, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
push a2;
|
|
mov edi, a1;
|
|
call call_addr;
|
|
add esp, 0x4;
|
|
}
|
|
}
|
|
|
|
// void __usercall CreateCanonicalFilename(const char *a1@<eax>, char *a2)
|
|
void SL_CreateCanonicalFilename(const char* a1, char* a2, void* call_addr)
|
|
{
|
|
__asm
|
|
{
|
|
push a2;
|
|
mov eax, a1;
|
|
call call_addr;
|
|
add esp, 0x4;
|
|
}
|
|
}
|
|
|
|
RefString* GetRefString(scriptInstance_t inst, unsigned int id)
|
|
{
|
|
return codsrc::GetRefString(inst, id);
|
|
}
|
|
|
|
void SL_AddRefToString(scriptInstance_t inst, unsigned int stringValue)
|
|
{
|
|
codsrc::SL_AddRefToString(inst, stringValue);
|
|
}
|
|
|
|
void SL_RemoveRefToStringOfSize(scriptInstance_t inst, unsigned int stringValue, unsigned int len)
|
|
{
|
|
codsrc::SL_RemoveRefToStringOfSize(inst, stringValue, len);
|
|
}
|
|
|
|
int SL_GetRefStringLen(RefString* refString)
|
|
{
|
|
return codsrc::SL_GetRefStringLen(refString);
|
|
}
|
|
|
|
void SL_AddUser(unsigned int stringValue, unsigned int user, scriptInstance_t inst)
|
|
{
|
|
codsrc::SL_AddUser(stringValue, user, inst);
|
|
}
|
|
|
|
int SL_ConvertFromString(scriptInstance_t inst, const char* str)
|
|
{
|
|
return codsrc::SL_ConvertFromString(inst, str);
|
|
}
|
|
|
|
int SL_ConvertFromRefString(scriptInstance_t inst, RefString* refString)
|
|
{
|
|
return codsrc::SL_ConvertFromRefString(inst, refString);
|
|
}
|
|
|
|
RefString* GetRefString_0(scriptInstance_t inst, const char* str)
|
|
{
|
|
return codsrc::GetRefString_0(inst, str);
|
|
}
|
|
|
|
const char* SL_ConvertToStringSafe(unsigned int id, game::scriptInstance_t inst)
|
|
{
|
|
return codsrc::SL_ConvertToStringSafe(id, inst);
|
|
}
|
|
} |