Function at 0x404da0
Capabilities:
Check mutex on windows
Get socket status
Receive data
Receive data on socket

Disassembly:
sub esp, 0x544
mov eax, dword [esp + 0x550]
push ebx
push ebp
xor ebp, ebp
cmp eax, ebp
lea ebx, [esp + 0x144]
mov dword [esp + 0x10], ebp
mov dword [esp + 0x14], ebp
je 0x4051a9
cmp dword [esp + 0x55c], ebp
je 0x4051a9
lea ecx, [esp + 0x1c]
mov eax, ebx
push ecx
mov dword [esp + 0x1c], eax
mov dword [esp + 0x10], 8
mov dword [esp + 0x24], ebp
mov dword [esp + 0xc], ebp
call fcn.004104bc
add esp, 4
push esi
push edi
lea ebx, [ebx]
mov esi, dword [esp + 0x55c]
test esi, esi
jle 0x404f4a
lea edx, [esp + 0x30]
push edx
call fcn.004104bc
mov eax, dword [esp + 0x34]
sub eax, dword [esp + 0x28]
add esp, 4
cmp eax, esi
jg 0x4050ca
mov edi, dword [esp + 0x558]
xor ecx, ecx
mov dword [esp + 0x40], ecx
lea edx, [esp + 0x40]
push edx
push ecx
push ecx
lea eax, [esp + 0x54]
push eax
push ecx
mov dword [esp + 0x58], ecx
mov dword [esp + 0x54], 2
mov dword [esp + 0x60], edi
mov dword [esp + 0x5c], 1
call sub.WSOCK32.dll_select
mov esi, eax
call sub.WSOCK32.dll_WSAGetLastError
cmp esi, 0xffffffff
jne 0x404f0c
cmp eax, 0x2733
je 0x404f20
mov dword [esp + 0x10], 0xfffffff4
lea ecx, [esp + 0x14c]
cmp ebx, ecx
je 0x404e9a
push ebx
call fcn.00410b6d
add esp, 4
mov edx, dword [esp + 0x564]
mov eax, dword [esp + 0x560]
mov dword [edx], 0
mov dword [eax], 0
test ebp, ebp
jle 0x40519a
xor ecx, ecx
mov dword [esp + 0x34], ecx
mov dword [esp + 0x38], ecx
push str.KASC_STAT_MUTEX
push ecx
lea edx, [esp + 0x3c]
mov dword [esp + 0x44], ecx
push edx
mov dword [esp + 0x40], 0xc
mov dword [esp + 0x44], ecx
mov dword [esp + 0x48], 1
call dword [sym.imp.KERNEL32.dll_CreateMutexA]
mov esi, eax
test esi, esi
je 0x405163
push 0x3a98
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, eax
jmp 0x405167
cmp esi, 1
jne 0x404f20
lea ecx, [esp + 0x48]
push ecx
push edi
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
jne 0x404f53
lea edx, [esp + 0x2c]
push edx
call fcn.004104bc
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
add esp, 4
cmp eax, ecx
jne 0x40507d
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40507d
mov edi, dword [esp + 0x558]
jmp 0x404f5a
mov esi, dword [esp + 0x55c]
mov ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x20]
push 0
sub ecx, ebp
push ecx
lea eax, [edx + ebp]
push eax
push edi
call sub.WSOCK32.dll_recv
cmp eax, 0xffffffff
jne 0x404fb6
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x404e7e
test esi, esi
jg 0x404f92
test ebp, ebp
je 0x4050d7
cmp dword [esp + 0x1c], 0x493e0
jg 0x404e7e
test esi, esi
jg 0x404fac
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
add dword [esp + 0x1c], 0xa
jmp 0x40507d
test eax, eax
jle 0x4050fe
add ebp, eax
test esi, esi
jle 0x404fd1
lea ecx, [esp + 0x24]
push ecx
call fcn.004104bc
add esp, 4
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x1c], 0
jne 0x40507d
cmp ebp, 8
jl 0x40507d
cmp byte [ebx], 0x4a
jne 0x4050f1
cmp byte [ebx + 1], 0x5e
jne 0x4050f1
cmp byte [ebx + 2], 0x7a
jne 0x4050f1
cmp byte [ebx + 3], 4
jne 0x4050f1
movzx edx, byte [ebx + 6]
movzx ecx, byte [ebx + 7]
xor eax, eax
mov ah, byte [ebx + 4]
mov al, byte [ebx + 5]
shl eax, 8
or eax, edx
shl eax, 8
or eax, ecx
cmp eax, 0x400
mov dword [esp + 0x18], eax
jle 0x405071
add eax, 8
push eax
call fcn.00410c85
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4050e4
mov eax, dword [esp + 0x18]
mov ecx, ebp
mov edx, ecx
shr ecx, 2
lea esi, [esp + 0x14c]
mov edi, ebx
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
mov dword [esp + 0x20], ebx
rep movsb byte es:[edi], byte [esi]
add dword [esp + 0x14], eax
mov dword [esp + 0x28], 1
cmp ebp, dword [esp + 0x14]
jl 0x404e00
mov esi, dword [esp + 0x18]
lea eax, [esi + 8]
cmp ebp, eax
jl 0x404e86
lea ecx, [esp + 0x14c]
cmp ebx, ecx
push esi
je 0x405111
mov edi, dword [esp + 0x24]
add ebx, 8
push ebx
push edi
call fcn.00410830
mov edx, dword [esp + 0x56c]
mov eax, dword [esp + 0x570]
mov dword [edx], edi
add esp, 0xc
mov dword [eax], esi
jmp 0x404eb4
mov dword [esp + 0x10], 0xfffffff1
jmp 0x404e86
mov dword [esp + 0x10], 0xfffffff7
jmp 0x404e86
mov dword [esp + 0x10], 0xfffffff5
jmp 0x404e86
mov dword [esp + 0x10], 0xfffffff3
jmp 0x404e86
neg eax
sbb eax, eax
and eax, 0xffffffa9
add eax, 0xfffffff4
mov dword [esp + 0x10], eax
jmp 0x404e86
call fcn.00410c85
mov ecx, dword [esp + 0x564]
add esp, 4
test eax, eax
mov dword [ecx], eax
je 0x40514d
mov ecx, esi
mov edx, ecx
shr ecx, 2
mov edi, eax
mov eax, dword [esp + 0x564]
lea esi, [ebx + 8]
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x18]
mov dword [eax], esi
jmp 0x404eb4
mov eax, dword [esp + 0x564]
mov dword [esp + 0x10], 0xfffffff5
mov dword [eax], esi
jmp 0x404eb4
mov edi, dword [esp + 0x2c]
mov ebx, 0x4244f4
mov eax, 0x4244d8
call fcn.00404750
mov ecx, dword [0x4244d8]
add ecx, ebp
test esi, esi
mov dword [0x4244d8], ecx
je 0x40519a
test edi, edi
jne 0x405193
push esi
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x544
ret
pop ebp
mov eax, 0xfffffffd
pop ebx
add esp, 0x544
ret