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

Disassembly:
push esi
mov esi, dword [ecx]
mov eax, dword [ecx + 0x10]
cmp esi, 3
ja case.default.0x59714b
jmp dword [esi*4 + 0x638ff0]
pop esi
jmp 0x5973c0
push str.Internal_state_machine_error
push 0x65f416
push eax
call fcn.0051ed60
add esp, 0xc
mov eax, 0x47
pop esi
ret
pop esi
jmp fcn.00597760
pop esi
jmp fcn.005979e0
push str.TFTP_finished
push 0x65f416
push eax
call fcn.0051ec50
add esp, 0xc
xor eax, eax
pop esi
ret
push ebp
push ebx
push edi
push esi
sub esp, 0x114
mov eax, dword [0x7c3824]
xor eax, esp
mov dword [esp + 0x110], eax
mov edi, dword [ecx + 0x10]
mov bl, byte [edi + 0xd14]
test bl, bl
mov eax, str.octet
mov ebp, str.netascii
cmove ebp, eax
cmp edx, 7
ja case.0x5973f7.1
mov esi, ecx
jmp dword [edx*4 + 0x639010]
mov eax, dword [esi + 0x18]
lea ecx, [eax + 1]
mov dword [esi + 0x18], ecx
cmp eax, dword [esi + 0x20]
jge 0x5974a4
lea ecx, [esi + 0x14c]
cmp byte [edi + 0x721], 0
je 0x5974b5
mov edx, 2
call fcn.00597d00
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x14c]
add ecx, 4
mov dword [eax + 0x130], ecx
mov ecx, dword [edi + 0xc64]
mov eax, dword [edi + 0xc60]
mov edx, eax
and edx, ecx
cmp edx, 0xffffffff
je 0x5974bf
push ecx
push eax
push edi
call fcn.00577cc0
add esp, 0xc
jmp 0x5974bf
push str.tftp_send_first:_internal_error
push edi
call fcn.0051ed60
add esp, 8
jmp 0x5974b1
mov ecx, esi
mov edx, 3
jmp 0x597528
mov ecx, esi
mov edx, 4
jmp 0x59749a
cmp byte [edi + 0x721], 0
je 0x597521
mov ecx, esi
mov edx, 6
call fcn.00597d60
jmp 0x59752d
mov dword [esi + 8], 0xffffff9e
mov dword [esi], 3
xor edi, edi
jmp 0x59752f
mov edx, 1
call fcn.00597d00
mov eax, dword [esi + 0x10]
mov eax, dword [eax + 0xc98]
add eax, 1
lea ecx, [esp + 8]
push 4
push 0
push ecx
push 0
push eax
push edi
call fcn.00589660
add esp, 0x18
mov ecx, edi
mov edi, eax
test eax, eax
jne 0x59752f
mov dword [esp], ecx
xor eax, eax
test bl, bl
sete al
mov edi, eax
mov eax, dword [esp + 8]
mov dword [esp + 4], eax
push eax
call fcn.005fef10
add esp, 4
mov ecx, dword [esi + 0x13c]
lea edx, [edi + edi*2]
add edx, ecx
add edx, 0xfffffff4
cmp eax, edx
jbe 0x59754a
push str.TFTP_file_name_too_long
jmp 0x597729
mov ecx, esi
mov edx, 6
call fcn.00597da0
mov edi, eax
mov ecx, dword [esp + 0x110]
xor ecx, esp
call fcn.005db451
mov eax, edi
add esp, 0x114
pop esi
pop edi
pop ebx
pop ebp
ret
mov eax, dword [esi + 0x14c]
add eax, 2
push 0
push ebp
push 0
push dword [esp + 0x10]
push str._s_c_s_c
push ecx
push eax
call fcn.005798c0
add esp, 0x1c
push dword [esp + 8]
call fcn.005fef10
add esp, 4
movzx ecx, bl
lea ecx, [ecx + ecx*2]
lea edi, [eax + ecx]
add edi, 9
mov dword [esp + 0xc], edi
mov ecx, dword [esp]
cmp byte [ecx + 0x707], 0
je 0x5975f2
mov ebx, dword [esp]
mov eax, dword [ebx + 0xc]
mov eax, dword [eax + 0x48]
push dword [eax + 0x10]
push dword [eax + 0x18]
push 0
push edi
push dword [esi + 0x14c]
push dword [esi + 0x14]
call dword [sym.imp.WSOCK32.dll_sendto]
cmp eax, edi
je 0x5975e0
call dword [sym.imp.WSOCK32.dll_WSAGetLastError]
lea ecx, [esp + 0x10]
push 0x100
push ecx
push eax
call fcn.00589dd0
add esp, 0xc
push eax
push 0x65f416
push ebx
call fcn.0051ed60
add esp, 0xc
push dword [esp + 8]
call dword [0x7c3880]
add esp, 4
jmp 0x5974b1
cmp byte [ecx + 0x721], 0
je 0x597628
mov eax, dword [ecx + 0xc60]
mov ecx, dword [ecx + 0xc64]
mov edx, eax
and edx, ecx
cmp edx, 0xffffffff
je 0x597628
lea edx, [esp + 0x10]
push ecx
push eax
push 0x664f1d
push 0x40
push edx
call fcn.005798c0
add esp, 0x14
jmp 0x59762f
mov word [esp + 0x10], 0x30
add edi, dword [esi + 0x14c]
lea edx, [esp + 0xc]
mov ecx, esi
push str.tsize
push edi
call fcn.00597d10
add esp, 8
mov edi, eax
test eax, eax
jne 0x59766f
mov eax, dword [esi + 0x14c]
add eax, dword [esp + 0xc]
lea edi, [esp + 0x10]
lea edx, [esp + 0xc]
mov ecx, esi
push edi
push eax
call fcn.00597d10
add esp, 8
mov edi, eax
lea ebx, [esp + 0x10]
push dword [esi + 0x140]
push 0x665741
push 0x40
push ebx
call fcn.005798c0
add esp, 0x10
test edi, edi
jne 0x5976cd
mov eax, dword [esi + 0x14c]
add eax, dword [esp + 0xc]
lea edx, [esp + 0xc]
mov ecx, esi
push str.blksize
push eax
call fcn.00597d10
add esp, 8
mov edi, eax
test eax, eax
jne 0x5976cd
mov eax, dword [esi + 0x14c]
add eax, dword [esp + 0xc]
lea edx, [esp + 0xc]
mov ecx, esi
push ebx
push eax
call fcn.00597d10
add esp, 8
mov edi, eax
push dword [esi + 0x1c]
push 0x665741
push 0x40
push ebx
call fcn.005798c0
add esp, 0x10
test edi, edi
jne 0x597724
mov eax, dword [esi + 0x14c]
add eax, dword [esp + 0xc]
lea edx, [esp + 0xc]
mov ecx, esi
push 0x65cf50
push eax
call fcn.00597d10
add esp, 8
test eax, eax
jne 0x597724
mov eax, dword [esi + 0x14c]
add eax, dword [esp + 0xc]
lea edx, [esp + 0xc]
mov ecx, esi
push ebx
push eax
call fcn.00597d10
add esp, 8
test eax, eax
je 0x59774c
push str.TFTP_buffer_too_small_for_options
push dword [esp + 4]
call fcn.0051ed60
add esp, 8
push dword [esp + 8]
call dword [0x7c3880]
add esp, 4
mov edi, 0x47
jmp 0x59752f
mov edi, dword [esp + 0xc]
jmp 0x597593