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

Disassembly:
sub esp, 0x50
mov eax, dword [0x7ec06c]
xor eax, esp
mov dword [esp + 0x4c], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x60]
xor ebp, ebp
push edi
mov edi, str.octet
mov eax, dword [esi + 0x10]
mov ebx, dword [eax]
mov eax, str.netascii
mov dword [esp + 0x14], ebx
cmp byte [ebx + 0x4fb], 0
cmovne edi, eax
mov eax, dword [esp + 0x68]
cmp eax, 7
ja case.0x599082.1
jmp dword [eax*4 + 0x5994c0]
inc dword [esi + 0x18]
mov eax, dword [esi + 0x18]
cmp eax, dword [esi + 0x20]
jle 0x5990b6
pop edi
mov dword [esi + 8], 0xffffff9e
xor eax, eax
mov dword [esi], 3
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0053bd3e
add esp, 0x50
ret
mov eax, dword [esi + 0x160]
cmp byte [ebx + 0x509], 0
mov byte [eax], 0
mov eax, dword [esi + 0x160]
je 0x599108
mov byte [eax + 1], 2
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x160]
add ecx, 4
mov eax, dword [eax]
mov dword [eax + 0x148], ecx
mov edx, dword [ebx + 0xbd0]
mov eax, edx
mov ecx, dword [ebx + 0xbd4]
and eax, ecx
cmp eax, 0xffffffff
je 0x59910c
push ecx
push edx
push ebx
call fcn.005ad900
add esp, 0xc
jmp 0x59910c
mov byte [eax + 1], 1
push 0
push 0
lea eax, [esp + 0x18]
push eax
mov eax, dword [esi + 0x10]
push 0
mov eax, dword [eax]
mov eax, dword [eax + 0xbac]
inc eax
push eax
push ebx
call fcn.005a9530
add esp, 0x18
mov dword [esp + 0x18], eax
test eax, eax
jne 0x5994aa
mov ebp, dword [esp + 0x10]
mov ecx, ebp
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x599142
sub ecx, edx
mov edx, edi
lea ebx, [edx + 1]
mov al, byte [edx]
inc edx
test al, al
jne 0x599150
sub edx, ebx
mov ebx, dword [esi + 0x154]
mov eax, ebx
sub eax, edx
sub eax, 4
cmp ecx, eax
jbe 0x59919e
mov ebp, dword [esp + 0x14]
push str.TFTP_file_name_too_long_n
push ebp
call fcn.0058e2d0
push dword [esp + 0x18]
call dword [0x7eca90]
add esp, 0xc
mov eax, 0x47
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0053bd3e
add esp, 0x50
ret
mov eax, dword [esi + 0x160]
push 0
push edi
push 0
push ebp
push str._s_c_s_c
add eax, 2
push ebx
push eax
call fcn.0058fda0
mov ecx, dword [esp + 0x2c]
add esp, 0x1c
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5991c3
sub ecx, edx
lea edx, [edi + 1]
nop
mov al, byte [edi]
inc edi
test al, al
jne 0x5991d0
mov ebp, dword [esp + 0x14]
sub edi, edx
add edi, 4
add edi, ecx
cmp byte [ebp + 0x220], al
jne 0x5993ec
cmp byte [ebp + 0x509], al
je 0x599223
mov edx, dword [ebp + 0xbd0]
mov eax, edx
mov ecx, dword [ebp + 0xbd4]
and eax, ecx
cmp eax, 0xffffffff
je 0x599223
push ecx
push edx
push str._I64d
lea eax, [esp + 0x28]
push 0x40
push eax
call fcn.0058fda0
add esp, 0x14
jmp 0x59922d
mov eax, 0x30
mov word [esp + 0x1c], ax
mov edx, dword [esi + 0x154]
lea eax, [edi + 6]
cmp eax, edx
jbe 0x59923e
xor eax, eax
jmp 0x599269
mov ecx, dword [esi + 0x160]
mov edx, str.tsize
add ecx, edi
nop dword [eax + eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x599250
mov edx, dword [esi + 0x154]
mov eax, 6
lea ecx, [esp + 0x1c]
add edi, eax
lea ebx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x599272
sub ecx, ebx
lea eax, [edi + 1]
add eax, ecx
cmp eax, edx
ja 0x5992b1
mov ecx, dword [esi + 0x160]
lea edx, [esp + 0x1c]
add ecx, edi
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x599290
lea ecx, [esp + 0x1c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5992a5
sub ecx, edx
inc edi
add edi, ecx
push dword [esi + 0x158]
lea eax, [esp + 0x20]
push 0x7862f8
push 0x40
push eax
call fcn.0058fda0
mov edx, dword [esi + 0x154]
lea eax, [edi + 8]
add esp, 0x10
cmp eax, edx
jbe 0x5992dc
xor eax, eax
jmp 0x599309
mov ecx, dword [esi + 0x160]
mov edx, str.blksize
add ecx, edi
nop dword [eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x5992f0
mov edx, dword [esi + 0x154]
mov eax, 8
lea ecx, [esp + 0x1c]
add edi, eax
lea ebx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x599312
sub ecx, ebx
lea eax, [edi + 1]
add eax, ecx
cmp eax, edx
ja 0x599351
mov ecx, dword [esi + 0x160]
lea edx, [esp + 0x1c]
add ecx, edi
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x599330
lea ecx, [esp + 0x1c]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x599345
sub ecx, edx
inc edi
add edi, ecx
push dword [esi + 0x1c]
lea eax, [esp + 0x20]
push 0x7862f8
push 0x40
push eax
call fcn.0058fda0
mov edx, dword [esi + 0x154]
lea eax, [edi + 8]
add esp, 0x10
cmp eax, edx
jbe 0x599379
xor eax, eax
jmp 0x59939f
mov ecx, dword [esi + 0x160]
mov edx, str.timeout
add ecx, edi
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x599386
mov edx, dword [esi + 0x154]
mov eax, 8
lea ecx, [esp + 0x1c]
add edi, eax
lea ebx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5993a8
sub ecx, ebx
lea eax, [edi + 1]
add eax, ecx
cmp eax, edx
ja 0x5993ec
mov ecx, dword [esi + 0x160]
lea edx, [esp + 0x1c]
add ecx, edi
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x5993c6
lea ecx, [esp + 0x1c]
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x5993e0
sub ecx, edx
inc edi
add edi, ecx
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0x50]
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 0x59942c
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push dword [esi + 0x10]
call fcn.005b6f10
push eax
push 0x782000
push ebp
call fcn.0058e2d0
add esp, 0x14
push dword [esp + 0x10]
call dword [0x7eca90]
mov ebp, dword [esp + 0x1c]
add esp, 4
mov eax, ebp
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0053bd3e
add esp, 0x50
ret
cmp byte [ebx + 0x509], 0
push 6
push esi
je 0x599476
call fcn.005988e0
mov ebp, eax
jmp 0x5994a5
push 4
push esi
call fcn.005988e0
mov ebp, eax
jmp 0x5994a5
push 3
push esi
call fcn.005988a0
mov ebp, eax
jmp 0x5994a5
pop edi
mov dword [esi], 3
mov eax, ebp
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4c]
xor ecx, esp
call fcn.0053bd3e
add esp, 0x50
ret
push str.tftp_send_first:_internal_error
push ebx
call fcn.0058e2d0
add esp, 8
mov eax, ebp
mov ecx, dword [esp + 0x5c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.0053bd3e
add esp, 0x50
ret
mov ecx, dword [esp + 4]
mov eax, dword [ecx + 0x10]
mov edx, dword [ecx]
mov eax, dword [eax]
cmp edx, 3
ja case.default.0x599680
jmp dword [edx*4 + 0x5996d4]
mov dword [esp + 4], ecx
jmp 0x599040
mov dword [esp + 4], ecx
jmp fcn.00598db0
mov dword [esp + 4], ecx
jmp fcn.005997f0
push str.TFTP_finished
push 0x789f80
push eax
call fcn.0058e3b0
add esp, 0xc
xor eax, eax
ret
push str.Internal_state_machine_error
push 0x782000
push eax
call fcn.0058e2d0
add esp, 0xc
mov eax, 0x47
ret