Function at 0x180058d90
Capabilities:
Create thread

Disassembly:
mov qword [rsp + 0x10], rdx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x48
mov ebp, dword [rcx + 0x348]
mov r13d, dword [rdx + 0x10]
xor r8d, r8d
sub r13d, dword [rdx + 0x18]
mov rdi, rcx
mov ecx, dword [rcx + 0x330]
shl r13d, 3
mov eax, ebp
mov r9d, 1
sub r13d, dword [rdx + 0x24]
mov r12, rdx
mov r15d, r8d
add r13d, dword [rdx + 0xc]
cmp ecx, ebp
cmovl eax, ecx
mov dword [rsp + 0x90], r13d
cmp eax, r9d
jge 0x180058df0
mov esi, r9d
jmp 0x180058df7
mov esi, ebp
cmp ecx, ebp
cmovl esi, ecx
mov ebx, dword [rdi + 0x14]
mov dword [rdi + 0x64], r9d
mov eax, ebp
shl eax, 0xa
mov qword [rsp + 0x30], r8
mov qword [rsp + 0x28], r8
cdq
mov rcx, rdi
mov dword [rsp + 0xa8], ebx
mov qword [rsp + 0x20], r8
idiv esi
mov r14d, eax
mov rax, qword [rdi + 0xc0]
mov dword [rax + 0x1c], r9d
mov rax, qword [rdi + 0xc0]
mov r9d, reloc.WS2_32.dll_recv
mov dword [rax + 0x14], r8d
mov rdx, qword [rdi + 0xc0]
call fcn.180057f00
mov rdx, qword [rdi + 0xc0]
mov rcx, rdi
call fcn.180058840
mov r8, qword [rdi + 0xc0]
mov r9d, ebp
mov rdx, rdi
mov rcx, r12
call fcn.180066f70
mov r11d, dword [rdi + 0x20]
mov r9, qword [rdi + 0xc0]
mov r8, qword [rdi + 0xc8]
mov eax, dword [r9 + 0x30]
cdq
idiv r11d
mov ecx, eax
mov dword [r9 + 0x2c], edx
mov eax, dword [r8 + 0x30]
cdq
mov r8d, 8
idiv r11d
sub ecx, eax
mov dword [r9 + 0x28], ecx
mov eax, dword [r12 + 0xc]
and eax, 7
sub r8d, eax
cmp r8d, 8
jge 0x180058ec9
lea rcx, [0x1800878b0]
movsxd rax, r8d
mov edx, dword [rcx + rax*4 - 4]
mov rcx, r12
call fcn.180053590
mov r8, qword [rdi + 0xc0]
mov r9d, 1
mov rdx, rdi
mov rax, qword [r8 + 0x50]
mov ecx, dword [rax + 0xf0]
mov dword [rsp + 0x20], ecx
mov rcx, r12
call fcn.180066a40
mov r11, qword [rdi + 0xc0]
xor eax, eax
mov dword [r11 + 0x144], eax
movzx r11d, ax
test esi, esi
jle 0x180059000
mov r13d, r14d
xor r12d, r12d
lea edx, [r14 + 0x200]
mov eax, r13d
movzx r10d, r11w
sar edx, 0xa
mov ecx, edx
imul r10, r10, 0x70
lea r8d, [rdx + r15]
shl ecx, 0xa
sub eax, ecx
add r14d, eax
mov rax, qword [rdi + 0x338]
mov qword [r10 + rax + 0x68], rdi
mov eax, r8d
imul eax, ebx
lea eax, [rax + rbp - 1]
cdq
idiv ebp
mov ecx, eax
mov rax, qword [rdi + 0x338]
mov dword [r10 + rax + 0x24], ecx
mov eax, ebx
imul eax, r15d
mov r15d, r8d
lea eax, [rax + rbp - 1]
cdq
idiv ebp
mov ecx, eax
mov rax, qword [rdi + 0x338]
mov dword [r10 + rax + 0x20], ecx
test r11w, r11w
je 0x180058fe0
mov rax, qword [rdi + 0x338]
mov r8, qword [r10 + rax + 0x58]
mov rax, qword [r8 + 0x18]
mov ebx, dword [r8 + 0x24]
mov qword [r8 + 0x10], rax
mov r9d, dword [rax]
bswap r9d
mov dword [r8], r9d
mov eax, dword [rax + 4]
bswap eax
mov dword [r8 + 4], eax
test ebx, ebx
je 0x180058fc2
or edx, 0xffffffff
mov ecx, 0x20
sub ecx, ebx
shl edx, cl
and edx, r9d
mov dword [r8 + 8], edx
jmp 0x180058fc6
mov dword [r8 + 8], r12d
mov dword [r8 + 0xc], ebx
mov rax, qword [rdi + 0x338]
mov ebx, dword [rsp + 0xa8]
mov rcx, qword [r10 + rax + 0x60]
mov dword [rcx], r12d
inc r11w
movzx eax, r11w
cmp eax, esi
jl 0x180058f11
mov r12, qword [rsp + 0x98]
mov r13d, dword [rsp + 0x90]
mov rax, qword [rdi + 0x338]
mov r14d, 1
mov qword [rax + 0x58], r12
mov rcx, qword [rdi + 0xc0]
mov rax, qword [rdi + 0x338]
add rcx, 0x144
movzx ebp, r14w
mov qword [rax + 0x60], rcx
cmp esi, r14d
jle 0x180059083
xor r13d, r13d
mov rax, qword [rdi + 0x338]
movzx ebx, bp
lea r8, [fcn.1800588d0]
imul rbx, rbx, 0x70
lea r9, [rbx + rax]
xor edx, edx
xor ecx, ecx
mov qword [rsp + 0x28], r13
mov dword [rsp + 0x20], r13d
call qword [sym.imp.KERNEL32.dll_CreateThread]
inc bp
mov r11, rax
mov rax, qword [rdi + 0x338]
mov qword [rbx + rax], r11
movzx eax, bp
cmp eax, esi
jl 0x180059036
mov r13d, dword [rsp + 0x90]
mov rcx, qword [rdi + 0x338]
call fcn.1800588d0
movzx ebp, r14w
cmp esi, r14d
jle 0x1800590d6
nop dword [rax + rax]
mov rcx, qword [rdi + 0x338]
movzx ebx, bp
or edx, 0xffffffff
imul rbx, rbx, 0x70
mov rcx, qword [rbx + rcx]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov rcx, qword [rdi + 0x338]
mov rcx, qword [rbx + rcx]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
inc bp
movzx eax, bp
cmp eax, esi
jl 0x1800590a0
mov r8d, dword [r12 + 0x10]
sub r8d, dword [r12 + 0x18]
cmp dword [r12 + 0xc], 0
je 0x180059104
mov ecx, dword [r12 + 8]
mov rax, qword [r12 + 0x10]
bswap ecx
mov dword [rax], ecx
mov ecx, dword [r12 + 0xc]
add ecx, 7
shr ecx, 3
add r8d, ecx
mov ecx, dword [r12 + 0x24]
test ecx, ecx
je 0x180059113
shr ecx, 3
sub r8d, ecx
mov eax, r13d
mov r9d, esi
mov rcx, rdi
cdq
and edx, 7
add eax, edx
sar eax, 3
sub r8d, eax
mov rax, qword [rdi + 0xc0]
mov dword [rax + 0x140], r8d
mov rdx, qword [rdi + 0xc0]
mov r8, r12
call fcn.180058bb0
mov r11, qword [rdi + 0xc0]
xor eax, eax
mov dword [r11 + 0x160], eax
mov rcx, qword [rdi + 0xc0]
mov dword [rcx + 0x158], eax
mov rcx, qword [rdi + 0xc0]
mov dword [rcx + 0x154], eax
mov edx, dword [rdi + 0x10]
mov rcx, qword [rdi + 0xc0]
imul edx, dword [rdi + 0x14]
mov dword [rcx + 0x150], edx
mov rcx, qword [rdi + 0xc0]
mov dword [rdi + 0x344], 0xbf800000
mov dword [rdi + 0x68], 2
mov dword [rcx + 0x164], eax
mov rcx, qword [rdi + 0xc0]
mov eax, r14d
mov dword [rcx + 0x168], 0xffffffff
add rsp, 0x48
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret