Function at 0x4160e0
Capabilities:
Get socket status
Receive data
Receive data on socket
Resolve function by parsing pe exports
Send data
Send data on socket

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x14c
mov ebp, dword [esp + 0x164]
mov ebx, dword [esp + 0x160]
cmp ebp, 0x7f
jle 0x4166d8
add ebp, ebp
mov eax, ebp
mov dword [esp + 4], eax
mov dword [esp], 1
call sym._calloc
mov esi, eax
test eax, eax
je 0x4166c0
mov edx, dword [ebx]
mov eax, 0xc8000000
test byte [edx + 0xf], 2
je 0x4166f0
mov edi, dword [sym.imp.WS2_32.dll_htonl]
mov dword [esp], eax
call edi
mov dword [esi + 0x10], eax
mov eax, dword [ebx + 0x9c]
sub esp, 4
mov dword [esp], eax
call edi
mov dword [esi + 0x14], eax
mov eax, dword [ebx + 0x98]
sub esp, 4
mov dword [esp], eax
call edi
sub esp, 4
mov dword [esi + 0x18], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x10]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x1c], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x10]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul dword [0x4603c4]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
mov dword [esi + 0x20], eax
mov eax, dword [ebx + 0xa0]
sub esp, 4
mov dword [esp], eax
call edi
mov dword [esi + 0x24], eax
mov eax, dword [ebx + 0xa8]
sub esp, 4
mov dword [esp], eax
call edi
mov dword [esi + 0x28], eax
mov eax, dword [ebx + 0xb0]
sub esp, 4
mov dword [esp], eax
call edi
mov dword [esi + 0x2c], eax
mov eax, dword [ebx + 0xa4]
sub esp, 4
mov dword [esp], eax
call edi
mov dword [esi + 0x74], eax
mov eax, dword [ebx + 0xac]
sub esp, 4
mov dword [esp], eax
call edi
mov dword [esi + 0x78], eax
mov eax, dword [ebx + 0xb4]
sub esp, 4
mov dword [esp], eax
call edi
xor ecx, ecx
mov edx, dword [ebx + 0x3e4]
mov dword [esi + 0x7c], eax
mov eax, dword [ebx + 0x3e0]
sub esp, 4
cmp ecx, eax
sbb ecx, edx
jge 0x416748
mov dword [esp + 0x20], eax
mov dword [esp + 0x24], edx
fild qword [esp + 0x20]
fdivr qword [ebx + 0x3b8]
fst qword [ebx + 0xc8]
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x30], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0xc8]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x34], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x320]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x38], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x320]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x3c], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x318]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x40], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x318]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x44], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x328]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x48], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x328]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x4c], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x338]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x50], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x338]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
fld qword [0x460400]
fmul qword [ebx + 0x340]
sub esp, 4
mov dword [esi + 0x54], eax
fst qword [ebx + 0x340]
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x58], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x340]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x5c], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x348]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x60], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
or ah, 0xc
mov word [esp + 0x2c], ax
fld qword [ebx + 0x348]
fldcw word [esp + 0x2c]
fist dword [esp + 0x20]
fldcw word [esp + 0x2e]
fild dword [esp + 0x20]
fsubp st(1)
fmul qword [0x4603d8]
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
mov dword [esi + 0x64], eax
mov eax, dword [ebx + 0x350]
sub esp, 4
mov dword [esp], eax
call edi
fild qword [ebx + 0xb0]
fld qword [ebx + 0x10]
fsub qword [ebx + 8]
sub esp, 4
mov dword [esi + 0x68], eax
fnstcw word [esp + 0x2e]
movzx eax, word [esp + 0x2e]
fdivp st(1)
or ah, 0xc
mov word [esp + 0x2c], ax
fldcw word [esp + 0x2c]
fistp dword [esp]
fldcw word [esp + 0x2e]
call edi
sub esp, 4
mov dword [esi + 0x6c], eax
mov dword [esp], 1
call edi
mov edi, 9
mov dword [esi + 0x70], eax
sub esp, 4
jmp 0x416640
mov eax, dword [ebx]
lea ecx, [esp + 0x34]
lea edx, [esp + 0x3c]
mov dword [esp + 0x3c], 1
mov dword [esp + 0x34], 0
mov eax, dword [eax + 0x26c]
mov dword [esp + 0x38], 0x3d090
mov dword [esp + 0x10], ecx
mov dword [esp + 0x40], eax
add eax, 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_select]
sub esp, 0x14
test eax, eax
je 0x416758
mov dword [esp + 0xc], 0
mov dword [esp + 8], ebp
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov eax, dword [eax + 0x26c]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_recv]
sub esp, 0x10
test eax, eax
js 0x416698
sub edi, 1
je 0x4166b8
mov dword [esp + 0xc], 0
mov dword [esp + 8], pe_nt_image_headers32
mov dword [esp + 4], esi
mov eax, dword [ebx]
mov eax, dword [eax + 0x26c]
mov dword [esp], eax
call dword [sym.imp.WS2_32.dll_send]
sub esp, 0x10
test eax, eax
jns 0x4165b8
mov dword [esp + 8], 0x474
mov dword [esp + 4], str.Reports.c
mov dword [esp], str.write_ackfin
call sym._warn_errno
jmp 0x4165b8
call dword [sym.imp.msvcrt.dll__errno]
mov dword [esp + 0x20], eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, dword [esp + 0x20]
mov dword [edx], eax
cmp eax, 0x2733
je 0x41663b
lea esi, [esi]
mov dword [esp], esi
call sym._free
mov eax, dword [ebx]
cmp dword [eax + 4], 1
jne 0x416710
add esp, 0x14c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0x100
mov ebp, 0x100
jmp 0x416105
mov eax, dword [edx + 0x10]
and eax, 0x2000
cmp eax, 1
sbb eax, eax
and eax, 0xc0000000
sub eax, 0x38000000
jmp 0x416130
mov ebx, dword [eax + 0x26c]
mov dword [esp], 2
call dword [0x459154]
mov dword [esp + 4], str.__3d__WARNING:_ack_of_last_datagram_failed._n
mov dword [esp + 8], ebx
mov dword [esp], eax
call sym._fprintf_2
add esp, 0x14c
pop ebx
pop esi
pop edi
pop ebp
ret
fld qword [ebx + 0xc8]
jmp 0x41625f
mov dword [esp + 0x160], esi
add esp, 0x14c
pop ebx
pop esi
pop edi
pop ebp
jmp sym._free