; ; cocos2d::extension::CCControlButton::initWithLabelAndBackgroundSprite from 0x1800059b0 to 0x180005db3 (1027 bytes) ; ; 4 xrefs: ; > @ 0x180024180 ; > @ 0x180027fc8 ; > @ 0x18002fdf8 ; > @ 0x18004954c ; ; This function is hookable on this platform! ; ; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA ; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings ; mov [rsp+arg_18], rbx ; +0x0, 0x1800059b0 push rbp ; +0x5, 0x1800059b5 push rsi ; +0x6, 0x1800059b6 push rdi ; +0x7, 0x1800059b7 push r14 ; +0x8, 0x1800059b8 push r15 ; +0xa, 0x1800059ba sub rsp, 80h ; +0xc, 0x1800059bc movaps [rsp+0A8h+var_38], xmm6 ; +0x13, 0x1800059c3 mov rax, cs:__security_cookie ; +0x18, 0x1800059c8 xor rax, rsp ; +0x1f, 0x1800059cf mov [rsp+0A8h+var_40], rax ; +0x22, 0x1800059d2 mov rbp, r8 ; +0x27, 0x1800059d7 mov rsi, rdx ; +0x2a, 0x1800059da mov rdi, rcx ; +0x2d, 0x1800059dd call ?init@CCControl@extension@cocos2d@@UEAA_NXZ; cocos2d::extension::CCControl::init(void) ; +0x30, 0x1800059e0 test al, al ; +0x35, 0x1800059e5 jz loc_180005D88 ; +0x37, 0x1800059e7 mov [rsp+0A8h+var_88], 0 ; +0x3d, 0x1800059ed lea r9, ??_R0?AVCCLabelProtocol@cocos2d@@@8; cocos2d::CCLabelProtocol `RTTI Type Descriptor' ; +0x45, 0x1800059f5 lea r8, ??_R0?AVCCNode@cocos2d@@@8; cocos2d::CCNode `RTTI Type Descriptor' ; +0x4c, 0x1800059fc xor edx, edx ; +0x53, 0x180005a03 mov rcx, rsi ; +0x55, 0x180005a05 call __RTDynamicCast ; +0x58, 0x180005a08 mov r14, rax ; +0x5d, 0x180005a0d mov [rsp+0A8h+var_88], 0 ; +0x60, 0x180005a10 lea r9, ??_R0?AVCCRGBAProtocol@cocos2d@@@8; cocos2d::CCRGBAProtocol `RTTI Type Descriptor' ; +0x68, 0x180005a18 lea r8, ??_R0?AVCCNode@cocos2d@@@8; cocos2d::CCNode `RTTI Type Descriptor' ; +0x6f, 0x180005a1f xor edx, edx ; +0x76, 0x180005a26 mov rcx, rsi ; +0x78, 0x180005a28 call __RTDynamicCast ; +0x7b, 0x180005a2b mov r15, rax ; +0x80, 0x180005a30 mov byte ptr [rdi+20Dh], 1 ; +0x83, 0x180005a33 call cs:?create@CCDictionary@cocos2d@@SAPEAV12@XZ; cocos2d::CCDictionary::create(void) ; +0x8a, 0x180005a3a mov rbx, rax ; +0x90, 0x180005a40 cmp [rdi+210h], rax ; +0x93, 0x180005a43 jz short loc_180005A73 ; +0x9a, 0x180005a4a test rax, rax ; +0x9c, 0x180005a4c jz short loc_180005A5A ; +0x9f, 0x180005a4f mov rcx, rax ; +0xa1, 0x180005a51 call cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xa4, 0x180005a54 mov rcx, [rdi+210h] ; +0xaa, 0x180005a5a test rcx, rcx ; +0xb1, 0x180005a61 jz short loc_180005A6C ; +0xb4, 0x180005a64 call cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xb6, 0x180005a66 mov [rdi+210h], rbx ; +0xbc, 0x180005a6c call cs:?create@CCDictionary@cocos2d@@SAPEAV12@XZ; cocos2d::CCDictionary::create(void) ; +0xc3, 0x180005a73 mov rbx, rax ; +0xc9, 0x180005a79 cmp [rdi+218h], rax ; +0xcc, 0x180005a7c jz short loc_180005AAC ; +0xd3, 0x180005a83 test rax, rax ; +0xd5, 0x180005a85 jz short loc_180005A93 ; +0xd8, 0x180005a88 mov rcx, rax ; +0xda, 0x180005a8a call cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0xdd, 0x180005a8d mov rcx, [rdi+218h] ; +0xe3, 0x180005a93 test rcx, rcx ; +0xea, 0x180005a9a jz short loc_180005AA5 ; +0xed, 0x180005a9d call cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0xef, 0x180005a9f mov [rdi+218h], rbx ; +0xf5, 0x180005aa5 call cs:?create@CCDictionary@cocos2d@@SAPEAV12@XZ; cocos2d::CCDictionary::create(void) ; +0xfc, 0x180005aac mov rbx, rax ; +0x102, 0x180005ab2 cmp [rdi+220h], rax ; +0x105, 0x180005ab5 jz short loc_180005AE5 ; +0x10c, 0x180005abc test rax, rax ; +0x10e, 0x180005abe jz short loc_180005ACC ; +0x111, 0x180005ac1 mov rcx, rax ; +0x113, 0x180005ac3 call cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x116, 0x180005ac6 mov rcx, [rdi+220h] ; +0x11c, 0x180005acc test rcx, rcx ; +0x123, 0x180005ad3 jz short loc_180005ADE ; +0x126, 0x180005ad6 call cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x128, 0x180005ad8 mov [rdi+220h], rbx ; +0x12e, 0x180005ade call cs:?create@CCDictionary@cocos2d@@SAPEAV12@XZ; cocos2d::CCDictionary::create(void) ; +0x135, 0x180005ae5 mov rbx, rax ; +0x13b, 0x180005aeb cmp [rdi+228h], rax ; +0x13e, 0x180005aee jz short loc_180005B1E ; +0x145, 0x180005af5 test rax, rax ; +0x147, 0x180005af7 jz short loc_180005B05 ; +0x14a, 0x180005afa mov rcx, rax ; +0x14c, 0x180005afc call cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x14f, 0x180005aff mov rcx, [rdi+228h] ; +0x155, 0x180005b05 test rcx, rcx ; +0x15c, 0x180005b0c jz short loc_180005B17 ; +0x15f, 0x180005b0f call cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x161, 0x180005b11 mov [rdi+228h], rbx ; +0x167, 0x180005b17 mov rax, [rdi] ; +0x16e, 0x180005b1e mov dl, 1 ; +0x171, 0x180005b21 mov rcx, rdi ; +0x173, 0x180005b23 call qword ptr [rax+388h] ; +0x176, 0x180005b26 mov byte ptr [rdi+20Ch], 0 ; +0x17c, 0x180005b2c mov byte ptr [rdi+200h], 1 ; +0x183, 0x180005b33 mov qword ptr [rdi+1D8h], 0 ; +0x18a, 0x180005b3a mov byte ptr [rdi+1E3h], 1 ; +0x195, 0x180005b45 mov rax, [rdi] ; +0x19c, 0x180005b4c mov rcx, rdi ; +0x19f, 0x180005b4f call qword ptr [rax+428h] ; +0x1a2, 0x180005b52 mov rbx, [rdi] ; +0x1a8, 0x180005b58 lea rdx, unk_1800485F0 ; +0x1ab, 0x180005b5b lea rcx, [rsp+0A8h+var_68] ; +0x1b2, 0x180005b62 call cs:??0CCSize@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCSize::CCSize(cocos2d::CCSize const &) ; +0x1b7, 0x180005b67 mov rdx, rax ; +0x1bd, 0x180005b6d mov rcx, rdi ; +0x1c0, 0x180005b70 call qword ptr [rbx+460h] ; +0x1c3, 0x180005b73 mov byte ptr [rdi+200h], 1 ; +0x1c9, 0x180005b79 mov rax, [rdi] ; +0x1d0, 0x180005b80 xor edx, edx ; +0x1d3, 0x180005b83 mov rcx, rdi ; +0x1d5, 0x180005b85 call qword ptr [rax+1A0h] ; +0x1d8, 0x180005b88 mov rbx, [rdi] ; +0x1de, 0x180005b8e movss xmm6, cs:dword_180029510 ; +0x1e1, 0x180005b91 movaps xmm2, xmm6 ; +0x1e9, 0x180005b99 movaps xmm1, xmm6 ; +0x1ec, 0x180005b9c lea rcx, [rsp+0A8h+var_68] ; +0x1ef, 0x180005b9f call cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x1f4, 0x180005ba4 mov rdx, rax ; +0x1fa, 0x180005baa mov rcx, rdi ; +0x1fd, 0x180005bad call qword ptr [rbx+110h] ; +0x200, 0x180005bb0 cmp [rdi+1E8h], rsi ; +0x206, 0x180005bb6 jz short loc_180005BE6 ; +0x20d, 0x180005bbd test rsi, rsi ; +0x20f, 0x180005bbf jz short loc_180005BCD ; +0x212, 0x180005bc2 mov rcx, rsi ; +0x214, 0x180005bc4 call cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x217, 0x180005bc7 mov rcx, [rdi+1E8h] ; +0x21d, 0x180005bcd test rcx, rcx ; +0x224, 0x180005bd4 jz short loc_180005BDF ; +0x227, 0x180005bd7 call cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x229, 0x180005bd9 mov [rdi+1E8h], rsi ; +0x22f, 0x180005bdf cmp [rdi+1F0h], rbp ; +0x236, 0x180005be6 jz short loc_180005C16 ; +0x23d, 0x180005bed test rbp, rbp ; +0x23f, 0x180005bef jz short loc_180005BFD ; +0x242, 0x180005bf2 mov rcx, rbp ; +0x244, 0x180005bf4 call cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x247, 0x180005bf7 mov rcx, [rdi+1F0h] ; +0x24d, 0x180005bfd test rcx, rcx ; +0x254, 0x180005c04 jz short loc_180005C0F ; +0x257, 0x180005c07 call cs:?release@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::release(void) ; +0x259, 0x180005c09 mov [rdi+1F0h], rbp ; +0x25f, 0x180005c0f mov [rsp+0A8h+var_78], 0FFFFh ; +0x266, 0x180005c16 mov [rsp+0A8h+var_76], 0FFh ; +0x26d, 0x180005c1d lea rbx, [rdi+198h] ; +0x272, 0x180005c22 mov rax, [rbx] ; +0x279, 0x180005c29 lea rdx, [rsp+0A8h+var_78] ; +0x27c, 0x180005c2c mov rcx, rbx ; +0x281, 0x180005c31 call qword ptr [rax] ; +0x284, 0x180005c34 mov rax, [rbx] ; +0x286, 0x180005c36 mov dl, 0FFh ; +0x289, 0x180005c39 mov rcx, rbx ; +0x28b, 0x180005c3b call qword ptr [rax+28h] ; +0x28e, 0x180005c3e mov rax, [rbx] ; +0x291, 0x180005c41 mov dl, 1 ; +0x294, 0x180005c44 mov rcx, rbx ; +0x296, 0x180005c46 call qword ptr [rax+30h] ; +0x299, 0x180005c49 mov rax, [r14] ; +0x29c, 0x180005c4c mov rcx, r14 ; +0x29f, 0x180005c4f call qword ptr [rax+8] ; +0x2a2, 0x180005c52 xorps xmm0, xmm0 ; +0x2a5, 0x180005c55 movups xmmword ptr [rsp+0A8h+Block], xmm0 ; +0x2a8, 0x180005c58 xorps xmm1, xmm1 ; +0x2ad, 0x180005c5d movdqu [rsp+0A8h+var_50], xmm1 ; +0x2b0, 0x180005c60 mov r8, 0FFFFFFFFFFFFFFFFh ; +0x2b6, 0x180005c66 nop dword ptr [rax] ; +0x2bd, 0x180005c6d inc r8 ; +0x2c0, 0x180005c70 cmp byte ptr [rax+r8], 0 ; +0x2c3, 0x180005c73 jnz short loc_180005C70 ; +0x2c8, 0x180005c78 mov rdx, rax ; +0x2ca, 0x180005c7a lea rcx, [rsp+0A8h+Block] ; +0x2cd, 0x180005c7d call sub_180003AB0 ; +0x2d2, 0x180005c82 nop ; +0x2d7, 0x180005c87 lea rcx, [rsp+0A8h+Block] ; +0x2d8, 0x180005c88 call cs:?create@CCString@cocos2d@@SAPEAV12@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCString::create(std::string const &) ; +0x2dd, 0x180005c8d mov rbx, rax ; +0x2e3, 0x180005c93 mov rdx, qword ptr [rsp+0A8h+var_50+8] ; +0x2e6, 0x180005c96 cmp rdx, 0Fh ; +0x2eb, 0x180005c9b jbe short loc_180005CD6 ; +0x2ef, 0x180005c9f inc rdx ; +0x2f1, 0x180005ca1 mov rcx, [rsp+0A8h+Block]; Block ; +0x2f4, 0x180005ca4 mov rax, rcx ; +0x2f9, 0x180005ca9 cmp rdx, 1000h ; +0x2fc, 0x180005cac jb short loc_180005CD1 ; +0x303, 0x180005cb3 add rdx, 27h ; ''' ; +0x305, 0x180005cb5 mov rcx, [rcx-8] ; +0x309, 0x180005cb9 sub rax, rcx ; +0x30d, 0x180005cbd add rax, 0FFFFFFFFFFFFFFF8h ; +0x310, 0x180005cc0 cmp rax, 1Fh ; +0x314, 0x180005cc4 jbe short loc_180005CD1 ; +0x318, 0x180005cc8 call cs:_invalid_parameter_noinfo_noreturn ; +0x31a, 0x180005cca db 0CCh ; +0x320, 0x180005cd0 call j_j_free ; +0x321, 0x180005cd1 movdqa xmm0, cs:xmmword_1800295E0 ; +0x326, 0x180005cd6 movdqu [rsp+0A8h+var_50], xmm0 ; +0x32e, 0x180005cde mov byte ptr [rsp+0A8h+Block], 0 ; +0x334, 0x180005ce4 mov rax, [rdi] ; +0x339, 0x180005ce9 mov r8d, 1 ; +0x33c, 0x180005cec mov rdx, rbx ; +0x342, 0x180005cf2 mov rcx, rdi ; +0x345, 0x180005cf5 call qword ptr [rax+4B0h] ; +0x348, 0x180005cf8 mov rax, [r15] ; +0x34e, 0x180005cfe mov rcx, r15 ; +0x351, 0x180005d01 call qword ptr [rax+8] ; +0x354, 0x180005d04 movzx ecx, word ptr [rax] ; +0x357, 0x180005d07 mov [rsp+0A8h+var_78], cx ; +0x35a, 0x180005d0a movzx eax, byte ptr [rax+2] ; +0x35f, 0x180005d0f mov [rsp+0A8h+var_76], al ; +0x363, 0x180005d13 mov rax, [rdi] ; +0x367, 0x180005d17 mov r8d, 1 ; +0x36a, 0x180005d1a lea rdx, [rsp+0A8h+var_78] ; +0x370, 0x180005d20 mov rcx, rdi ; +0x375, 0x180005d25 call qword ptr [rax+4C0h] ; +0x378, 0x180005d28 mov rax, [rdi] ; +0x37e, 0x180005d2e mov r8d, 1 ; +0x381, 0x180005d31 mov rdx, rsi ; +0x387, 0x180005d37 mov rcx, rdi ; +0x38a, 0x180005d3a call qword ptr [rax+4D0h] ; +0x38d, 0x180005d3d mov rax, [rdi] ; +0x393, 0x180005d43 mov r8d, 1 ; +0x396, 0x180005d46 mov rdx, rbp ; +0x39c, 0x180005d4c mov rcx, rdi ; +0x39f, 0x180005d4f call qword ptr [rax+510h] ; +0x3a2, 0x180005d52 mov rbx, [rdi] ; +0x3a8, 0x180005d58 movaps xmm2, xmm6 ; +0x3ab, 0x180005d5b movaps xmm1, xmm6 ; +0x3ae, 0x180005d5e lea rcx, [rsp+0A8h+var_68] ; +0x3b1, 0x180005d61 call cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x3b6, 0x180005d66 mov rdx, rax ; +0x3bc, 0x180005d6c mov rcx, rdi ; +0x3bf, 0x180005d6f call qword ptr [rbx+480h] ; +0x3c2, 0x180005d72 mov rax, [rdi] ; +0x3c8, 0x180005d78 mov rcx, rdi ; +0x3cb, 0x180005d7b call qword ptr [rax+428h] ; +0x3ce, 0x180005d7e mov al, 1 ; +0x3d4, 0x180005d84 jmp short loc_180005D8A ; +0x3d6, 0x180005d86 xor al, al ; +0x3d8, 0x180005d88 mov rcx, [rsp+0A8h+var_40] ; +0x3da, 0x180005d8a xor rcx, rsp; StackCookie ; +0x3df, 0x180005d8f call __security_check_cookie ; +0x3e2, 0x180005d92 mov rbx, [rsp+0A8h+arg_18] ; +0x3e7, 0x180005d97 movaps xmm6, [rsp+0A8h+var_38] ; +0x3ef, 0x180005d9f add rsp, 80h ; +0x3f4, 0x180005da4 pop r15 ; +0x3fb, 0x180005dab pop r14 ; +0x3fd, 0x180005dad pop rdi ; +0x3ff, 0x180005daf pop rsi ; +0x400, 0x180005db0 pop rbp ; +0x401, 0x180005db1 retn ; +0x402, 0x180005db2