{"type": "func", "start": 5371367504, "end": 5371367904, "name": "GJPathSprite::create", "pseudocode": "// \n// GJPathSprite::create from 0x140289050 to 0x1402891e0 (400 bytes)\n// \n// 6 xrefs:\n// > GJItemIcon::init @ 0x14027b097\n// > GJPathsLayer::init @ 0x140285017\n// > GJPathPage::init @ 0x140285de1\n// > GJPathPage::playUnlockAnimation @ 0x140287ef3\n// > GJPathPage::unlockAnimationStep3 @ 0x1402886be\n// > <???> @ 0x1406d15f8\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// Hidden C++ exception states: #wind=2\nGJPathSprite *GJPathSprite::create(int a1)\n{\n  GJPathSprite *v2; // rbx\n  cocos2d::CCString *v3; // rax\n  const char *CString; // rax\n  size_t v5; // r8\n  void **v6; // rdx\n  void *v7; // rcx\n  void *v8; // rcx\n  void *Block[2]; // [rsp+28h] [rbp-30h] BYREF\n  __int64 v11; // [rsp+38h] [rbp-20h]\n  unsigned __int64 v12; // [rsp+40h] [rbp-18h]\n\n  v2 = (GJPathSprite *)operator new(0x260u);\n  memset(v2, 0, sizeof(GJPathSprite));\n  cocos2d::CCSprite::CCSprite(v2);\n  v2->CCSpriteCOpacity::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable = (GJPathSprite_vtbl *)&GJPathSprite::`vftable';\n  v2->CCSpriteCOpacity::cocos2d::CCSprite::cocos2d::CCNodeRGBA::cocos2d::CCRGBAProtocol::__vftable = (cocos2d::CCRGBAProtocol_vtbl *)&GJPathSprite::`vftable';\n  v2->CCSpriteCOpacity::cocos2d::CCSprite::cocos2d::CCTextureProtocol::cocos2d::CCBlendProtocol::__vftable = (cocos2d::CCTextureProtocol_vtbl *)&GJPathSprite::`vftable';\n  v3 = cocos2d::CCString::createWithFormat(\"pathIcon_%02d_001.png\", a1);\n  CString = cocos2d::CCString::getCString(v3);\n  *(_OWORD *)Block = 0;\n  v11 = 0;\n  v12 = 0;\n  v5 = -1;\n  do\n    ++v5;\n  while ( CString[v5] );\n  sub_14003A930(Block, CString, v5);\n  v6 = Block;\n  if ( v12 > 0xF )\n    v6 = (void **)Block[0];\n  if ( cocos2d::CCSprite::initWithSpriteFrameName(v2, (const char *)v6) )\n  {\n    v2->m_pathNumber = a1;\n    if ( v12 > 0xF )\n    {\n      v8 = Block[0];\n      if ( v12 + 1 >= 0x1000 )\n      {\n        v8 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n          goto LABEL_14;\n      }\n      j_j_free(v8);\n    }\n    cocos2d::CCObject::autorelease(v2);\n    return v2;\n  }\n  if ( v12 > 0xF )\n  {\n    v7 = Block[0];\n    if ( v12 + 1 < 0x1000\n      || (v7 = *((void **)Block[0] - 1), (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) <= 0x1F) )\n    {\n      j_j_free(v7);\n      goto LABEL_10;\n    }\nLABEL_14:\n    invalid_parameter_noinfo_noreturn();\n  }\nLABEL_10:\n  ((void (__fastcall *)(GJPathSprite *, __int64))v2->~GJPathSprite)(v2, 1);\n  return nullptr;\n}", "assembly": "; \n; GJPathSprite::create from 0x140289050 to 0x1402891e0 (400 bytes)\n; \n; 6 xrefs:\n; > GJItemIcon::init @ 0x14027b097\n; > GJPathsLayer::init @ 0x140285017\n; > GJPathPage::init @ 0x140285de1\n; > GJPathPage::playUnlockAnimation @ 0x140287ef3\n; > GJPathPage::unlockAnimationStep3 @ 0x1402886be\n; > <???> @ 0x1406d15f8\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140289050\npush    rdi                                                            ; +0x5, 0x140289055\nsub     rsp, 50h                                                       ; +0x6, 0x140289056\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x14028905a\nxor     rax, rsp                                                       ; +0x11, 0x140289061\nmov     [rsp+58h+var_10], rax                                          ; +0x14, 0x140289064\nmov     edi, ecx                                                       ; +0x19, 0x140289069\nmov     ecx, 260h; Size                                                ; +0x1b, 0x14028906b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x20, 0x140289070\nmov     rbx, rax                                                       ; +0x25, 0x140289075\nmov     [rsp+58h+var_38], rax                                          ; +0x28, 0x140289078\nxor     edx, edx; Val                                                  ; +0x2d, 0x14028907d\nmov     r8d, 260h; Size                                                ; +0x2f, 0x14028907f\nmov     rcx, rax; void *                                               ; +0x35, 0x140289085\ncall    memset                                                         ; +0x38, 0x140289088\nmov     rcx, rbx                                                       ; +0x3d, 0x14028908d\ncall    cs:??0CCSprite@cocos2d@@QEAA@XZ; cocos2d::CCSprite::CCSprite(void) ; +0x40, 0x140289090\nlea     rax, ??_7GJPathSprite@@6B@; const GJPathSprite::`vftable'      ; +0x46, 0x140289096\nmov     [rbx], rax                                                     ; +0x4d, 0x14028909d\nlea     rax, ??_7GJPathSprite@@6B@_0; const GJPathSprite::`vftable'    ; +0x50, 0x1402890a0\nmov     [rbx+140h], rax                                                ; +0x57, 0x1402890a7\nlea     rax, ??_7GJPathSprite@@6B@_1; const GJPathSprite::`vftable'    ; +0x5e, 0x1402890ae\nmov     [rbx+158h], rax                                                ; +0x65, 0x1402890b5\nmov     edx, edi                                                       ; +0x6c, 0x1402890bc\nlea     rcx, aPathicon02d001; \"pathIcon_%02d_001.png\"                  ; +0x6e, 0x1402890be\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x75, 0x1402890c5\nmov     rcx, rax                                                       ; +0x7b, 0x1402890cb\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x7e, 0x1402890ce\nxorps   xmm0, xmm0                                                     ; +0x84, 0x1402890d4\nmovups  xmmword ptr [rsp+58h+Block], xmm0                              ; +0x87, 0x1402890d7\nmov     [rsp+58h+var_20], 0                                            ; +0x8c, 0x1402890dc\nmov     [rsp+58h+var_18], 0                                            ; +0x95, 0x1402890e5\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x9e, 0x1402890ee\ninc     r8                                                             ; +0xa5, 0x1402890f5\ncmp     byte ptr [rax+r8], 0                                           ; +0xa8, 0x1402890f8\njnz     short loc_1402890F5                                            ; +0xad, 0x1402890fd\nmov     rdx, rax                                                       ; +0xaf, 0x1402890ff\nlea     rcx, [rsp+58h+Block]                                           ; +0xb2, 0x140289102\ncall    sub_14003A930                                                  ; +0xb7, 0x140289107\nnop                                                                    ; +0xbc, 0x14028910c\nlea     rdx, [rsp+58h+Block]                                           ; +0xbd, 0x14028910d\ncmp     [rsp+58h+var_18], 0Fh                                          ; +0xc2, 0x140289112\ncmova   rdx, [rsp+58h+Block]                                           ; +0xc8, 0x140289118\nmov     rcx, rbx                                                       ; +0xce, 0x14028911e\ncall    cs:__imp_?initWithSpriteFrameName@CCSprite@cocos2d@@UEAA_NPEBD@Z; cocos2d::CCSprite::initWithSpriteFrameName(char const *) ; +0xd1, 0x140289121\ntest    al, al                                                         ; +0xd7, 0x140289127\njnz     short loc_140289176                                            ; +0xd9, 0x140289129\nmov     rdx, [rsp+58h+var_18]                                          ; +0xdb, 0x14028912b\ncmp     rdx, 0Fh                                                       ; +0xe0, 0x140289130\njbe     short loc_140289164                                            ; +0xe4, 0x140289134\ninc     rdx                                                            ; +0xe6, 0x140289136\nmov     rcx, [rsp+58h+Block]                                           ; +0xe9, 0x140289139\nmov     rax, rcx                                                       ; +0xee, 0x14028913e\ncmp     rdx, 1000h                                                     ; +0xf1, 0x140289141\njb      short loc_14028915F                                            ; +0xf8, 0x140289148\nadd     rdx, 27h ; '''                                                 ; +0xfa, 0x14028914a\nmov     rcx, [rcx-8]; Block                                            ; +0xfe, 0x14028914e\nsub     rax, rcx                                                       ; +0x102, 0x140289152\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x105, 0x140289155\ncmp     rax, 1Fh                                                       ; +0x109, 0x140289159\nja      short loc_1402891B0                                            ; +0x10d, 0x14028915d\ncall    j_j_free                                                       ; +0x10f, 0x14028915f\nmov     rax, [rbx]                                                     ; +0x114, 0x140289164\nmov     edx, 1                                                         ; +0x117, 0x140289167\nmov     rcx, rbx                                                       ; +0x11c, 0x14028916c\ncall    qword ptr [rax+8]                                              ; +0x11f, 0x14028916f\nxor     ebx, ebx                                                       ; +0x122, 0x140289172\njmp     short loc_1402891C5                                            ; +0x124, 0x140289174\nmov     [rbx+258h], edi                                                ; +0x126, 0x140289176\nmov     rdx, [rsp+58h+var_18]                                          ; +0x12c, 0x14028917c\ncmp     rdx, 0Fh                                                       ; +0x131, 0x140289181\njbe     short loc_1402891BC                                            ; +0x135, 0x140289185\ninc     rdx                                                            ; +0x137, 0x140289187\nmov     rcx, [rsp+58h+Block]; Block                                    ; +0x13a, 0x14028918a\nmov     rax, rcx                                                       ; +0x13f, 0x14028918f\ncmp     rdx, 1000h                                                     ; +0x142, 0x140289192\njb      short loc_1402891B7                                            ; +0x149, 0x140289199\nadd     rdx, 27h ; '''                                                 ; +0x14b, 0x14028919b\nmov     rcx, [rcx-8]                                                   ; +0x14f, 0x14028919f\nsub     rax, rcx                                                       ; +0x153, 0x1402891a3\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x156, 0x1402891a6\ncmp     rax, 1Fh                                                       ; +0x15a, 0x1402891aa\njbe     short loc_1402891B7                                            ; +0x15e, 0x1402891ae\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x160, 0x1402891b0\ndb 0CCh                                                                ; +0x166, 0x1402891b6\ncall    j_j_free                                                       ; +0x167, 0x1402891b7\nmov     rcx, rbx                                                       ; +0x16c, 0x1402891bc\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0x16f, 0x1402891bf\nmov     rax, rbx                                                       ; +0x175, 0x1402891c5\nmov     rcx, [rsp+58h+var_10]                                          ; +0x178, 0x1402891c8\nxor     rcx, rsp; StackCookie                                          ; +0x17d, 0x1402891cd\ncall    __security_check_cookie                                        ; +0x180, 0x1402891d0\nmov     rbx, [rsp+58h+arg_8]                                           ; +0x185, 0x1402891d5\nadd     rsp, 50h                                                       ; +0x18a, 0x1402891da\npop     rdi                                                            ; +0x18e, 0x1402891de\nretn                                                                   ; +0x18f, 0x1402891df", "xrefs": ["GJItemIcon::init @ 0x14027b097", "GJPathsLayer::init @ 0x140285017", "GJPathPage::init @ 0x140285de1", "GJPathPage::playUnlockAnimation @ 0x140287ef3", "GJPathPage::unlockAnimationStep3 @ 0x1402886be", "<???> @ 0x1406d15f8"], "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"}