Function at 0x408fa0
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Send data
Send data on socket
Set socket configuration

Disassembly:
sub esp, 0x348
mov eax, dword [0x445750]
xor eax, esp
mov dword [esp + 0x344], eax
cmp dword [0x447250], 1
mov eax, dword [esp + 0x34c]
mov dword [esp + 8], eax
jne 0x408ff1
push 0
push str.save_to_lcd_exit_because_LAN1
call fcn.00404200
add esp, 8
mov eax, 1
mov ecx, dword [esp + 0x344]
xor ecx, esp
call fcn.0041e904
add esp, 0x348
ret
mov eax, dword [0x447844]
test eax, eax
je 0x409001
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
push ebp
push esi
mov esi, dword [sym.imp.WS2_32.dll_socket]
push 6
push 1
push 2
call esi
mov ebp, dword [sym.imp.WS2_32.dll_setsockopt]
push 1
lea ecx, [esp + 0xf]
push ecx
push 4
push 0xffff
push eax
mov dword [0x447844], eax
mov byte [esp + 0x1f], 1
call ebp
xor eax, eax
mov dword [0x447830], eax
mov dword [0x447834], eax
mov dword [0x447838], eax
mov dword [0x44783c], eax
mov eax, dword [0x4479d8]
mov edx, 2
push eax
mov word [0x447830], dx
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0x4e85
mov dword [0x447834], eax
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [0x447844]
push 0x10
push 0x447830
push ecx
mov word [0x447832], ax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jge 0x4090a7
pop esi
xor eax, eax
pop ebp
mov ecx, dword [esp + 0x344]
xor ecx, esp
call fcn.0041e904
add esp, 0x348
ret
mov dl, byte [esp + 0x358]
mov ecx, dword [0x447844]
push ebx
push edi
mov edi, dword [sym.imp.WS2_32.dll_send]
push 0
push 1
lea eax, [esp + 0x1a]
push eax
add dl, 0x31
push ecx
mov byte [esp + 0x22], dl
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov eax, dword [0x447844]
push 0
push 1
lea edx, [esp + 0x19]
push edx
push eax
call dword [sym.imp.WS2_32.dll_recv]
mov al, byte [esp + 0x11]
cmp al, 3
je 0x4091e4
cmp al, 8
jne 0x4090d5
push 0x258
xor esi, esi
lea eax, [esp + 0x24]
push esi
push eax
call fcn.0041e700
fldz
mov ecx, dword [0x4479f0]
mov edx, dword [0x4479ec]
add esp, 0xc
push 0x10
sub esp, 8
fst dword [esp + 4]
lea eax, [esp + 0x284]
fstp dword [esp]
push ecx
push edx
push 0x4394f0
push eax
mov ecx, 0x44781d
call fcn.00403bc0
mov edx, dword [esp + 0x18]
lea ecx, [esp + 0x278]
push ecx
push edx
push 1
lea eax, [esp + 0x2c]
push eax
mov ecx, 0x44781d
call fcn.00403c80
mov ecx, dword [esp + 0x24]
mov eax, dword [0x447840]
push esi
push ecx
lea edx, [esp + 0x28]
push edx
push eax
call edi
cmp eax, dword [esp + 0x24]
jne 0x409306
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x274]
mov edx, dword [0x447840]
push 0
sub eax, esi
push eax
add ecx, esi
push ecx
push edx
call edi
test eax, eax
jl 0x4092e6
add esi, eax
mov eax, dword [esp + 0x28]
cmp esi, eax
jne 0x409181
mov ecx, dword [0x447844]
push 0
push 1
lea eax, [esp + 0x1a]
push eax
push ecx
mov byte [esp + 0x22], 9
call edi
cmp eax, 1
jne 0x4092fa
mov ecx, dword [esp + 0x354]
pop edi
pop ebx
pop esi
pop ebp
xor ecx, esp
call fcn.0041e904
add esp, 0x348
ret
push 0x3e8
call ebx
push 6
push 1
push 2
call esi
push 4
lea ecx, [esp + 0x18]
push ecx
push 0x1002
push 0xffff
push eax
mov dword [0x447840], eax
mov dword [esp + 0x28], 0x4000
mov dword [esp + 0x30], 4
call ebp
test eax, eax
jl 0x409306
mov ecx, dword [0x447840]
lea edx, [esp + 0x1c]
push edx
lea eax, [esp + 0x18]
push eax
push 0x1002
push 0xffff
push ecx
call dword [sym.imp.WS2_32.dll_getsockopt]
test eax, eax
jl 0x409306
xor eax, eax
mov dword [0x447820], eax
mov dword [0x447824], eax
mov dword [0x447828], eax
mov dword [0x44782c], eax
mov eax, dword [0x4479d8]
mov edx, 2
push eax
mov word [0x447820], dx
call dword [sym.imp.WS2_32.dll_inet_addr]
push 0x4e86
mov dword [0x447824], eax
call dword [sym.imp.WS2_32.dll_htons]
mov ecx, dword [0x447840]
push 0x10
push 0x447820
push ecx
mov word [0x447822], ax
call dword [sym.imp.WS2_32.dll_connect]
test eax, eax
jl 0x409306
mov eax, dword [0x447844]
push 0
push 1
lea edx, [esp + 0x19]
push edx
push eax
mov byte [esp + 0x21], 4
call edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov edx, dword [0x447844]
push 0
push 1
lea ecx, [esp + 0x19]
push ecx
push edx
mov dword [0x447814], eax
mov byte [esp + 0x21], 7
call edi
jmp 0x4090d5
mov edx, dword [0x447840]
push edx
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x4091cb
mov eax, dword [0x447840]
push eax
call dword [sym.imp.WS2_32.dll_closesocket]
xor eax, eax
jmp 0x4091cb