{"type": "func", "start": 6442749248, "end": 6442749525, "name": "cocos2d::CCLabelBMFont::kerningAmountForFirst", "pseudocode": "// \n// cocos2d::CCLabelBMFont::kerningAmountForFirst from 0x180048d40 to 0x180048e55 (277 bytes)\n// \n// 2 xrefs:\n// > cocos2d::CCLabelBMFont::createFontChars @ 0x1800480e6\n// > <???> @ 0x1801438a8\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall cocos2d::CCLabelBMFont::kerningAmountForFirst(\n        cocos2d::CCLabelBMFont *this,\n        unsigned __int16 a2,\n        unsigned __int16 a3)\n{\n  int v3; // r9d\n  cocos2d::tCCKerningHashElement *m_pKerningDictionary; // r11\n  UT_hash_table *tbl; // r10\n  unsigned int v6; // edx\n  unsigned int v7; // r8d\n  unsigned int v8; // ecx\n  int v9; // edx\n  unsigned int v10; // r8d\n  unsigned int v11; // ecx\n  int v12; // edx\n  UT_hash_handle *hh_head; // rax\n  std::ptrdiff_t hho; // rdx\n  __int64 v15; // rax\n  __int64 v16; // rax\n\n  v3 = a3 | (a2 << 16);\n  m_pKerningDictionary = this->m_pConfiguration->m_pKerningDictionary;\n  if ( !m_pKerningDictionary )\n    return 0;\n  tbl = m_pKerningDictionary->hh.tbl;\n  v6 = ((v3 & 0xFF000000) + ((BYTE1(v3) + ((unsigned __int8)a2 << 8)) << 8) + (unsigned __int8)v3 + 17973517) ^ 0x7F76D;\n  v7 = (v6 << 8) ^ (-1622558010 - v6);\n  v8 = (v7 >> 13) ^ (-17973517 - v7 - v6);\n  v9 = (v8 >> 12) ^ (v6 - v7 - v8);\n  v10 = (v9 << 16) ^ (v7 - v9 - v8);\n  v11 = (v10 >> 5) ^ (v8 - v10 - v9);\n  v12 = (v11 >> 3) ^ (v9 - v10 - v11);\n  hh_head = tbl->buckets[(tbl->num_buckets - 1)\n                       & (((unsigned __int64)((v12 << 10) ^ (v10 - v12 - v11)) >> 15)\n                        ^ (v11 - ((v12 << 10) ^ (v10 - v12 - v11)) - v12))].hh_head;\n  if ( !hh_head )\n    return 0;\n  hho = tbl->hho;\n  v15 = (__int64)hh_head - hho;\n  if ( !v15 )\n    return 0;\n  while ( *(_DWORD *)(v15 + 56) != 4 || **(_DWORD **)(v15 + 48) != v3 )\n  {\n    v16 = *(_QWORD *)(v15 + 40);\n    if ( v16 )\n    {\n      v15 = v16 - hho;\n      if ( v15 )\n        continue;\n    }\n    return 0;\n  }\n  return *(unsigned int *)(v15 + 4);\n}", "assembly": "; \n; cocos2d::CCLabelBMFont::kerningAmountForFirst from 0x180048d40 to 0x180048e55 (277 bytes)\n; \n; 2 xrefs:\n; > cocos2d::CCLabelBMFont::createFontChars @ 0x1800480e6\n; > <???> @ 0x1801438a8\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmovzx   r10d, dx                                                       ; +0x0, 0x180048d40\nmovzx   eax, r8w                                                       ; +0x4, 0x180048d44\nmov     r9d, r10d                                                      ; +0x8, 0x180048d48\nshl     r9d, 10h                                                       ; +0xb, 0x180048d4b\nor      r9d, eax                                                       ; +0xf, 0x180048d4f\nmov     rax, [rcx+1D0h]                                                ; +0x12, 0x180048d52\nmov     edx, r9d                                                       ; +0x19, 0x180048d59\nshr     edx, 8                                                         ; +0x1c, 0x180048d5c\nmov     r11, [rax+78h]                                                 ; +0x1f, 0x180048d5f\ntest    r11, r11                                                       ; +0x23, 0x180048d63\njz      loc_180048E4E                                                  ; +0x26, 0x180048d66\nmovzx   eax, dl                                                        ; +0x2c, 0x180048d6c\nmov     r8d, 9F49BAC6h                                                 ; +0x2f, 0x180048d6f\nmovzx   ecx, r10b                                                      ; +0x35, 0x180048d75\nmov     r10, [r11+8]                                                   ; +0x39, 0x180048d79\nshl     ecx, 8                                                         ; +0x3d, 0x180048d7d\nadd     ecx, eax                                                       ; +0x40, 0x180048d80\nmovzx   edx, r9b                                                       ; +0x42, 0x180048d82\nshl     ecx, 8                                                         ; +0x46, 0x180048d86\nadd     edx, 112410Dh                                                  ; +0x49, 0x180048d89\nmov     eax, r9d                                                       ; +0x4f, 0x180048d8f\nand     eax, 0FF000000h                                                ; +0x52, 0x180048d92\nadd     ecx, eax                                                       ; +0x57, 0x180048d97\nadd     edx, ecx                                                       ; +0x59, 0x180048d99\nmov     ecx, 0FEEDBEF3h                                                ; +0x5b, 0x180048d9b\nxor     edx, 7F76Dh                                                    ; +0x60, 0x180048da0\nsub     r8d, edx                                                       ; +0x66, 0x180048da6\nmov     eax, edx                                                       ; +0x69, 0x180048da9\nshl     eax, 8                                                         ; +0x6b, 0x180048dab\nxor     r8d, eax                                                       ; +0x6e, 0x180048dae\nsub     ecx, r8d                                                       ; +0x71, 0x180048db1\nmov     eax, r8d                                                       ; +0x74, 0x180048db4\nsub     ecx, edx                                                       ; +0x77, 0x180048db7\nshr     eax, 0Dh                                                       ; +0x79, 0x180048db9\nxor     ecx, eax                                                       ; +0x7c, 0x180048dbc\nsub     edx, r8d                                                       ; +0x7e, 0x180048dbe\nsub     edx, ecx                                                       ; +0x81, 0x180048dc1\nmov     eax, ecx                                                       ; +0x83, 0x180048dc3\nshr     eax, 0Ch                                                       ; +0x85, 0x180048dc5\nxor     edx, eax                                                       ; +0x88, 0x180048dc8\nsub     r8d, edx                                                       ; +0x8a, 0x180048dca\nmov     eax, edx                                                       ; +0x8d, 0x180048dcd\nsub     r8d, ecx                                                       ; +0x8f, 0x180048dcf\nshl     eax, 10h                                                       ; +0x92, 0x180048dd2\nxor     r8d, eax                                                       ; +0x95, 0x180048dd5\nsub     ecx, r8d                                                       ; +0x98, 0x180048dd8\nmov     eax, r8d                                                       ; +0x9b, 0x180048ddb\nsub     ecx, edx                                                       ; +0x9e, 0x180048dde\nshr     eax, 5                                                         ; +0xa0, 0x180048de0\nxor     ecx, eax                                                       ; +0xa3, 0x180048de3\nsub     edx, r8d                                                       ; +0xa5, 0x180048de5\nsub     edx, ecx                                                       ; +0xa8, 0x180048de8\nmov     eax, ecx                                                       ; +0xaa, 0x180048dea\nshr     eax, 3                                                         ; +0xac, 0x180048dec\nxor     edx, eax                                                       ; +0xaf, 0x180048def\nsub     r8d, edx                                                       ; +0xb1, 0x180048df1\nmov     eax, edx                                                       ; +0xb4, 0x180048df4\nsub     r8d, ecx                                                       ; +0xb6, 0x180048df6\nshl     eax, 0Ah                                                       ; +0xb9, 0x180048df9\nxor     r8d, eax                                                       ; +0xbc, 0x180048dfc\nsub     ecx, r8d                                                       ; +0xbf, 0x180048dff\nmov     eax, r8d                                                       ; +0xc2, 0x180048e02\nsub     ecx, edx                                                       ; +0xc5, 0x180048e05\nshr     rax, 0Fh                                                       ; +0xc7, 0x180048e07\nmov     edx, ecx                                                       ; +0xcb, 0x180048e0b\nmov     ecx, [r10+8]                                                   ; +0xcd, 0x180048e0d\nxor     rdx, rax                                                       ; +0xd1, 0x180048e11\nmov     rax, [r10]                                                     ; +0xd4, 0x180048e14\ndec     ecx                                                            ; +0xd7, 0x180048e17\nand     rdx, rcx                                                       ; +0xd9, 0x180048e19\nadd     rdx, rdx                                                       ; +0xdc, 0x180048e1c\nmov     rax, [rax+rdx*8]                                               ; +0xdf, 0x180048e1f\ntest    rax, rax                                                       ; +0xe3, 0x180048e23\njz      short loc_180048E4E                                            ; +0xe6, 0x180048e26\nmov     rdx, [r10+20h]                                                 ; +0xe8, 0x180048e28\nsub     rax, rdx                                                       ; +0xec, 0x180048e2c\njz      short loc_180048E4E                                            ; +0xef, 0x180048e2f\ncmp     dword ptr [rax+38h], 4                                         ; +0xf1, 0x180048e31\njnz     short loc_180048E40                                            ; +0xf5, 0x180048e35\nmov     rcx, [rax+30h]                                                 ; +0xf7, 0x180048e37\ncmp     [rcx], r9d                                                     ; +0xfb, 0x180048e3b\njz      short loc_180048E51                                            ; +0xfe, 0x180048e3e\nmov     rax, [rax+28h]                                                 ; +0x100, 0x180048e40\ntest    rax, rax                                                       ; +0x104, 0x180048e44\njz      short loc_180048E4E                                            ; +0x107, 0x180048e47\nsub     rax, rdx                                                       ; +0x109, 0x180048e49\njnz     short loc_180048E31                                            ; +0x10c, 0x180048e4c\nxor     eax, eax                                                       ; +0x10e, 0x180048e4e\nretn                                                                   ; +0x110, 0x180048e50\nmov     eax, [rax+4]                                                   ; +0x111, 0x180048e51\nretn                                                                   ; +0x114, 0x180048e54", "xrefs": ["cocos2d::CCLabelBMFont::createFontChars @ 0x1800480e6", "<???> @ 0x1801438a8"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}