Function at 0x1400406b0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0xc8
mov rax, qword [rdx + 8]
mov r8, qword [rdx + 0x10]
mov r9, rax
sub r9, r8
cmp r9, 4
jb 0x1400406fb
lea r9, [r8 + 4]
mov qword [rdx + 0x10], r9
cmp r8, 0xfffffffffffffffb
ja 0x140040d3d
mov r10, rax
sub r10, r9
jb 0x140040d3d
cmp r10, 4
jae 0x14004073d
lea rax, [0x1401d802d]
mov qword [rcx + 8], 0xb
mov dword [rcx + 0x10], eax
shr rax, 0x20
mov dword [rcx + 0x14], eax
mov qword [rcx + 0x18], 3
movabs rax, 0x8000000000000000
mov qword [rcx], rax
add rsp, 0xc8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
mov r10, qword [rdx]
mov r13d, dword [r10 + r8]
add r8, 8
mov qword [rdx + 0x10], r8
cmp r9, 0xfffffffffffffffb
ja 0x140040d3d
cmp r8, rax
ja 0x140040d3d
mov r14, rcx
mov ebp, dword [r10 + r9]
lea rcx, [rsp + 0x30]
mov rbx, rdx
call fcn.1400542a0
cmp qword [rsp + 0x30], 0
je 0x14004079d
movups xmm0, xmmword [rsp + 0x38]
mov rax, qword [rsp + 0x48]
movups xmmword [r14 + 8], xmm0
mov qword [r14 + 0x18], rax
movabs rax, 0x8000000000000000
mov qword [r14], rax
jmp 0x140040729
mov r15, qword [rsp + 0x38]
mov rdi, qword [rsp + 0x40]
mov rsi, qword [rsp + 0x48]
lea rcx, [rsp + 0x30]
mov rdx, rbx
call fcn.1400541a0
cmp qword [rsp + 0x30], 0
je 0x1400407e6
movups xmm0, xmmword [rsp + 0x38]
mov rax, qword [rsp + 0x48]
movups xmmword [r14 + 8], xmm0
mov qword [r14 + 0x18], rax
movabs rax, 0x8000000000000000
mov qword [r14], rax
jmp 0x1400408a9
mov r12, qword [rsp + 0x38]
mov r8, qword [rsp + 0x40]
mov rcx, qword [rbx + 8]
mov r10, qword [rbx + 0x10]
mov rax, rcx
sub rax, r10
cmp rax, 2
mov rax, r14
jae 0x140040822
lea rbp, str.u8u24u32received_unexpected_message:_got__when_expecting
mov rsi, rbp
shr rsi, 0x10
mov r13d, 0xb
mov ecx, 2
jmp 0x140040872
mov r9, qword [rsp + 0x48]
lea rdx, [r10 + 2]
mov qword [rbx + 0x10], rdx
cmp r10, 0xfffffffffffffffd
ja 0x140040d3d
mov qword [rsp + 0xb0], r9
mov qword [rsp + 0xb8], rsi
mov r11, rcx
sub r11, rdx
jb 0x140040d3d
mov r9, qword [rbx]
movzx esi, word [r9 + r10]
rol si, 8
movzx r10d, si
cmp r11, r10
jae 0x1400408d6
mov r13d, 0xa
xor ecx, ecx
movabs rbx, 0x8000000000000000
mov qword [rax + 8], r13
mov word [rax + 0x10], bp
mov dword [rax + 0x12], esi
shr rsi, 0x20
mov word [rax + 0x16], si
mov qword [rax + 0x18], rcx
mov qword [rax], rbx
test r12, r12
je 0x1400408a9
mov rcx, qword [0x1402590e0]
xor edx, edx
call sub.KERNEL32.dll_HeapFree
test r15, r15
je 0x140040729
mov rcx, qword [0x1402590e0]
xor edx, edx
mov r8, rdi
add rsp, 0xc8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
jmp sub.KERNEL32.dll_HeapFree
add r10, rdx
mov qword [rbx + 0x10], r10
jb 0x140040d3d
cmp r10, rcx
ja 0x140040d3d
mov dword [rsp + 0x84], ebp
mov qword [rsp + 0x88], r12
mov qword [rsp + 0x90], r8
mov qword [rsp + 0x98], r15
mov qword [rsp + 0xa0], rdi
add r9, rdx
mov qword [rsp + 0x50], r9
mov word [rsp + 0x58], si
mov word [rsp + 0x5e], 0
mov dword [rsp + 0x5a], 0
mov qword [rsp + 0x60], 0
mov qword [rsp + 0x68], 0
mov qword [rsp + 0x70], 8
mov qword [rsp + 0x78], 0
cmp qword [rsp + 0x58], 0
je 0x140040b6c
mov dword [rsp + 0x80], r13d
mov ebp, 8
xor eax, eax
mov qword [rsp + 0x20], rax
lea rax, [0x1401d77f0]
mov qword [rsp + 0x28], rax
xor r12d, r12d
mov qword [rsp + 0xa8], rax
jmp 0x1400409fa
mov rax, r14
mov rcx, qword [rsp + 0xa8]
shl rcx, 0x20
mov edx, ebp
or rdx, rcx
mov rcx, rdi
shr rcx, 0x10
mov rbp, qword [rsp + 0x70]
mov r8, r12
shl r8, 5
mov qword [rbp + r8], rsi
mov qword [rbp + r8 + 8], rdx
mov qword [rsp + 0xc0], rdi
mov word [rbp + r8 + 0x10], di
mov dword [rbp + r8 + 0x12], ecx
shr rcx, 0x20
mov word [rbp + r8 + 0x16], cx
mov qword [rbp + r8 + 0x18], rbx
inc r12
mov qword [rsp + 0x78], r12
mov rcx, qword [rsp + 0x60]
mov rsi, r13
cmp rcx, qword [rsp + 0x58]
jae 0x140040be4
lea rcx, [rsp + 0x30]
lea rdx, [rsp + 0x50]
call fcn.140045a60
mov r13, qword [rsp + 0x30]
movzx edi, word [rsp + 0x38]
movzx r15d, word [rsp + 0x3a]
cmp r13, 0x14
jne 0x140040b79
mov rax, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x60]
mov rcx, rax
sub rcx, rdx
cmp rcx, 2
jb 0x140040ba9
lea rcx, [rdx + 2]
mov qword [rsp + 0x60], rcx
cmp rdx, 0xfffffffffffffffd
ja 0x140040d3d
mov r8, rax
sub r8, rcx
jb 0x140040d3d
mov r12, qword [rsp + 0x50]
movzx edx, word [r12 + rdx]
mov r9d, edx
rol r9w, 8
movzx r13d, r9w
cmp r8, r13
jb 0x140040bd4
mov r8, rcx
add r8, r13
mov qword [rsp + 0x60], r8
jb 0x140040d3d
cmp r8, rax
ja 0x140040d3d
add r12, rcx
cmp edi, 0x16
jne 0x140040ae3
cmp r13w, 4
jb 0x140040c71
cmp r13d, 4
ja 0x140040c8f
mov ebp, dword [r12]
bswap ebp
movabs rax, 0xffffffff00000000
and rbx, rax
or rbx, rdi
shl r15d, 0x10
or rbx, r15
movabs rsi, 0x8000000000000000
mov rdi, qword [rsp + 0xc0]
jmp 0x140040b45
test dx, dx
je 0x140040b06
movzx eax, byte [0x140259141]
xor ecx, ecx
mov rdx, r13
call fcn.14008b700
mov rbp, rax
test rax, rax
jne 0x140040b0b
jmp 0x140040d3d
mov ebp, 1
mov rcx, rbp
mov rdx, r12
mov r8, r13
call sub.msvcrt.dll_memcpy
mov rax, rbp
shr rax, 0x20
mov qword [rsp + 0xa8], rax
movabs rax, 0xffffffff00000000
and rbx, rax
or rbx, rdi
shl r15d, 0x10
or rbx, r15
mov rsi, r13
mov rdi, r13
mov r12, qword [rsp + 0x78]
cmp r12, qword [rsp + 0x68]
jne 0x14004098c
lea rcx, [rsp + 0x68]
mov rdx, r12
call fcn.140045e80
mov r12, qword [rsp + 0x78]
jmp 0x14004098c
mov bp, 8
xor r12d, r12d
xor ecx, ecx
xor edx, edx
jmp 0x140040bf8
mov rax, qword [rsp + 0x40]
mov qword [rsp + 0x20], rax
mov eax, dword [rsp + 0x3c]
shl r15d, 0x10
or r15, rdi
shl rax, 0x20
or rax, r15
mov qword [rsp + 0x28], rax
movabs rbx, 0x8000000000000000
jmp 0x140040cb3
lea rax, str.u8u24u32received_unexpected_message:_got__when_expecting
mov qword [rsp + 0x28], rax
mov eax, 2
mov qword [rsp + 0x20], rax
mov r13d, 0xb
movabs rbx, 0x8000000000000000
jmp 0x140040cb3
mov r13d, 0xa
mov qword [rsp + 0x28], rsi
jmp 0x140040c9f
mov rcx, rbp
shr rcx, 0x10
mov rdx, qword [rsp + 0x68]
mov r13d, dword [rsp + 0x80]
bswap r13d
mov r9d, dword [rsp + 0x84]
bswap r9d
mov r8, qword [rsp + 0x98]
mov qword [rax], r8
mov r8, qword [rsp + 0xa0]
mov qword [rax + 8], r8
mov r8, qword [rsp + 0xb8]
mov qword [rax + 0x10], r8
mov r8, qword [rsp + 0x88]
mov qword [rax + 0x18], r8
mov r8, qword [rsp + 0x90]
mov qword [rax + 0x20], r8
mov r8, qword [rsp + 0xb0]
mov qword [rax + 0x28], r8
mov qword [rax + 0x30], rdx
mov word [rax + 0x38], bp
mov dword [rax + 0x3a], ecx
shr rcx, 0x20
mov word [rax + 0x3e], cx
mov qword [rax + 0x40], r12
mov dword [rax + 0x48], r13d
mov dword [rax + 0x4c], r9d
jmp 0x140040729
mov eax, 3
mov qword [rsp + 0x20], rax
mov r13d, 0xb
lea rsi, [0x1401d802d]
mov qword [rsp + 0x28], rsi
jmp 0x140040c9f
mov eax, 0x19
mov qword [rsp + 0x20], rax
mov r13d, 0xe
movabs rbx, 0x8000000000000000
mov rbp, qword [rsp + 0x70]
mov r12, qword [rsp + 0x78]
test r12, r12
je 0x140040ce9
add rbp, 8
jmp 0x140040cc7
add rbp, 0x20
dec r12
je 0x140040ce9
mov rax, qword [rbp - 8]
cmp rax, rbx
je 0x140040cbe
test rax, rax
je 0x140040cbe
mov r8, qword [rbp]
mov rcx, qword [0x1402590e0]
xor edx, edx
call sub.KERNEL32.dll_HeapFree
jmp 0x140040cbe
mov rbp, qword [rsp + 0x28]
mov rsi, rbp
shr rsi, 0x10
cmp qword [rsp + 0x68], 0
je 0x140040d10
mov r8, qword [rsp + 0x70]
mov rcx, qword [0x1402590e0]
xor edx, edx
call sub.KERNEL32.dll_HeapFree
mov rax, r14
mov rdi, qword [rsp + 0xa0]
mov r15, qword [rsp + 0x98]
mov r8, qword [rsp + 0x90]
mov r12, qword [rsp + 0x88]
mov rcx, qword [rsp + 0x20]
jmp 0x14004087c
ud2