; ; cocos2d::extension::WebSocket::onSocketCallback from 0x18001a4d0 to 0x18001a855 (901 bytes) ; ; 5 xrefs: ; > sub_1800193C0 @ 0x18001940e ; > @ 0x180031c30 ; > @ 0x180031c40 ; > @ 0x180032408 ; > @ 0x18004cc68 ; ; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True! ; ; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA ; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings ; Generated at Fri, 27 Nov 2026 12:15:43 +0000 ; mov r11, rsp ; +0x0, 0x18001a4d0 mov [r11+10h], rdx ; +0x3, 0x18001a4d3 push rsi ; +0x7, 0x18001a4d7 push r12 ; +0x8, 0x18001a4d8 sub rsp, 48h ; +0xa, 0x18001a4da lea eax, [r8-1]; switch 33 cases ; +0xe, 0x18001a4de mov r12, rdx ; +0x12, 0x18001a4e2 mov rsi, rcx ; +0x15, 0x18001a4e5 cmp eax, 20h ; +0x18, 0x18001a4e8 ja def_18001A525; jumptable 000000018001A525 default case ; +0x1b, 0x18001a4eb mov [r11+8], rbx ; +0x21, 0x18001a4f1 lea rcx, cs:180000000h ; +0x25, 0x18001a4f5 mov [r11+18h], rbp ; +0x2c, 0x18001a4fc mov [r11+20h], rdi ; +0x30, 0x18001a500 mov [r11-18h], r13 ; +0x34, 0x18001a504 mov [r11-20h], r14 ; +0x38, 0x18001a508 mov [r11-28h], r15 ; +0x3c, 0x18001a50c cdqe ; +0x40, 0x18001a510 movzx eax, ds:(byte_18001A834 - 180000000h)[rcx+rax] ; +0x42, 0x18001a512 mov r9d, ds:(jpt_18001A525 - 180000000h)[rcx+rax*4] ; +0x4a, 0x18001a51a add r9, rcx ; +0x52, 0x18001a522 jmp r9; switch jump ; +0x55, 0x18001a525 cmp r8d, 1; jumptable 000000018001A525 cases 1,28,33 ; +0x58, 0x18001a528 jz short loc_18001A57B ; +0x5c, 0x18001a52c cmp r8d, 1Ch ; +0x5e, 0x18001a52e jnz short loc_18001A567 ; +0x62, 0x18001a532 cmp dword ptr [rsi+8], 0 ; +0x64, 0x18001a534 jz short loc_18001A57B ; +0x68, 0x18001a538 cmp dword ptr [rsi+8], 2 ; +0x6a, 0x18001a53a jnz loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x6e, 0x18001a53e mov ecx, 10h; Size ; +0x74, 0x18001a544 call sub_18001F040 ; +0x79, 0x18001a549 xor ebp, ebp ; +0x7e, 0x18001a54e mov [rsp+58h+var_38], rax ; +0x80, 0x18001a550 mov rdx, rax ; +0x85, 0x18001a555 mov [rax+8], rbp ; +0x88, 0x18001a558 mov dword ptr [rax], 5 ; +0x8c, 0x18001a55c jmp loc_18001A7E9 ; +0x92, 0x18001a562 cmp r8d, 21h ; '!' ; +0x97, 0x18001a567 jnz loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x9b, 0x18001a56b cmp dword ptr [rsi+8], 0 ; +0xa1, 0x18001a571 jnz loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0xa5, 0x18001a575 mov ecx, 10h; Size ; +0xab, 0x18001a57b call sub_18001F040 ; +0xb0, 0x18001a580 xor ebp, ebp ; +0xb5, 0x18001a585 mov [rsp+58h+var_38], rax ; +0xb7, 0x18001a587 mov rdx, rax ; +0xbc, 0x18001a58c mov [rax+8], rbp ; +0xbf, 0x18001a58f mov dword ptr [rax], 4 ; +0xc3, 0x18001a593 mov dword ptr [rsi+8], 2 ; +0xc9, 0x18001a599 jmp loc_18001A7E9 ; +0xd0, 0x18001a5a0 mov ecx, 10h; jumptable 000000018001A525 case 3 ; +0xd5, 0x18001a5a5 call sub_18001F040 ; +0xda, 0x18001a5aa xor ebp, ebp ; +0xdf, 0x18001a5af mov [rsp+58h+var_38], rax ; +0xe1, 0x18001a5b1 mov rcx, r12 ; +0xe6, 0x18001a5b6 mov rbx, rax ; +0xe9, 0x18001a5b9 mov [rax+8], rbp ; +0xec, 0x18001a5bc mov dword ptr [rax], 2 ; +0xf0, 0x18001a5c0 mov dword ptr [rsi+8], 1 ; +0xf6, 0x18001a5c6 call cs:lws_callback_on_writable ; +0xfd, 0x18001a5cd mov rdx, rbx ; +0x103, 0x18001a5d3 jmp loc_18001A7E9 ; +0x106, 0x18001a5d6 mov rcx, [rsi+58h]; jumptable 000000018001A525 case 10 ; +0x10b, 0x18001a5db add rcx, 50h ; 'P' ; +0x10f, 0x18001a5df call cs:pthread_mutex_lock ; +0x113, 0x18001a5e3 mov rdx, [rsi+58h] ; +0x119, 0x18001a5e9 xor ebp, ebp ; +0x11d, 0x18001a5ed mov rax, [rdx+40h] ; +0x11f, 0x18001a5ef mov rcx, [rax] ; +0x123, 0x18001a5f3 mov rbx, [rcx] ; +0x126, 0x18001a5f6 cmp rbx, rcx ; +0x129, 0x18001a5f9 jz loc_18001A6A8 ; +0x12c, 0x18001a5fc mov r15, [rbx+10h] ; +0x132, 0x18001a602 mov eax, [r15] ; +0x136, 0x18001a606 test eax, eax ; +0x139, 0x18001a609 jz short loc_18001A612 ; +0x13b, 0x18001a60b cmp eax, 1 ; +0x13d, 0x18001a60d jnz short loc_18001A687 ; +0x140, 0x18001a610 mov r14, [r15+8] ; +0x142, 0x18001a612 mov eax, [r14+8] ; +0x146, 0x18001a616 add eax, 10h ; +0x14a, 0x18001a61a movsxd rcx, eax; Size ; +0x14d, 0x18001a61d call sub_18001F33C ; +0x150, 0x18001a620 movsxd r8, dword ptr [r14+8]; Size ; +0x155, 0x18001a625 xor edx, edx; Val ; +0x159, 0x18001a629 mov r13, rax ; +0x15b, 0x18001a62b lea rcx, [rax+10h]; void * ; +0x15e, 0x18001a62e call memset ; +0x162, 0x18001a632 movsxd r8, dword ptr [r14+8]; Size ; +0x167, 0x18001a637 lea rcx, [r13+10h]; void * ; +0x16b, 0x18001a63b mov rdx, [r14]; Src ; +0x16f, 0x18001a63f call memcpy ; +0x172, 0x18001a642 cmp [r15], ebp ; +0x177, 0x18001a647 lea rdx, [r13+10h] ; +0x17a, 0x18001a64a movsxd r8, dword ptr [r14+8] ; +0x17e, 0x18001a64e mov r9d, ebp ; +0x182, 0x18001a652 setnz r9b ; +0x185, 0x18001a655 mov rcx, r12 ; +0x189, 0x18001a659 call cs:lws_write ; +0x18c, 0x18001a65c mov rcx, [r14]; Block ; +0x192, 0x18001a662 test rcx, rcx ; +0x195, 0x18001a665 jz short loc_18001A672 ; +0x198, 0x18001a668 call j_j_free ; +0x19a, 0x18001a66a mov [r14], rbp ; +0x19f, 0x18001a66f mov edx, 10h ; +0x1a2, 0x18001a672 mov rcx, r14; Block ; +0x1a7, 0x18001a677 call j_j_free ; +0x1aa, 0x18001a67a mov rcx, r13; Block ; +0x1af, 0x18001a67f call j_j_free ; +0x1b2, 0x18001a682 mov edx, 10h ; +0x1b7, 0x18001a687 mov rcx, r15; Block ; +0x1bc, 0x18001a68c call j_j_free ; +0x1bf, 0x18001a68f mov rdx, [rsi+58h] ; +0x1c4, 0x18001a694 mov rbx, [rbx] ; +0x1c8, 0x18001a698 mov rax, [rdx+40h] ; +0x1cb, 0x18001a69b cmp rbx, [rax] ; +0x1cf, 0x18001a69f jnz loc_18001A602 ; +0x1d2, 0x18001a6a2 mov rdi, [rdx+40h] ; +0x1d8, 0x18001a6a8 mov rcx, [rdi] ; +0x1dc, 0x18001a6ac mov rax, [rcx+8] ; +0x1df, 0x18001a6af mov [rax], rbp ; +0x1e3, 0x18001a6b3 mov rcx, [rcx]; Block ; +0x1e6, 0x18001a6b6 test rcx, rcx ; +0x1e9, 0x18001a6b9 jz short loc_18001A6D5 ; +0x1ec, 0x18001a6bc xchg ax, ax ; +0x1ee, 0x18001a6be mov rbx, [rcx] ; +0x1f0, 0x18001a6c0 mov edx, 18h ; +0x1f3, 0x18001a6c3 call j_j_free ; +0x1f8, 0x18001a6c8 mov rcx, rbx ; +0x1fd, 0x18001a6cd test rbx, rbx ; +0x200, 0x18001a6d0 jnz short loc_18001A6C0 ; +0x203, 0x18001a6d3 mov rax, [rdi] ; +0x205, 0x18001a6d5 mov [rax], rax ; +0x208, 0x18001a6d8 mov rax, [rdi] ; +0x20b, 0x18001a6db mov [rax+8], rax ; +0x20e, 0x18001a6de mov [rdi+8], rbp ; +0x212, 0x18001a6e2 mov rcx, [rsi+58h] ; +0x216, 0x18001a6e6 add rcx, 50h ; 'P' ; +0x21a, 0x18001a6ea call cs:pthread_mutex_unlock ; +0x21e, 0x18001a6ee mov rcx, r12 ; +0x224, 0x18001a6f4 call cs:lws_callback_on_writable ; +0x227, 0x18001a6f7 jmp loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x22d, 0x18001a6fd mov rax, [rsi+58h]; jumptable 000000018001A525 case 4 ; +0x232, 0x18001a702 mov byte ptr [rax+70h], 1 ; +0x236, 0x18001a706 cmp dword ptr [rsi+8], 3 ; +0x23a, 0x18001a70a jz loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x23e, 0x18001a70e mov ecx, 10h; Size ; +0x244, 0x18001a714 call sub_18001F040 ; +0x249, 0x18001a719 xor ebp, ebp ; +0x24e, 0x18001a71e mov [rsp+58h+var_38], rax ; +0x250, 0x18001a720 mov rdx, rax ; +0x255, 0x18001a725 mov [rax+8], rbp ; +0x258, 0x18001a728 mov dword ptr [rsi+8], 3 ; +0x25c, 0x18001a72c mov dword ptr [rax], 5 ; +0x263, 0x18001a733 jmp loc_18001A7E9 ; +0x269, 0x18001a739 mov r13, [rsp+58h+Src]; jumptable 000000018001A525 case 8 ; +0x26e, 0x18001a73e test r13, r13 ; +0x276, 0x18001a746 jz loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x279, 0x18001a749 mov rbx, [rsp+58h+Size] ; +0x27f, 0x18001a74f test rbx, rbx ; +0x287, 0x18001a757 jz loc_18001A7F2; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x28a, 0x18001a75a mov ecx, 10h; Size ; +0x290, 0x18001a760 call sub_18001F040 ; +0x295, 0x18001a765 xor ebp, ebp ; +0x29a, 0x18001a76a mov [rsp+58h+var_38], rax ; +0x29c, 0x18001a76c mov ecx, 10h; Size ; +0x2a1, 0x18001a771 mov r12, rax ; +0x2a6, 0x18001a776 mov [rax+8], rbp ; +0x2a9, 0x18001a779 mov dword ptr [rax], 3 ; +0x2ad, 0x18001a77d call sub_18001F040 ; +0x2b3, 0x18001a783 mov rcx, [rsp+58h+arg_8] ; +0x2b8, 0x18001a788 mov rdi, rax ; +0x2bd, 0x18001a78d mov [rsp+58h+var_38], rax ; +0x2c0, 0x18001a790 mov [rax], rbp ; +0x2c5, 0x18001a795 mov [rax+8], ebp ; +0x2c8, 0x18001a798 mov [rax+0Ch], bpl ; +0x2cb, 0x18001a79b call cs:lws_frame_is_binary ; +0x2cf, 0x18001a79f test eax, eax ; +0x2d5, 0x18001a7a5 jz short loc_18001A7B8 ; +0x2d7, 0x18001a7a7 mov rcx, rbx; Size ; +0x2d9, 0x18001a7a9 call sub_18001F33C ; +0x2dc, 0x18001a7ac mov r14, rax ; +0x2e1, 0x18001a7b1 mov al, 1 ; +0x2e4, 0x18001a7b4 jmp short loc_18001A7CA ; +0x2e6, 0x18001a7b6 lea rcx, [rbx+1]; Size ; +0x2e8, 0x18001a7b8 call sub_18001F33C ; +0x2ec, 0x18001a7bc mov r14, rax ; +0x2f1, 0x18001a7c1 mov [rax+rbx], bpl ; +0x2f4, 0x18001a7c4 xor al, al ; +0x2f8, 0x18001a7c8 mov r8, rbx; Size ; +0x2fa, 0x18001a7ca mov [rdi+0Ch], al ; +0x2fd, 0x18001a7cd mov rdx, r13; Src ; +0x300, 0x18001a7d0 mov rcx, r14; void * ; +0x303, 0x18001a7d3 call memcpy ; +0x306, 0x18001a7d6 mov [rdi], r14 ; +0x30b, 0x18001a7db mov rdx, r12 ; +0x30e, 0x18001a7de mov [rdi+8], ebx ; +0x311, 0x18001a7e1 mov [r12+8], rdi ; +0x314, 0x18001a7e4 mov rcx, [rsi+58h] ; +0x319, 0x18001a7e9 call sub_180019580 ; +0x31d, 0x18001a7ed mov r14, [rsp+58h+var_20]; jumptable 000000018001A525 cases 2,5-7,9,11-27,29-32 ; +0x322, 0x18001a7f2 mov r13, [rsp+58h+var_18] ; +0x327, 0x18001a7f7 mov rdi, [rsp+58h+arg_18] ; +0x32c, 0x18001a7fc mov rbp, [rsp+58h+arg_10] ; +0x331, 0x18001a801 mov rbx, [rsp+58h+arg_0] ; +0x336, 0x18001a806 mov r15, [rsp+58h+var_28] ; +0x33b, 0x18001a80b xor eax, eax; jumptable 000000018001A525 default case ; +0x340, 0x18001a810 add rsp, 48h ; +0x342, 0x18001a812 pop r12 ; +0x346, 0x18001a816 pop rsi ; +0x348, 0x18001a818 retn ; +0x349, 0x18001a819 align 4 ; +0x34a, 0x18001a81a dd offset loc_18001A528 - 180000000h; jump table for switch statement ; +0x34c, 0x18001a81c db 0, 5, 1, 2; indirect table for switch statement ; +0x364, 0x18001a834