{"type": "func", "start": 5368986208, "end": 5368986829, "name": "CCAnimatedSprite::initWithType", "pseudocode": "// \n// CCAnimatedSprite::initWithType from 0x140043a60 to 0x140043ccd (621 bytes)\n// \n// 2 xrefs:\n// > GJShopLayer::init @ 0x1403b08a0\n// > <???> @ 0x14090f734\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:25:30 +0000\n// \n\n// Hidden C++ exception states: #wind=3\nbool __fastcall CCAnimatedSprite::initWithType(\n        __int64 a1,\n        __int64 a2,\n        struct cocos2d::CCTexture2D *a3,\n        unsigned __int8 a4)\n{\n  struct cocos2d::CCTexture2D *v5; // rbx\n  __int64 v8; // rax\n  __int64 Definition; // rax\n  cocos2d::CCString *v10; // rax\n  const char *CString; // rax\n  size_t v12; // r8\n  void *v13; // rcx\n  __m128i v14; // xmm6\n  void **v15; // rbx\n  cocos2d::CCTextureCache *v16; // rax\n  void *v17; // r8\n  const struct cocos2d::CCRect *v18; // rax\n  bool result; // al\n  void *Block[2]; // [rsp+30h] [rbp-78h] BYREF\n  __m128i si128; // [rsp+40h] [rbp-68h]\n  void *Src[2]; // [rsp+50h] [rbp-58h] BYREF\n  __m128i v23; // [rsp+60h] [rbp-48h]\n\n  v5 = a3;\n  if ( !a3 )\n  {\n    v8 = ObjectManager::instance();\n    Definition = ObjectManager::getDefinition(v8, a2);\n    HIDWORD(Block[1]) = 0;\n    si128 = _mm_load_si128((const __m128i *)&xmmword_1408365C0);\n    strcpy((char *)Block, \"spriteSheet\");\n    v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(Definition, Block);\n    CString = cocos2d::CCString::getCString(v10);\n    *(_OWORD *)Src = 0;\n    v23 = 0;\n    v12 = -1;\n    do\n      ++v12;\n    while ( CString[v12] );\n    sub_14003D230(Src, CString, v12);\n    if ( si128.m128i_i64[1] > 0xFuLL )\n    {\n      v13 = Block[0];\n      if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n      {\n        v13 = *((void **)Block[0] - 1);\n        if ( (unsigned __int64)((char *)Block[0] - (char *)v13 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v13);\n    }\n    v14 = _mm_load_si128((const __m128i *)&Size);\n    si128 = v14;\n    LOBYTE(Block[0]) = 0;\n    sub_140044D80(Src, \".png\", 4u);\n    v15 = Src;\n    if ( v23.m128i_i64[1] > 0xFuLL )\n      v15 = (void **)Src[0];\n    v16 = (cocos2d::CCTextureCache *)cocos2d::CCTextureCache::sharedTextureCache();\n    v5 = cocos2d::CCTextureCache::addImage(v16, (const char *)v15, 0);\n    if ( v23.m128i_i64[1] > 0xFuLL )\n    {\n      v17 = Src[0];\n      if ( (unsigned __int64)(v23.m128i_i64[1] + 1) >= 0x1000 )\n      {\n        v17 = *((void **)Src[0] - 1);\n        if ( (unsigned __int64)((char *)Src[0] - (char *)v17 - 8) > 0x1F )\n          invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n      }\n      j_j_free(v17);\n      v14 = _mm_load_si128((const __m128i *)&Size);\n    }\n    v23 = v14;\n    LOBYTE(Src[0]) = 0;\n  }\n  v18 = (const struct cocos2d::CCRect *)cocos2d::CCRect::CCRect((cocos2d::CCRect *)Block, 0.0, 0.0, 0.0, 0.0);\n  result = cocos2d::CCSprite::initWithTexture((cocos2d::CCSprite *)a1, v5, v18);\n  if ( result )\n  {\n    *(_BYTE *)(a1 + 559) = 1;\n    sub_1400405A0((void **)(a1 + 600), &byte_1406ED6E0, 0);\n    CCAnimatedSprite::loadType(a1, a2, v5, a4);\n    return 1;\n  }\n  return result;\n}", "assembly": "; \n; CCAnimatedSprite::initWithType from 0x140043a60 to 0x140043ccd (621 bytes)\n; \n; 2 xrefs:\n; > GJShopLayer::init @ 0x1403b08a0\n; > <???> @ 0x14090f734\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:25:30 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x140043a60\npush    rbp                                                            ; +0x5, 0x140043a65\npush    rsi                                                            ; +0x6, 0x140043a66\npush    rdi                                                            ; +0x7, 0x140043a67\nsub     rsp, 90h                                                       ; +0x8, 0x140043a68\nmovaps  [rsp+0A8h+var_28], xmm6                                        ; +0xf, 0x140043a6f\nmov     rax, cs:__security_cookie                                      ; +0x17, 0x140043a77\nxor     rax, rsp                                                       ; +0x1e, 0x140043a7e\nmov     [rsp+0A8h+var_38], rax                                         ; +0x21, 0x140043a81\nmovzx   ebp, r9b                                                       ; +0x26, 0x140043a86\nmov     rbx, r8                                                        ; +0x2a, 0x140043a8a\nmov     rsi, rdx                                                       ; +0x2d, 0x140043a8d\nmov     rdi, rcx                                                       ; +0x30, 0x140043a90\ntest    r8, r8                                                         ; +0x33, 0x140043a93\njnz     loc_140043C47                                                  ; +0x36, 0x140043a96\ncall    ObjectManager__instance                                        ; +0x3c, 0x140043a9c\nmov     rcx, rax                                                       ; +0x41, 0x140043aa1\nmov     rdx, rsi                                                       ; +0x44, 0x140043aa4\ncall    ObjectManager__getDefinition                                   ; +0x47, 0x140043aa7\nmov     rcx, rax                                                       ; +0x4c, 0x140043aac\nxorps   xmm0, xmm0                                                     ; +0x4f, 0x140043aaf\nmovups  xmmword ptr [rsp+0A8h+Block], xmm0                             ; +0x52, 0x140043ab2\nmovdqa  xmm1, cs:xmmword_1408365C0                                     ; +0x57, 0x140043ab7\nmovdqu  [rsp+0A8h+var_68], xmm1                                        ; +0x5f, 0x140043abf\nmovsd   xmm0, cs:qword_140706FF0                                       ; +0x65, 0x140043ac5\nmovsd   [rsp+0A8h+Block], xmm0                                         ; +0x6d, 0x140043acd\nmovzx   eax, cs:word_140706FF8                                         ; +0x73, 0x140043ad3\nmov     word ptr [rsp+0A8h+Block+8], ax                                ; +0x7a, 0x140043ada\nmovzx   eax, cs:byte_140706FFA                                         ; +0x7f, 0x140043adf\nmov     byte ptr [rsp+0A8h+Block+0Ah], al                              ; +0x86, 0x140043ae6\nmov     byte ptr [rsp+0A8h+Block+0Bh], bl                              ; +0x8a, 0x140043aea\nlea     rdx, [rsp+0A8h+Block]                                          ; +0x8e, 0x140043aee\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0x93, 0x140043af3\nmov     rcx, rax                                                       ; +0x99, 0x140043af9\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x9c, 0x140043afc\nxorps   xmm0, xmm0                                                     ; +0xa2, 0x140043b02\nmovups  xmmword ptr [rsp+0A8h+Src], xmm0                               ; +0xa5, 0x140043b05\nxorps   xmm1, xmm1                                                     ; +0xaa, 0x140043b0a\nmovdqu  [rsp+0A8h+var_48], xmm1                                        ; +0xad, 0x140043b0d\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xb3, 0x140043b13\nnop     word ptr [rax+rax+00h]                                         ; +0xba, 0x140043b1a\ninc     r8                                                             ; +0xc0, 0x140043b20\ncmp     byte ptr [rax+r8], 0                                           ; +0xc3, 0x140043b23\njnz     short loc_140043B20                                            ; +0xc8, 0x140043b28\nmov     rdx, rax                                                       ; +0xca, 0x140043b2a\nlea     rcx, [rsp+0A8h+Src]                                            ; +0xcd, 0x140043b2d\ncall    sub_14003D230                                                  ; +0xd2, 0x140043b32\nnop                                                                    ; +0xd7, 0x140043b37\nmov     rdx, qword ptr [rsp+0A8h+var_68+8]                             ; +0xd8, 0x140043b38\ncmp     rdx, 0Fh                                                       ; +0xdd, 0x140043b3d\njbe     short loc_140043B8B                                            ; +0xe1, 0x140043b41\ninc     rdx                                                            ; +0xe3, 0x140043b43\nmov     rcx, [rsp+0A8h+Block]; Block                                   ; +0xe6, 0x140043b46\nmov     rax, rcx                                                       ; +0xeb, 0x140043b4b\ncmp     rdx, 1000h                                                     ; +0xee, 0x140043b4e\njb      short loc_140043B86                                            ; +0xf5, 0x140043b55\nadd     rdx, 27h ; '''                                                 ; +0xf7, 0x140043b57\nmov     rcx, [rcx-8]                                                   ; +0xfb, 0x140043b5b\nsub     rax, rcx                                                       ; +0xff, 0x140043b5f\nsub     rax, 8                                                         ; +0x102, 0x140043b62\ncmp     rax, 1Fh                                                       ; +0x106, 0x140043b66\njbe     short loc_140043B86                                            ; +0x10a, 0x140043b6a\nmov     [rsp+0A8h+Reserved], 0; Reserved                               ; +0x10c, 0x140043b6c\nxor     r9d, r9d; LineNo                                               ; +0x115, 0x140043b75\nxor     r8d, r8d; FileName                                             ; +0x118, 0x140043b78\nxor     edx, edx; FunctionName                                         ; +0x11b, 0x140043b7b\nxor     ecx, ecx; Expression                                           ; +0x11d, 0x140043b7d\ncall    cs:_invoke_watson                                              ; +0x11f, 0x140043b7f\nalign 2                                                                ; +0x125, 0x140043b85\ncall    j_j_free                                                       ; +0x126, 0x140043b86\nmovdqa  xmm6, cs:Size                                                  ; +0x12b, 0x140043b8b\nmovdqu  [rsp+0A8h+var_68], xmm6                                        ; +0x133, 0x140043b93\nmov     byte ptr [rsp+0A8h+Block], 0                                   ; +0x139, 0x140043b99\nmov     r8d, 4; Size                                                   ; +0x13e, 0x140043b9e\nlea     rdx, aPng; \".png\"                                              ; +0x144, 0x140043ba4\nlea     rcx, [rsp+0A8h+Src]; Src                                       ; +0x14b, 0x140043bab\ncall    sub_140044D80                                                  ; +0x150, 0x140043bb0\nlea     rbx, [rsp+0A8h+Src]                                            ; +0x155, 0x140043bb5\ncmp     qword ptr [rsp+0A8h+var_48+8], 0Fh                             ; +0x15a, 0x140043bba\ncmova   rbx, [rsp+0A8h+Src]                                            ; +0x160, 0x140043bc0\ncall    cs:?sharedTextureCache@CCTextureCache@cocos2d@@SAPEAV12@XZ; cocos2d::CCTextureCache::sharedTextureCache(void) ; +0x166, 0x140043bc6\nmov     rcx, rax                                                       ; +0x16c, 0x140043bcc\nxor     r8d, r8d                                                       ; +0x16f, 0x140043bcf\nmov     rdx, rbx                                                       ; +0x172, 0x140043bd2\ncall    cs:?addImage@CCTextureCache@cocos2d@@QEAAPEAVCCTexture2D@2@PEBD_N@Z; cocos2d::CCTextureCache::addImage(char const *,bool) ; +0x175, 0x140043bd5\nmov     rbx, rax                                                       ; +0x17b, 0x140043bdb\nmov     rdx, qword ptr [rsp+0A8h+var_48+8]                             ; +0x17e, 0x140043bde\ncmp     rdx, 0Fh                                                       ; +0x183, 0x140043be3\njbe     short loc_140043C3C                                            ; +0x187, 0x140043be7\ninc     rdx                                                            ; +0x189, 0x140043be9\nmov     r8, [rsp+0A8h+Src]                                             ; +0x18c, 0x140043bec\nmov     rcx, r8                                                        ; +0x191, 0x140043bf1\ncmp     rdx, 1000h                                                     ; +0x194, 0x140043bf4\njb      short loc_140043C2C                                            ; +0x19b, 0x140043bfb\nadd     rdx, 27h ; '''                                                 ; +0x19d, 0x140043bfd\nmov     r8, [r8-8]                                                     ; +0x1a1, 0x140043c01\nsub     rcx, r8                                                        ; +0x1a5, 0x140043c05\nsub     rcx, 8                                                         ; +0x1a8, 0x140043c08\ncmp     rcx, 1Fh                                                       ; +0x1ac, 0x140043c0c\njbe     short loc_140043C2C                                            ; +0x1b0, 0x140043c10\nmov     [rsp+0A8h+Reserved], 0; Reserved                               ; +0x1b2, 0x140043c12\nxor     r9d, r9d; LineNo                                               ; +0x1bb, 0x140043c1b\nxor     r8d, r8d; FileName                                             ; +0x1be, 0x140043c1e\nxor     edx, edx; FunctionName                                         ; +0x1c1, 0x140043c21\nxor     ecx, ecx; Expression                                           ; +0x1c3, 0x140043c23\ncall    cs:_invoke_watson                                              ; +0x1c5, 0x140043c25\nalign 4                                                                ; +0x1cb, 0x140043c2b\nmov     rcx, r8; Block                                                 ; +0x1cc, 0x140043c2c\ncall    j_j_free                                                       ; +0x1cf, 0x140043c2f\nmovdqa  xmm6, cs:Size                                                  ; +0x1d4, 0x140043c34\nmovdqu  [rsp+0A8h+var_48], xmm6                                        ; +0x1dc, 0x140043c3c\nmov     byte ptr [rsp+0A8h+Src], 0                                     ; +0x1e2, 0x140043c42\nxorps   xmm1, xmm1                                                     ; +0x1e7, 0x140043c47\nmovss   dword ptr [rsp+0A8h+Reserved], xmm1                            ; +0x1ea, 0x140043c4a\nxorps   xmm3, xmm3                                                     ; +0x1f0, 0x140043c50\nxorps   xmm2, xmm2                                                     ; +0x1f3, 0x140043c53\nlea     rcx, [rsp+0A8h+Block]                                          ; +0x1f6, 0x140043c56\ncall    cs:??0CCRect@cocos2d@@QEAA@MMMM@Z; cocos2d::CCRect::CCRect(float,float,float,float) ; +0x1fb, 0x140043c5b\nmov     r8, rax                                                        ; +0x201, 0x140043c61\nmov     rdx, rbx                                                       ; +0x204, 0x140043c64\nmov     rcx, rdi                                                       ; +0x207, 0x140043c67\ncall    cs:__imp_?initWithTexture@CCSprite@cocos2d@@UEAA_NPEAVCCTexture2D@2@AEBVCCRect@2@@Z; cocos2d::CCSprite::initWithTexture(cocos2d::CCTexture2D *,cocos2d::CCRect const &) ; +0x20a, 0x140043c6a\ntest    al, al                                                         ; +0x210, 0x140043c70\njz      short loc_140043CA5                                            ; +0x212, 0x140043c72\nmov     byte ptr [rdi+22Fh], 1                                         ; +0x214, 0x140043c74\nlea     rcx, [rdi+258h]; void *                                        ; +0x21b, 0x140043c7b\nxor     r8d, r8d; Size                                                 ; +0x222, 0x140043c82\nlea     rdx, byte_1406ED6E0; Src                                       ; +0x225, 0x140043c85\ncall    sub_1400405A0                                                  ; +0x22c, 0x140043c8c\nmovzx   r9d, bpl                                                       ; +0x231, 0x140043c91\nmov     r8, rbx                                                        ; +0x235, 0x140043c95\nmov     rdx, rsi                                                       ; +0x238, 0x140043c98\nmov     rcx, rdi                                                       ; +0x23b, 0x140043c9b\ncall    CCAnimatedSprite__loadType                                     ; +0x23e, 0x140043c9e\nmov     al, 1                                                          ; +0x243, 0x140043ca3\nmov     rcx, [rsp+0A8h+var_38]                                         ; +0x245, 0x140043ca5\nxor     rcx, rsp; StackCookie                                          ; +0x24a, 0x140043caa\ncall    __security_check_cookie                                        ; +0x24d, 0x140043cad\nmov     rbx, [rsp+0A8h+arg_18]                                         ; +0x252, 0x140043cb2\nmovaps  xmm6, [rsp+0A8h+var_28]                                        ; +0x25a, 0x140043cba\nadd     rsp, 90h                                                       ; +0x262, 0x140043cc2\npop     rdi                                                            ; +0x269, 0x140043cc9\npop     rsi                                                            ; +0x26a, 0x140043cca\npop     rbp                                                            ; +0x26b, 0x140043ccb\nretn                                                                   ; +0x26c, 0x140043ccc", "xrefs": ["GJShopLayer::init @ 0x1403b08a0", "<???> @ 0x14090f734"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}