Function at 0x515a20
Capabilities:
Send data
Send data on socket

Disassembly:
sub esp, 0x18
push esi
mov esi, dword [0x59f670]
test esi, esi
mov eax, edx
je 0x515caf
cmp dword [esi + 0x18c], ecx
je 0x515a4b
mov esi, dword [esi + 0x194]
test esi, esi
jne 0x515a34
pop esi
add esp, 0x18
ret
cmp dword [esi + 0x14c], 2
jne 0x515caf
shr eax, 0x10
test ax, ax
je 0x515aae
movzx eax, ax
mov dword [esi + 0x184], eax
mov eax, dword [0x59ca60]
test eax, eax
je 0x515a95
mov eax, dword [esi + 0x158]
test eax, eax
mov edx, esi
push 3
je 0x515a89
push 0x45
mov ecx, str.UDPWRITE
jmp 0x515a90
push 0x3f
mov ecx, str.SOCKWRITE
call fcn.00513350
mov ecx, esi
call fcn.00513210
test eax, eax
je 0x515caf
call fcn.00513140
pop esi
add esp, 0x18
ret
mov eax, dword [esi + 0x140]
test eax, eax
je 0x515caf
push edi
mov edi, dword [esi + 0x144]
cmp edi, 0x2000
jle 0x515ad0
mov edi, 0x2000
mov ecx, dword [esi + 0x158]
test ecx, ecx
je 0x515b4a
xor ecx, ecx
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], ecx
lea eax, [esi + 0x160]
mov dword [esp + 0x18], ecx
mov dword [esp + 8], eax
mov dword [esp + 0xc], 0
mov dword [esp + 0x1c], ecx
mov word [esp + 0x10], 2
mov edx, dword [eax]
xor eax, eax
mov ax, word [esi + 0x164]
mov dword [esp + 0x14], edx
push eax
call dword [sym.imp.WSOCK32.dll_htons]
mov ecx, dword [esp + 8]
push 0x10
mov word [esp + 0x16], ax
mov edx, dword [ecx]
mov ecx, dword [esi + 0x140]
lea eax, [esp + 0x14]
push eax
push 0
push edi
mov dword [esp + 0x24], edx
mov edx, dword [esi + 0x18c]
push ecx
push edx
call dword [sym.imp.WSOCK32.dll_sendto]
jmp 0x515b5b
push 0
push edi
push eax
mov eax, dword [esi + 0x18c]
push eax
call dword [sym.imp.WSOCK32.dll_send]
mov edi, eax
cmp edi, 0xffffffff
jne 0x515bc1
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x515cae
mov dword [esi + 0x184], eax
mov eax, dword [0x59ca60]
test eax, eax
je 0x515ba5
mov eax, dword [esi + 0x158]
test eax, eax
mov edx, esi
push 3
je 0x515b99
push 0x45
mov ecx, str.UDPWRITE
jmp 0x515ba0
push 0x3f
mov ecx, str.SOCKWRITE
call fcn.00513350
mov ecx, esi
call fcn.00513210
test eax, eax
je 0x515cae
mov ecx, esi
call fcn.00513140
pop edi
pop esi
add esp, 0x18
ret
push 0
call fcn.00563e36
add esp, 4
test edi, edi
mov dword [esi + 0x17c], eax
jle 0x515c43
mov edx, dword [esi + 0x170]
mov eax, dword [esi + 0x144]
add edx, edi
cmp edi, eax
mov dword [esi + 0x170], edx
jge 0x515c43
mov ecx, dword [esi + 0x140]
sub eax, edi
push eax
lea edx, [ecx + edi]
push edx
push ecx
mov dword [esi + 0x144], eax
call fcn.005641d0
mov eax, dword [esi + 0x144]
mov ecx, dword [esi + 0x140]
add eax, 0xa
push eax
push ecx
call fcn.00564c59
add esp, 0x14
test eax, eax
je 0x515c29
mov dword [esi + 0x140], eax
mov edx, dword [esi + 0x18c]
push 0
push 2
mov ecx, 0x8038
call fcn.0053f9b0
pop edi
pop esi
add esp, 0x18
ret
mov edx, dword [esi + 0x140]
push edx
call fcn.005635b5
mov eax, dword [esi + 0x158]
add esp, 4
test eax, eax
mov dword [esi + 0x140], 0
mov dword [esi + 0x144], 0
je 0x515c7e
mov ecx, dword [esi + 0x15c]
test ecx, ecx
je 0x515bb4
mov ecx, dword [0x59ca60]
test ecx, ecx
je 0x515cae
test eax, eax
mov edx, esi
push 0
je 0x515ca2
push 0x45
mov ecx, str.UDPWRITE
call fcn.00513350
pop edi
pop esi
add esp, 0x18
ret
push 0x3f
mov ecx, str.SOCKWRITE
call fcn.00513350
pop edi
pop esi
add esp, 0x18
ret