Function at 0x40d6a0
Capabilities:
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
sub esp, 0x10
push ebx
push ebp
mov bp, word [esp + 0x1c]
push esi
push edi
mov ebx, 1
xor edi, edi
mov eax, dword [0x48bf44]
dec eax
cmp eax, 7
ja case.default.0x40d6c2
jmp dword [eax*4 + 0x40dc38]
cmp bp, bx
jne 0x40d725
cmp dword [0x48bf48], edi
jne case.default.0x40d6c2
mov edx, dword [0x48bf40]
push edi
lea ecx, [esp + 0x28]
push 4
push ecx
push edx
call sub.WSOCK32.dll_recv
test eax, eax
jle case.default.0x40d6c2
mov eax, dword [esp + 0x24]
push eax
call sub.WSOCK32.dll_ntohl
push eax
mov dword [0x48bf48], eax
mov dword [0x48bf50], edi
call fcn.0040d630
add esp, 4
mov dword [0x48bf54], eax
mov dword [0x48bf44], 2
jmp 0x40d6b3
cmp bp, 2
jne case.default.0x40d6c2
mov eax, dword [0x48bf48]
cmp eax, edi
jne 0x40d74a
call fcn.00402f80
mov eax, dword [0x48bf48]
cmp eax, edi
je case.default.0x40d6c2
push eax
call sub.WSOCK32.dll_htonl
mov edx, dword [0x48bf40]
push edi
lea ecx, [esp + 0x14]
push 4
push ecx
push edx
mov dword [esp + 0x20], eax
call sub.WSOCK32.dll_send
test eax, eax
jle case.default.0x40d6c2
mov dword [0x48bf44], 3
jmp 0x40d6b3
mov eax, dword [0x48bf48]
mov ecx, dword [0x48bf50]
sub eax, ecx
push edi
push eax
mov eax, dword [0x48bf54]
add eax, ecx
mov ecx, dword [0x48bf40]
push eax
push ecx
call sub.WSOCK32.dll_recv
cmp eax, edi
jle case.default.0x40d6c2
mov ecx, dword [0x48bf50]
add ecx, eax
mov eax, dword [0x48bf48]
cmp ecx, eax
mov dword [0x48bf50], ecx
jne case.default.0x40d6c2
mov esi, dword [0x48bf54]
mov dword [0x48bf48], edi
push esi
push eax
mov dword [0x48bf50], edi
mov dword [0x48bf54], edi
mov dword [0x48bf44], ebx
call fcn.00402ce0
push esi
call fcn.0040fa2d
add esp, 0xc
jmp 0x40d6b3
mov eax, dword [0x48bf48]
mov ecx, dword [0x48bf50]
mov edx, dword [0x48bf54]
sub eax, ecx
push edi
push eax
mov eax, dword [0x48bf40]
add edx, ecx
push edx
push eax
call sub.WSOCK32.dll_send
cmp eax, edi
jle case.default.0x40d6c2
mov ecx, dword [0x48bf50]
add ecx, eax
mov eax, dword [0x48bf48]
cmp ecx, eax
mov dword [0x48bf50], ecx
jne case.default.0x40d6c2
mov ecx, dword [0x48bf54]
mov dword [0x48bf48], edi
push ecx
mov dword [0x48bf50], edi
call fcn.0040fa2d
add esp, 4
mov dword [0x48bf54], edi
mov dword [0x48bf44], ebx
jmp 0x40d6b3
cmp bp, 2
jne case.default.0x40d6c2
mov eax, dword [0x48bf80]
cmp eax, edi
je case.default.0x40d6c2
push eax
call sub.WSOCK32.dll_htonl
mov dword [esp + 0x14], eax
mov eax, dword [0x48bf40]
push edi
lea edx, [esp + 0x18]
push 4
push edx
push eax
call sub.WSOCK32.dll_send
test eax, eax
jle case.default.0x40d6c2
mov ecx, dword [0x48bf80]
mov edx, dword [0x48bf54]
mov eax, dword [0x48bf40]
push edi
push ecx
push edx
push eax
call sub.WSOCK32.dll_send
test eax, eax
jle case.default.0x40d6c2
mov dword [0x48bf80], edi
mov dword [0x48bf44], 5
jmp 0x40d6b3
cmp bp, 2
jne case.default.0x40d6c2
mov eax, dword [0x48bf80]
cmp eax, edi
jne 0x40d920
mov ecx, dword [0x48bf70]
mov edx, dword [0x48bf48]
mov eax, dword [0x48bf54]
push ecx
push edx
push ebx
push eax
call fcn.00410f0d
add esp, 0x10
cmp eax, edi
je 0x40dbb7
mov dword [0x48bf80], eax
mov dword [0x48bf4c], edi
mov ecx, dword [0x48bf54]
mov edx, dword [0x48bf4c]
push edi
push eax
mov eax, dword [0x48bf40]
add edx, ecx
push edx
push eax
call sub.WSOCK32.dll_send
cmp eax, edi
jle case.default.0x40d6c2
mov edx, dword [0x48bf50]
mov ecx, dword [0x48bf80]
add edx, eax
cmp eax, ecx
mov dword [0x48bf50], edx
jge 0x40d976
mov edx, ecx
mov ecx, dword [0x48bf4c]
sub edx, eax
add ecx, eax
mov dword [0x48bf80], edx
mov dword [0x48bf4c], ecx
jmp 0x40d982
mov dword [0x48bf80], edi
mov dword [0x48bf4c], edi
mov ecx, dword [0x48bf50]
mov eax, dword [0x48bf84]
cmp ecx, eax
jl 0x40d6b3
mov edx, dword [0x48bf70]
push edx
call fcn.0040f90a
mov eax, dword [0x48bf54]
mov dword [0x48bf70], edi
push eax
call fcn.0040fa2d
mov ecx, dword [0x48bf74]
mov dword [0x48bf54], edi
push ecx
mov dword [0x48bf48], edi
mov dword [0x48bf50], edi
mov dword [0x48bf80], edi
mov dword [0x48bf84], edi
call fcn.0040fa2d
mov edx, dword [0x48bf78]
mov dword [0x48bf74], edi
push edx
call fcn.0040fa2d
add esp, 0x10
mov dword [0x48bf78], edi
mov dword [0x48bf44], ebx
jmp 0x40d6b3
cmp bp, 2
jne case.default.0x40d6c2
mov eax, dword [0x48bf80]
cmp eax, edi
je case.default.0x40d6c2
push eax
call sub.WSOCK32.dll_htonl
mov ecx, dword [0x48bf40]
mov dword [esp + 0x18], eax
push edi
lea eax, [esp + 0x1c]
push 4
push eax
push ecx
call sub.WSOCK32.dll_send
test eax, eax
jle case.default.0x40d6c2
mov edx, dword [0x48bf80]
mov eax, dword [0x48bf54]
mov ecx, dword [0x48bf40]
push edi
push edx
push eax
push ecx
call sub.WSOCK32.dll_send
test eax, eax
jle case.default.0x40d6c2
mov dword [0x48bf80], edi
mov dword [0x48bf44], 7
jmp 0x40d6b3
mov eax, dword [0x48bf40]
push edi
lea edx, [esp + 0x20]
push 4
push edx
push eax
call sub.WSOCK32.dll_recv
test eax, eax
jle case.default.0x40d6c2
mov ecx, dword [esp + 0x1c]
push ecx
call sub.WSOCK32.dll_ntohl
mov dword [0x48bf84], eax
mov dword [0x48bf50], edi
mov dword [0x48bf44], 8
jmp 0x40d6b3
mov eax, dword [0x48bf84]
mov esi, dword [0x48bf50]
mov ecx, dword [0x48bf48]
sub eax, esi
cmp eax, ecx
jle 0x40dace
mov eax, ecx
cmp eax, edi
je 0x40dbb0
mov edx, dword [0x48bf54]
push edi
push eax
mov eax, dword [0x48bf40]
push edx
push eax
call sub.WSOCK32.dll_recv
mov esi, eax
cmp esi, edi
jl case.default.0x40d6c2
je case.default.0x40d6c2
mov eax, dword [0x48bf70]
cmp eax, edi
je 0x40db19
cmp esi, edi
jle 0x40db19
mov ecx, dword [0x48bf54]
push eax
push esi
push ebx
push ecx
call fcn.00410dd4
add esp, 0x10
mov eax, dword [0x48bf50]
mov ecx, dword [0x48bf84]
add eax, esi
cmp eax, ecx
mov dword [0x48bf50], eax
jl 0x40d6b3
mov eax, dword [0x48bf70]
mov dword [0x48bf44], ebx
cmp eax, edi
je 0x40db4b
push eax
call fcn.0040f90a
add esp, 4
mov eax, dword [0x48bf54]
mov dword [0x48bf70], edi
cmp eax, edi
mov dword [0x48bf84], edi
mov dword [0x48bf48], edi
mov dword [0x48bf50], edi
je 0x40db75
push eax
call fcn.0040fa2d
add esp, 4
mov eax, dword [0x48bf74]
mov dword [0x48bf54], edi
cmp eax, edi
je 0x40db8d
push eax
call fcn.0040fa2d
add esp, 4
mov eax, dword [0x48bf78]
mov dword [0x48bf74], edi
cmp eax, edi
je 0x40dba5
push eax
call fcn.0040fa2d
add esp, 4
mov dword [0x48bf78], edi
jmp 0x40d6b3
xor esi, esi
jmp 0x40dafa
push 0x41cf78
call fcn.00402c10
mov edx, dword [0x48bf70]
push edx
call fcn.0040f90a
mov eax, dword [0x48bf54]
mov dword [0x48bf70], edi
push eax
call fcn.0040fa2d
mov ecx, dword [0x48bf74]
mov dword [0x48bf54], edi
push ecx
mov dword [0x48bf48], edi
mov dword [0x48bf50], edi
mov dword [0x48bf80], edi
mov dword [0x48bf84], edi
call fcn.0040fa2d
mov edx, dword [0x48bf78]
mov dword [0x48bf74], edi
push edx
call fcn.0040fa2d
add esp, 0x14
mov dword [0x48bf78], edi
mov dword [0x48bf44], ebx
call fcn.0040d340
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret