Function at 0x4029c0
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 0x402dc9
cmp dword [esp + 0x55c], ebp
je 0x402dc9
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.0041283f
add esp, 4
push esi
push edi
lea ebx, [ebx]
mov esi, dword [esp + 0x55c]
test esi, esi
jle 0x402b6a
lea edx, [esp + 0x30]
push edx
call fcn.0041283f
mov eax, dword [esp + 0x34]
sub eax, dword [esp + 0x28]
add esp, 4
cmp eax, esi
jg 0x402cea
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 0x402b2c
cmp eax, 0x2733
je 0x402b40
mov dword [esp + 0x10], 0xfffffff4
lea ecx, [esp + 0x14c]
cmp ebx, ecx
je 0x402aba
push ebx
call fcn.004130bd
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 0x402dba
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 0x402d83
push 0x3a98
push esi
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov edi, eax
jmp 0x402d87
cmp esi, 1
jne 0x402b40
lea ecx, [esp + 0x48]
push ecx
push edi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x402b73
lea edx, [esp + 0x2c]
push edx
call fcn.0041283f
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x34]
add esp, 4
cmp eax, ecx
jne 0x402c9d
push 0x14
call dword [sym.imp.KERNEL32.dll_Sleep]
jmp 0x402c9d
mov edi, dword [esp + 0x558]
jmp 0x402b7a
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 0x402bd6
call sub.WS2_32.dll_WSAGetLastError
cmp eax, 0x2733
jne 0x402a9e
test esi, esi
jg 0x402bb2
test ebp, ebp
je 0x402cf7
cmp dword [esp + 0x1c], 0x493e0
jg 0x402a9e
test esi, esi
jg 0x402bcc
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
add dword [esp + 0x1c], 0xa
jmp 0x402c9d
test eax, eax
jle 0x402d1e
add ebp, eax
test esi, esi
jle 0x402bf1
lea ecx, [esp + 0x24]
push ecx
call fcn.0041283f
add esp, 4
mov eax, dword [esp + 0x28]
test eax, eax
mov dword [esp + 0x1c], 0
jne 0x402c9d
cmp ebp, 8
jl 0x402c9d
cmp byte [ebx], 0x4a
jne 0x402d11
cmp byte [ebx + 1], 0x5e
jne 0x402d11
cmp byte [ebx + 2], 0x7a
jne 0x402d11
cmp byte [ebx + 3], 4
jne 0x402d11
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 0x402c91
add eax, 8
push eax
call fcn.004131d5
mov ebx, eax
add esp, 4
test ebx, ebx
je 0x402d04
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 0x402a20
mov esi, dword [esp + 0x18]
lea eax, [esi + 8]
cmp ebp, eax
jl 0x402aa6
lea ecx, [esp + 0x14c]
cmp ebx, ecx
push esi
je 0x402d31
mov edi, dword [esp + 0x24]
add ebx, 8
push ebx
push edi
call fcn.00412d80
mov edx, dword [esp + 0x56c]
mov eax, dword [esp + 0x570]
mov dword [edx], edi
add esp, 0xc
mov dword [eax], esi
jmp 0x402ad4
mov dword [esp + 0x10], 0xfffffff1
jmp 0x402aa6
mov dword [esp + 0x10], 0xfffffff7
jmp 0x402aa6
mov dword [esp + 0x10], 0xfffffff5
jmp 0x402aa6
mov dword [esp + 0x10], 0xfffffff3
jmp 0x402aa6
neg eax
sbb eax, eax
and eax, 0xffffffa9
add eax, 0xfffffff4
mov dword [esp + 0x10], eax
jmp 0x402aa6
call fcn.004131d5
mov ecx, dword [esp + 0x564]
add esp, 4
test eax, eax
mov dword [ecx], eax
je 0x402d6d
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 0x402ad4
mov eax, dword [esp + 0x564]
mov dword [esp + 0x10], 0xfffffff5
mov dword [eax], esi
jmp 0x402ad4
mov edi, dword [esp + 0x2c]
mov ebx, 0x428a3c
mov eax, 0x428a20
call fcn.004022f0
mov ecx, dword [0x428a20]
add ecx, ebp
test esi, esi
mov dword [0x428a20], ecx
je 0x402dba
test edi, edi
jne 0x402db3
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