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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffd8
push ebx
push esi
push edi
mov esi, dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.00507220
mov ebx, eax
test ebx, ebx
je 0x509cab
cmp dword [ebx + 0x14c], 2
jne 0x509cab
mov eax, esi
shr eax, 0x10
and ax, 0xffff
test ax, ax
je 0x509a9d
movzx edx, ax
mov dword [ebx + 0x184], edx
cmp dword [0x56acb4], 0
je 0x509a84
cmp dword [ebx + 0x158], 0
je 0x509a75
push 3
push 0x44
push ebx
push 0x56bfa0
call fcn.005072cb
jmp 0x509a84
push 3
push 0x3f
push ebx
push 0x56bfaa
call fcn.005072cb
push ebx
call fcn.005071c0
test eax, eax
je 0x509cab
push ebx
call fcn.005070ff
jmp 0x509cab
cmp dword [ebx + 0x140], 0
je 0x509cab
mov esi, dword [ebx + 0x144]
cmp esi, 0x2000
jle 0x509abd
mov esi, 0x2000
cmp dword [ebx + 0x158], 0
je 0x509b51
lea eax, [ebp - 8]
mov dword [ebp - 0x1c], eax
lea edx, [ebx + 0x160]
mov dword [eax], edx
xor ecx, ecx
mov dword [eax + 4], ecx
mov word [ebp - 0x1e], 4
mov word [ebp - 0x20], 2
lea edi, [ebp - 0x28]
push 0x10
push 0
lea eax, [ebp - 0x18]
push eax
call fcn.0054c150
add esp, 0xc
mov word [ebp - 0x18], 2
movsx edx, word [edi + 0xa]
push edx
mov ecx, dword [edi + 0xc]
push dword [ecx]
lea eax, [ebp - 0x14]
push eax
call fcn.0054c0e0
add esp, 0xc
mov dx, word [ebx + 0x164]
push edx
call sub.WSOCK32.dll_htons
mov word [ebp - 0x16], ax
mov ecx, dword [edi + 0xc]
mov eax, dword [ecx]
mov edx, dword [eax]
mov dword [ebp - 0x14], edx
push 0x10
lea ecx, [ebp - 0x18]
push ecx
push 0
push esi
push dword [ebx + 0x140]
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_sendto
mov esi, eax
jmp 0x509b67
push 0
push esi
push dword [ebx + 0x140]
push dword [ebx + 0x18c]
call sub.WSOCK32.dll_send
mov esi, eax
cmp esi, 0xffffffff
jne 0x509bcd
call sub.WSOCK32.dll_WSAGetLastError
cmp eax, 0x2733
je 0x509cab
mov dword [ebx + 0x184], eax
cmp dword [0x56acb4], 0
je 0x509bb4
cmp dword [ebx + 0x158], 0
je 0x509ba5
push 3
push 0x44
push ebx
push 0x56bfb5
call fcn.005072cb
jmp 0x509bb4
push 3
push 0x3f
push ebx
push 0x56bfbf
call fcn.005072cb
push ebx
call fcn.005071c0
test eax, eax
je 0x509cab
push ebx
call fcn.005070ff
jmp 0x509cab
push 0
call fcn.0055aa70
pop ecx
mov dword [ebx + 0x17c], eax
test esi, esi
jle 0x509c43
add dword [ebx + 0x170], esi
cmp esi, dword [ebx + 0x144]
jge 0x509c43
sub dword [ebx + 0x144], esi
push dword [ebx + 0x144]
mov eax, dword [ebx + 0x140]
add esi, eax
push esi
push eax
call fcn.0054c104
add esp, 0xc
mov edx, dword [ebx + 0x144]
add edx, 0xa
push edx
push dword [ebx + 0x140]
call fcn.00558280
add esp, 8
test eax, eax
je 0x509c2d
mov dword [ebx + 0x140], eax
push 0
push 2
push dword [ebx + 0x18c]
push 0x8038
call fcn.00526a8c
jmp 0x509cab
push dword [ebx + 0x140]
call fcn.00557ca0
pop ecx
xor ecx, ecx
mov dword [ebx + 0x140], ecx
xor eax, eax
mov dword [ebx + 0x144], eax
cmp dword [ebx + 0x158], 0
je 0x509c79
cmp dword [ebx + 0x15c], 0
jne 0x509c79
push ebx
call fcn.005070ff
jmp 0x509cab
cmp dword [0x56acb4], 0
je 0x509cab
cmp dword [ebx + 0x158], 0
je 0x509c9c
push 0
push 0x44
push ebx
push str.UDPWRITE
call fcn.005072cb
jmp 0x509cab
push 0
push 0x3f
push ebx
push str.SOCKWRITE
call fcn.005072cb
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8