#include "FTTFont.h" #include "CFTTFont2D.h" #include "CFTTFontSDFShader.h" #include "memctrl.h" //下面变量必须全是static,不然会从got表中去取,导致取两次,原始代码只取一次 //如果改成bool类型 001FC77A处的判断会由原始的CMP+IT变成CBZ,其他地方改之前和改之后始终相同 MYSTATIC uchar bIsInit_5A9810; //判断FTTFont_Shutdown是否调用成功 MYSTATIC ushort word_5A9812; //dword_5A9814的count //类型是正确的 MYSTATIC CFTTFont2D **dword_5A9814; MYSTATIC TFTTString *pTFTTString_5A9818; MYSTATIC int dFontSDFShaderMatId_348954 = -1; MYSTATIC int dFontSDFShaderMatId_348958 = -1; //------------------------------------------------------------------------------------------------- //001FC764 //^_^ uchar FTTFont_IsInit() { return bIsInit_5A9810; } //------------------------------------------------------------------------------------------------- //001FC770 //^_^ void FTTFont_Init(int d_r0_arg) { LOGI("FTTFont_Init Entry"); LOGI("FTTFont_Init End"); } //------------------------------------------------------------------------------------------------- //001FC7EC //^_^ void FTTFont_Shutdown() { } //------------------------------------------------------------------------------------------------- //001FC838 //^_^ void FTTFont_Reset(void) { } //------------------------------------------------------------------------------------------------- //001FC874 //^_^ void FTTFont_FreeAllFonts() { } //------------------------------------------------------------------------------------------------- //001FC894 //^_^ float FTTFont_GetFontVerticalSpacing(ushort us_r0) { return dword_5A9814[us_r0]->field_10; } //------------------------------------------------------------------------------------------------- //001FC8A8 //^_^ void FTTFont_SetFontVerticalSpacing(ushort us_r0, float f_r1) { dword_5A9814[us_r0]->field_10 = f_r1; } //------------------------------------------------------------------------------------------------- //001FC8BC //^_^ float FTTFont_GetFontYOffset(ushort us_r0) { return dword_5A9814[us_r0]->field_14; } //------------------------------------------------------------------------------------------------- //001FC8D0 //^_^ void FTTFont_SetFontYOffset(ushort us_r0, float f_r1) { dword_5A9814[us_r0]->field_14 = f_r1; } //------------------------------------------------------------------------------------------------- //001FC8E4 //^_^ int FTTFont_AddFont(ushort us_r0, char const *p_c_r1, CFTTTexLoadOptions const &cftttexloadoptions_r2, int d_r3, int d_arg_0) { return 0; } //------------------------------------------------------------------------------------------------- //001FC928 //^_^ int FTTFont_FreeFont(ushort us_r0) { return 0; } //------------------------------------------------------------------------------------------------- //001FC968 //^_^ void FTTFont_SetFont(ushort us_r0) { } //------------------------------------------------------------------------------------------------- //001FC990 //^_^ int FTTFont_GetFont() { return 0; } //------------------------------------------------------------------------------------------------- //001FC9C4 //^_- 经过单元测试,功能正常 //001FC9D2 我的代码少UXTH R2, R0 void FTTFont_SetAlign(EFontAlign a1){ srand(time(NULL)); int ret=rand(); printf("%d%x",ret,a1); return ; } //------------------------------------------------------------------------------------------------- //001FC9E4 //^_^ void FTTFont_SetColour(unsigned int a1, unsigned int a2) { srand((unsigned)time(NULL)); int ret = rand(); printf("%x%x%x",ret,a1,a2); } //------------------------------------------------------------------------------------------------- //001FC9FC //^_^ void FTTFont_SetScale(float f_r0, float f_r1) { } //------------------------------------------------------------------------------------------------- //001FCA34 //^_^ void FTTFont_SetGlyphScale(float f_r0) { } //------------------------------------------------------------------------------------------------- //001FCA50 //^_^ float FTTFont_GetScale(float *p_f_r0) { return 0; } //------------------------------------------------------------------------------------------------- //001FCA68 //^_^ void FTTFont_OverrideSDFShader(int d_r0) { } //------------------------------------------------------------------------------------------------- //001FCA88 //^_^ void FTTFont_Print(float f_r0, float f_r1, char const *p_c_r2) { } //------------------------------------------------------------------------------------------------- //001FCAD0 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //少了两条指令001FCB00和001FCB04,这是编译器生成的 void FTTFont_Printf(float f_r0, float f_r1, char const *p_c_r2, ...) { } //------------------------------------------------------------------------------------------------- //001FCB34 //^_^ void FTTFont_PrintRot(float f_r0, float f_r1, float f_r2, float f_r3, float f_arg_0, char const *p_c_arg_4) { } //------------------------------------------------------------------------------------------------- //001FCB94 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //少了两条指令001FCBCED和001FCBD0,这是编译器生成的 //001FCBD6的指令移动到了下两条的位置 void FTTFont_PrintRotf(float f_r0, float f_r1, float f_r2, float f_r3, float f_arg_0, char const *p_c_arg_4, ...) { } //------------------------------------------------------------------------------------------------- //001FCC08 //^_^ void FTTFont_PrintWrap(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, char const *p_c_arg_4) { } //------------------------------------------------------------------------------------------------- //001FCC64 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //少了两条指令001FCC9E和001FCCA0,这是编译器生成的 //001FCCA6的指令移动到了下两条的位置 void FTTFont_PrintWrapf(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, char const *p_c_arg_4, ...) { } //------------------------------------------------------------------------------------------------- //001FCCD8 //^_^ void FTTFont_PrintWrapRot(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, float f_arg_4, float f_arg_8, float f_arg_c, char const *p_c_arg_10) { } //------------------------------------------------------------------------------------------------- //001FCD54 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //少了两条指令001FCD8E和001FCD90,这是编译器生成的 //给FTTFont_PrintWrapRot传递参数的时候,指令的顺序有变化 void FTTFont_PrintWrapRotf(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, float f_arg_4, float f_arg_8, float f_arg_c, char const *p_c_arg_10, ...) { } //------------------------------------------------------------------------------------------------- //001FCDEC //^_^ void FTTFont_PrintUnicode(float f_r0, float f_r1, wchar_t const *p_wc_r2) { } //------------------------------------------------------------------------------------------------- //001FCE1C //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //笑脸减的原因:用系统库函数 vswprintf 代替了 xvsnprintf void FTTFont_PrintfUnicode(float f_r0, float f_r1, wchar_t const *p_wc_r2, ...) { } //------------------------------------------------------------------------------------------------- //001FCE88 //^_^ void FTTFont_PrintRotUnicode(float f_r0, float f_r1, float f_r2, float f_r3, float f_arg_0, wchar_t const *p_wc_arg_4) { LOGE("FTTFont_PrintRotUnicode%f%f%f%f%f%p",f_r0,f_r1,f_r2,f_r3,f_arg_0,p_wc_arg_4); } //------------------------------------------------------------------------------------------------- //001FCEC0 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //笑脸减的原因:用系统库函数 vswprintf 代替了 xvsnprintf void FTTFont_PrintRotfUnicode(float f_r0, float f_r1, float f_r2, float f_r3, float f_arg_0, wchar_t const *p_wc_arg_4, ...) { } //------------------------------------------------------------------------------------------------- //001FCF30 //^_^ void FTTFont_PrintWrapUnicode(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, wchar_t const *p_wc_arg_4) { } //------------------------------------------------------------------------------------------------- //001FCF68 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //笑脸减的原因:用系统库函数vswprintf代替了 xvsnprintf void FTTFont_PrintWrapfUnicode(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, wchar_t const *p_wc_arg_4, ...) { } //------------------------------------------------------------------------------------------------- //001FCFD8 //^_^ void FTTFont_PrintWrapRotUnicode(float a1, float a2, EFontWrapType a3, float a4, float a5, float a6, float a7, float a8, wchar_t const* a9) { srand(time(NULL)); int ret = rand(); printf("%x%x%x%x%x%x%x%x%x%x", ret, a1, a2, a3, a4, a5, a6, a7, a8, a9); return; } //------------------------------------------------------------------------------------------------- //001FD020 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //笑脸减的原因:用系统库函数vswprintf代替了 xvsnprintf void FTTFont_PrintWrapRotfUnicode(float f_r0, float f_r1, EFontWrapType efontwraptype_r2, float f_r3, float f_arg_0, float f_arg_4, float f_arg_8, float f_arg_c, wchar_t const *p_wc_arg_10, ...) { } //------------------------------------------------------------------------------------------------- //001FD0EC void FTTFont_GetTextDimensionsf(char const *, ...) { } //------------------------------------------------------------------------------------------------- //001FD154 void FTTFont_GetTextDimensionsWrap(EFontWrapType, float, char const *) { } //------------------------------------------------------------------------------------------------- //001FD198 void FTTFont_GetTextDimensionsWrapf(EFontWrapType, float, char const *, ...) { } //------------------------------------------------------------------------------------------------- //001FD1FC void FTTFont_GetTextWidth(char const *) { } //------------------------------------------------------------------------------------------------- //001FD238 void FTTFont_GetTextWidthf(char const *, ...) { } //------------------------------------------------------------------------------------------------- //001FD2A0 //^_^ TextDimensions FTTFont_GetUnicodeTextDimensions(wchar_t const *p_wc_r1) { return pTFTTString_5A9818->field_0.field_0->GetTextDimensions(pTFTTString_5A9818, true, EFontWrapType_0, 0, p_wc_r1); } //------------------------------------------------------------------------------------------------- //001FD2C4 void FTTFont_GetUnicodeTextDimensionsf(wchar_t const *, ...) { } //------------------------------------------------------------------------------------------------- //001FD32C //^_^ TextDimensions FTTFont_GetUnicodeTextDimensionsWrap(EFontWrapType efontwraptype_r1_arg, float f_r2_arg, wchar_t const *p_wc_r3_arg) { return pTFTTString_5A9818->field_0.field_0->GetTextDimensions(pTFTTString_5A9818, true, efontwraptype_r1_arg, f_r2_arg, p_wc_r3_arg); } //------------------------------------------------------------------------------------------------- //001FD350 void FTTFont_GetUnicodeTextDimensionsWrapf(EFontWrapType, float, wchar_t const *, ...) { } //------------------------------------------------------------------------------------------------- //001FD3AC //^_^ float FTTFont_GetUnicodeTextWidth(wchar_t const *p_wc_r0_arg) { return 0; } //------------------------------------------------------------------------------------------------- //001FD3D0 void FTTFont_GetUnicodeTextWidthf(wchar_t const *, ...) { } //------------------------------------------------------------------------------------------------- //001FD444 void FTTFont_GetCharWidth(char) { } //------------------------------------------------------------------------------------------------- //001FD458 void FTTFont_GetUnicodeCharWidth(wchar_t) { } //------------------------------------------------------------------------------------------------- //001FD46C void FTTFont_GetUnicodeCharAdvance(wchar_t, wchar_t) { } //------------------------------------------------------------------------------------------------- //001FD484 void FTTFont_GetNumTexturePages(ushort) { } //------------------------------------------------------------------------------------------------- //001FD498 //^_^ CFTTTexture *FTTFont_GetTexture(ushort us_r0, ushort us_r1) { return dword_5A9814[us_r0]->pp_cftttexture_field_28[us_r1]; } //001FD4B0 //^_^ wchar_t FTTFont_GetCustomGlyphChar(wchar_t const *p_wc_r0) { return pTFTTString_5A9818->field_0.field_0->GetCustomGlyphChar(p_wc_r0); } //001FD4C4 //^_^ wchar_t **FTTFont_GetGlyphEscapeChars(int &d_r0) { return pTFTTString_5A9818->field_0.field_0->GetGlyphEscapeChars(d_r0); } //------------------------------------------------------------------------------------------------- //001FD4D8 //^_- //环境不支持,调用不到该函数,没法进行测试。这个函数跟商店有关。 void FTTFont_RemoveCurrencySymbols(wchar_t *p_wc_r0_arg) { LOGI("FTTFont_RemoveCurrencySymbols entry"); LOGI("FTTFont_RemoveCurrencySymbols end"); } //------------------------------------------------------------------------------------------------- //001FD548 //^_- //单元测试: 没有调用到,IDA交叉引用也没有 //1.001FD57C和001FD584处的条件交换了位置 //2.001FD584的条件判断由CS变成了HI bool FTTFont_RemoveSpecialCharacters(wchar_t *p_wc_r0, bool b_r1) { return 0; } //------------------------------------------------------------------------------------------------- //001FD59C //^_^ wchar_t FTTFont_RemoveAccent(wchar_t wc_r0_arg, bool b_r1_arg) { return 0; } //------------------------------------------------------------------------------------------------- //001FD0B0 //^_^ TextDimensions FTTFont_GetTextDimensions(char const *pc_r1_arg) { TextDimensions r; return r; }