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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x50
mov eax, dword [0x5f1014]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, str.octet
mov eax, dword [esi + 0x10]
mov ebx, dword [eax]
mov eax, str.netascii
cmp byte [ebx + 0x4e4], 0
cmovne edi, eax
mov eax, dword [ebp + 0xc]
cmp eax, 7
ja case.0x51679b.1
jmp dword [eax*4 + 0x516adc]
inc dword [esi + 0x18]
mov eax, dword [esi + 0x18]
cmp eax, dword [esi + 0x20]
jle 0x5167cd
mov dword [esi + 8], 0xffffff9e
pop edi
mov dword [esi], 3
xor eax, eax
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e389c
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0x4f2], 0
lea eax, [esi + 0x160]
je 0x51681d
push 2
push eax
call fcn.00515f20
mov eax, dword [esi + 0x10]
add esp, 8
mov ecx, dword [esi + 0x160]
add ecx, 4
mov eax, dword [eax]
mov dword [eax + 0x148], ecx
mov edx, dword [ebx + 0x4b40]
mov eax, edx
mov ecx, dword [ebx + 0x4b44]
and eax, ecx
cmp eax, 0xffffffff
je 0x516828
push ecx
push edx
push ebx
call fcn.00502df0
add esp, 0xc
jmp 0x516828
push 1
push eax
call fcn.00515f20
add esp, 8
push 0
push 0
lea eax, [ebp - 0x48]
push eax
mov eax, dword [esi + 0x10]
push 0
mov eax, dword [eax]
mov eax, dword [eax + 0x4b1c]
inc eax
push eax
push ebx
call fcn.00517eb0
add esp, 0x18
mov dword [ebp - 0x50], eax
test eax, eax
jne 0x516aca
mov ecx, dword [ebp - 0x48]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x516860
sub ecx, edx
mov edx, edi
lea eax, [edx + 1]
mov dword [ebp - 0x4c], eax
mov al, byte [edx]
inc edx
test al, al
jne 0x516871
sub edx, dword [ebp - 0x4c]
mov eax, dword [esi + 0x154]
sub eax, edx
sub eax, 4
cmp ecx, eax
jbe 0x5168b7
push str.TFTP_file_name_too_long_n
push ebx
call fcn.004f92f0
push dword [ebp - 0x48]
call dword [0x5f1044]
add esp, 0xc
mov eax, 0x47
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e389c
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x160]
push 0
push edi
push 0
push dword [ebp - 0x48]
add eax, 2
push str._s_c_s_c
push dword [esi + 0x154]
push eax
call fcn.00505240
mov ecx, dword [ebp - 0x48]
add esp, 0x1c
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5168e2
sub ecx, edx
lea edx, [edi + 1]
nop
mov al, byte [edi]
inc edi
test al, al
jne 0x5168f0
sub edi, edx
add edi, 4
add edi, ecx
cmp byte [ebx + 0x21c], al
jne 0x5169fd
cmp byte [ebx + 0x4f2], al
je 0x51693e
mov edx, dword [ebx + 0x4b40]
mov eax, edx
mov ecx, dword [ebx + 0x4b44]
and eax, ecx
cmp eax, 0xffffffff
je 0x51693e
push ecx
push edx
push str._I64d
lea eax, [ebp - 0x44]
push 0x40
push eax
call fcn.00505240
add esp, 0x14
jmp 0x516947
mov eax, 0x30
mov word [ebp - 0x44], ax
mov eax, dword [esi + 0x160]
push str.tsize
add eax, edi
push eax
push edi
push esi
call fcn.00515fc0
add edi, eax
lea eax, [ebp - 0x44]
push eax
mov eax, dword [esi + 0x160]
add eax, edi
push eax
push edi
push esi
call fcn.00515fc0
push dword [esi + 0x158]
add edi, eax
lea eax, [ebp - 0x44]
push 0x5e1a38
push 0x40
push eax
call fcn.00505240
mov eax, dword [esi + 0x160]
push str.blksize
add eax, edi
push eax
push edi
push esi
call fcn.00515fc0
add esp, 0x40
add edi, eax
lea eax, [ebp - 0x44]
push eax
mov eax, dword [esi + 0x160]
add eax, edi
push eax
push edi
push esi
call fcn.00515fc0
push dword [esi + 0x1c]
add edi, eax
lea eax, [ebp - 0x44]
push 0x5e1a38
push 0x40
push eax
call fcn.00505240
mov eax, dword [esi + 0x160]
push str.timeout
add eax, edi
push eax
push edi
push esi
call fcn.00515fc0
add edi, eax
lea eax, [ebp - 0x44]
push eax
mov eax, dword [esi + 0x160]
add eax, edi
push eax
push edi
push esi
call fcn.00515fc0
add esp, 0x40
add edi, eax
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x54]
push dword [eax + 0x10]
push dword [eax + 0x18]
push 0
push edi
push dword [esi + 0x160]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
cmp eax, edi
je 0x516a3d
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [esi + 0x10]
call fcn.00507530
push eax
push 0x5e19f0
push ebx
call fcn.004f92f0
add esp, 0x14
push dword [ebp - 0x48]
call dword [0x5f1044]
mov eax, dword [ebp - 0x50]
add esp, 4
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e389c
mov esp, ebp
pop ebp
ret
cmp byte [ebx + 0x4f2], 0
push 6
push esi
je 0x516aa1
call fcn.00515f80
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e389c
mov esp, ebp
pop ebp
ret
push 4
push esi
call fcn.00515f80
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e389c
mov esp, ebp
pop ebp
ret
push 3
push esi
call fcn.00515f40
add esp, 8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004e389c
mov esp, ebp
pop ebp
ret
push str.tftp_send_first:_internal_error
push ebx
call fcn.004f92f0
add esp, 8
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004e389c
mov esp, ebp
pop ebp
ret