Function at 0x404660
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 0x404a69
cmp dword [esp + 0x55c], ebp
je 0x404a69
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.0040dc0c
add esp, 4
push esi
push edi
lea ebx, [ebx]
mov esi, dword [esp + 0x55c]
test esi, esi
jle 0x40480a
lea edx, [esp + 0x30]
push edx
call fcn.0040dc0c
mov eax, dword [esp + 0x34]
sub eax, dword [esp + 0x28]
add esp, 4
cmp eax, esi
jg 0x40498a
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.WS2_32.dll_select
mov esi, eax
call sub.WS2_32.dll_WSAGetLastError
cmp esi, 0xffffffff
jne 0x4047cc
cmp eax, 0x2733
je 0x4047e0
mov dword [esp + 0x10], 0xfffffff4
lea ecx, [esp + 0x14c]
cmp ebx, ecx
je 0x40475a
push ebx
call fcn.0040e24d
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 0x404a5a
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 0x404a23
push 0x3a98
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, eax
jmp 0x404a27
cmp esi, 1
jne 0x4047e0
lea ecx, [esp + 0x48]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x404813
lea edx, [esp + 0x2c]
push edx
call fcn.0040dc0c
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
add esp, 4
cmp eax, ecx
jne 0x40493d
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x40493d
mov edi, dword [esp + 0x558]
jmp 0x40481a
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.WS2_32.dll_recv
cmp eax, 0xffffffff
jne 0x404876
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x40473e
test esi, esi
jg 0x404852
test ebp, ebp
je 0x404997
cmp dword [esp + 0x1c], 0x493e0
jg 0x40473e
test esi, esi
jg 0x40486c
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
add dword [esp + 0x1c], 0xa
jmp 0x40493d
test eax, eax
jle 0x4049be
add ebp, eax
test esi, esi
jle 0x404891
lea ecx, [esp + 0x24]
push ecx
call fcn.0040dc0c
add esp, 4
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x1c], 0
jne 0x40493d
cmp ebp, 8
jl 0x40493d
cmp byte [ebx], 0x4a
jne 0x4049b1
cmp byte [ebx + 1], 0x5e
jne 0x4049b1
cmp byte [ebx + 2], 0x7a
jne 0x4049b1
cmp byte [ebx + 3], 4
jne 0x4049b1
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 0x404931
add eax, 8
push eax
call fcn.0040e365
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x4049a4
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 0x4046c0
mov esi, dword [esp + 0x18]
lea eax, [esi + 8]
cmp ebp, eax
jl 0x404746
lea ecx, [esp + 0x14c]
cmp ebx, ecx
push esi
je 0x4049d1
mov edi, dword [esp + 0x24]
add ebx, 8
push ebx
push edi
call fcn.0040df10
mov edx, dword [esp + 0x56c]
mov eax, dword [esp + 0x570]
mov dword [edx], edi
add esp, 0xc
mov dword [eax], esi
jmp 0x404774
mov dword [esp + 0x10], 0xfffffff1
jmp 0x404746
mov dword [esp + 0x10], 0xfffffff7
jmp 0x404746
mov dword [esp + 0x10], 0xfffffff5
jmp 0x404746
mov dword [esp + 0x10], 0xfffffff3
jmp 0x404746
neg eax
sbb eax, eax
and eax, 0xffffffa9
add eax, 0xfffffff4
mov dword [esp + 0x10], eax
jmp 0x404746
call fcn.0040e365
mov ecx, dword [esp + 0x564]
add esp, 4
test eax, eax
mov dword [ecx], eax
je 0x404a0d
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 0x404774
mov eax, dword [esp + 0x564]
mov dword [esp + 0x10], 0xfffffff5
mov dword [eax], esi
jmp 0x404774
mov edi, dword [esp + 0x2c]
mov ebx, 0x4214f4
mov eax, 0x4214d8
call fcn.00404010
mov ecx, dword [0x4214d8]
add ecx, ebp
test esi, esi
mov dword [0x4214d8], ecx
je 0x404a5a
test edi, edi
jne 0x404a53
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