{"type": "func", "start": 4298124656, "end": 4298124916, "name": "GJPathSprite::init", "pseudocode": "// \n// GJPathSprite::init from 0x100302d70 to 0x100302e74 (260 bytes)\n// \n// 5 xrefs:\n// > GJPathsLayer::init @ 0x1002fe866\n// > GJPathSprite::create @ 0x1002fe96b\n// > GJPathPage::init @ 0x1002ff7e6\n// > GJPathPage::playUnlockAnimation @ 0x100300fda\n// > GJPathPage::unlockAnimationStep3 @ 0x100302117\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\nbool __fastcall GJPathSprite::init(GJPathSprite *a1, int a2)\n{\n  double v2; // xmm0_8\n  int v3; // ebx\n  GJPathSprite *v4; // r14\n  cocos2d::CCString *v5; // rax\n  const char *CString; // r12\n  size_t v7; // rax\n  size_t v8; // r15\n  char *v9; // r13\n  const char *v10; // rsi\n  size_t v11; // rbx\n  bool result; // al\n  bool v13; // bl\n  char v14; // [rsp+0h] [rbp-50h]\n  _QWORD __dst[2]; // [rsp+10h] [rbp-40h] BYREF\n  void *__p; // [rsp+20h] [rbp-30h]\n\n  v3 = a2;\n  v4 = a1;\n  v5 = (cocos2d::CCString *)sub_1007AB580(\"pathIcon_%02d_001.png\", v14);\n  CString = cocos2d::CCString::getCString(v5);\n  v7 = strlen(CString);\n  if ( v7 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v2);\n  v8 = v7;\n  if ( v7 >= 0x17 )\n  {\n    v11 = 26;\n    if ( (v7 | 7) != 0x17 )\n      v11 = (v7 | 7) + 1;\n    v9 = (char *)operator new(v11);\n    __p = v9;\n    __dst[0] = v11 + 1;\n    v3 = a2;\n    v4 = a1;\n    __dst[1] = v8;\nLABEL_9:\n    memmove(v9, CString, v8);\n    v9[v8] = 0;\n    if ( (__dst[0] & 1) != 0 )\n      goto LABEL_5;\n    goto LABEL_10;\n  }\n  LOBYTE(__dst[0]) = 2 * v7;\n  v9 = (char *)__dst + 1;\n  if ( v7 )\n    goto LABEL_9;\n  BYTE1(__dst[0]) = 0;\n  if ( (__dst[0] & 1) != 0 )\n  {\nLABEL_5:\n    v10 = (const char *)__p;\n    goto LABEL_11;\n  }\nLABEL_10:\n  v10 = (char *)__dst + 1;\nLABEL_11:\n  result = cocos2d::CCSprite::initWithSpriteFrameName(v4, v10);\n  if ( result )\n    v4->m_pathNumber = v3;\n  if ( (__dst[0] & 1) != 0 )\n  {\n    v13 = result;\n    operator delete(__p);\n    return v13;\n  }\n  return result;\n}", "assembly": "; \n; GJPathSprite::init from 0x100302d70 to 0x100302e74 (260 bytes)\n; \n; 5 xrefs:\n; > GJPathsLayer::init @ 0x1002fe866\n; > GJPathSprite::create @ 0x1002fe96b\n; > GJPathPage::init @ 0x1002ff7e6\n; > GJPathPage::playUnlockAnimation @ 0x100300fda\n; > GJPathPage::unlockAnimationStep3 @ 0x100302117\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\npush    rbp                                                            ; +0x0, 0x100302d70\nmov     rbp, rsp                                                       ; +0x1, 0x100302d71\npush    r15                                                            ; +0x4, 0x100302d74\npush    r14                                                            ; +0x6, 0x100302d76\npush    r13                                                            ; +0x8, 0x100302d78\npush    r12                                                            ; +0xa, 0x100302d7a\npush    rbx                                                            ; +0xc, 0x100302d7c\nsub     rsp, 28h                                                       ; +0xd, 0x100302d7d\nmov     ebx, esi                                                       ; +0x11, 0x100302d81\nmov     r14, rdi                                                       ; +0x13, 0x100302d83\nlea     rdi, aPathicon02d001; \"pathIcon_%02d_001.png\"                  ; +0x16, 0x100302d86\nxor     eax, eax                                                       ; +0x1d, 0x100302d8d\ncall    sub_1007AB580                                                  ; +0x1f, 0x100302d8f\nmov     rdi, rax                                                       ; +0x24, 0x100302d94\ncall    cocos2d__CCString__getCString                                  ; +0x27, 0x100302d97\nmov     r12, rax                                                       ; +0x2c, 0x100302d9c\nmov     rdi, rax; __s                                                  ; +0x2f, 0x100302d9f\ncall    _strlen                                                        ; +0x32, 0x100302da2\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x37, 0x100302da7\njnb     loc_100302E6F                                                  ; +0x3b, 0x100302dab\nmov     r15, rax                                                       ; +0x41, 0x100302db1\ncmp     rax, 17h                                                       ; +0x44, 0x100302db4\njnb     short loc_100302DDC                                            ; +0x48, 0x100302db8\nlea     eax, [r15+r15]                                                 ; +0x4a, 0x100302dba\nmov     byte ptr [rbp+__dst], al                                       ; +0x4e, 0x100302dbe\nlea     r13, [rbp+__dst+1]                                             ; +0x51, 0x100302dc1\ntest    r15, r15                                                       ; +0x55, 0x100302dc5\njnz     short loc_100302E1C                                            ; +0x58, 0x100302dc8\nmov     byte ptr [r13+r15+0], 0                                        ; +0x5a, 0x100302dca\ntest    byte ptr [rbp+__dst], 1                                        ; +0x60, 0x100302dd0\njz      short loc_100302E36                                            ; +0x64, 0x100302dd4\nmov     rsi, [rbp+__p]                                                 ; +0x66, 0x100302dd6\njmp     short loc_100302E3A                                            ; +0x6a, 0x100302dda\nmov     rax, r15                                                       ; +0x6c, 0x100302ddc\nor      rax, 7                                                         ; +0x6f, 0x100302ddf\nlea     rcx, [rax+1]                                                   ; +0x73, 0x100302de3\ncmp     rax, 17h                                                       ; +0x77, 0x100302de7\nmov     [rbp+var_48], r14                                              ; +0x7b, 0x100302deb\nmov     r14d, ebx                                                      ; +0x7f, 0x100302def\nmov     ebx, 1Ah                                                       ; +0x82, 0x100302df2\ncmovnz  rbx, rcx                                                       ; +0x87, 0x100302df7\nmov     rdi, rbx; __sz                                                 ; +0x8b, 0x100302dfb\ncall    __Znwm; operator new(ulong)                                    ; +0x8e, 0x100302dfe\nmov     r13, rax                                                       ; +0x93, 0x100302e03\nmov     [rbp+__p], rax                                                 ; +0x96, 0x100302e06\ninc     rbx                                                            ; +0x9a, 0x100302e0a\nmov     [rbp+__dst], rbx                                               ; +0x9d, 0x100302e0d\nmov     ebx, r14d                                                      ; +0xa1, 0x100302e11\nmov     r14, [rbp+var_48]                                              ; +0xa4, 0x100302e14\nmov     [rbp+var_38], r15                                              ; +0xa8, 0x100302e18\nmov     rdi, r13; __dst                                                ; +0xac, 0x100302e1c\nmov     rsi, r12; __src                                                ; +0xaf, 0x100302e1f\nmov     rdx, r15; __len                                                ; +0xb2, 0x100302e22\ncall    _memmove                                                       ; +0xb5, 0x100302e25\nmov     byte ptr [r13+r15+0], 0                                        ; +0xba, 0x100302e2a\ntest    byte ptr [rbp+__dst], 1                                        ; +0xc0, 0x100302e30\njnz     short loc_100302DD6                                            ; +0xc4, 0x100302e34\nlea     rsi, [rbp+__dst+1]                                             ; +0xc6, 0x100302e36\nmov     rdi, r14                                                       ; +0xca, 0x100302e3a\ncall    cocos2d__CCSprite__initWithSpriteFrameName                     ; +0xcd, 0x100302e3d\ntest    al, al                                                         ; +0xd2, 0x100302e42\njz      short loc_100302E4D                                            ; +0xd4, 0x100302e44\nmov     [r14+254h], ebx                                                ; +0xd6, 0x100302e46\ntest    byte ptr [rbp+__dst], 1                                        ; +0xdd, 0x100302e4d\njz      short loc_100302E60                                            ; +0xe1, 0x100302e51\nmov     rdi, [rbp+__p]; __p                                            ; +0xe3, 0x100302e53\nmov     ebx, eax                                                       ; +0xe7, 0x100302e57\ncall    __ZdlPv; operator delete(void *)                               ; +0xe9, 0x100302e59\nmov     eax, ebx                                                       ; +0xee, 0x100302e5e\nadd     rsp, 28h                                                       ; +0xf0, 0x100302e60\npop     rbx                                                            ; +0xf4, 0x100302e64\npop     r12                                                            ; +0xf5, 0x100302e65\npop     r13                                                            ; +0xf7, 0x100302e67\npop     r14                                                            ; +0xf9, 0x100302e69\npop     r15                                                            ; +0xfb, 0x100302e6b\npop     rbp                                                            ; +0xfd, 0x100302e6d\nretn                                                                   ; +0xfe, 0x100302e6e\ncall    sub_100006BF0                                                  ; +0xff, 0x100302e6f", "xrefs": ["GJPathsLayer::init @ 0x1002fe866", "GJPathSprite::create @ 0x1002fe96b", "GJPathPage::init @ 0x1002ff7e6", "GJPathPage::playUnlockAnimation @ 0x100300fda", "GJPathPage::unlockAnimationStep3 @ 0x100302117"], "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"}