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

Disassembly:
sub esp, 0x14c
mov eax, dword [0x1008602c]
xor eax, esp
mov dword [esp + 0x148], eax
push ebx
push ebp
push esi
mov esi, dword [esp + 0x15c]
xor ebx, ebx
push edi
mov eax, str.netascii
mov edi, str.octet
mov ebp, dword [esi + 0x10]
cmp byte [ebp + 0xd04], bl
cmovne edi, eax
mov eax, dword [esp + 0x164]
cmp eax, 7
ja case.0x1003fda7.1
jmp dword [eax*4 + 0x100401e8]
inc dword [esi + 0x18]
mov eax, dword [esi + 0x18]
cmp eax, dword [esi + 0x20]
jle 0x1003fdcd
mov dword [esi + 8], 0xffffff9e
xor eax, eax
mov dword [esi], 3
jmp 0x100401cf
mov eax, dword [esi + 0x14c]
cmp byte [ebp + 0x711], bl
mov byte [eax], bl
mov eax, dword [esi + 0x14c]
je 0x1003fe1b
mov byte [eax + 1], 2
mov eax, dword [esi + 0x10]
mov ecx, dword [esi + 0x14c]
add ecx, 4
mov dword [eax + 0x130], ecx
mov edx, dword [ebp + 0xc50]
mov eax, edx
mov ecx, dword [ebp + 0xc54]
and eax, ecx
cmp eax, 0xffffffff
je 0x1003fe1f
push ecx
push edx
push ebp
call fcn.100262e0
add esp, 0xc
jmp 0x1003fe1f
mov byte [eax + 1], 1
push 4
push 0
lea eax, [esp + 0x18]
push eax
mov eax, dword [esi + 0x10]
push 0
mov eax, dword [eax + 0xc88]
inc eax
push eax
push ebp
call fcn.10030690
mov ebx, eax
add esp, 0x18
test ebx, ebx
jne 0x100401cd
mov ecx, dword [esp + 0x10]
lea edx, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x1003fe50
sub ecx, edx
mov edx, edi
lea eax, [edx + 1]
mov dword [esp + 0x14], eax
mov al, byte [edx]
inc edx
test al, al
jne 0x1003fe62
sub edx, dword [esp + 0x14]
mov eax, dword [esi + 0x13c]
sub eax, edx
sub eax, 4
cmp ecx, eax
jbe 0x1003fe9e
push str.TFTP_file_name_too_long
push ebp
call fcn.10017bb0
push dword [esp + 0x18]
call dword [0x10086004]
add esp, 0xc
mov eax, 0x47
jmp 0x100401cf
mov eax, dword [esi + 0x14c]
push 0
push edi
push 0
push dword [esp + 0x1c]
add eax, 2
push str._s_c_s_c
push dword [esi + 0x13c]
push eax
call fcn.10028fc0
mov ecx, dword [esp + 0x2c]
add esp, 0x1c
lea edx, [ecx + 1]
nop dword [eax + eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x1003fed0
sub ecx, edx
lea edx, [edi + 1]
nop dword [eax]
mov al, byte [edi]
inc edi
test al, al
jne 0x1003fee0
sub edi, edx
add edi, 4
add edi, ecx
cmp byte [ebp + 0x6f7], al
jne 0x10040135
cmp byte [ebp + 0x711], al
je 0x1003ff2f
mov edx, dword [ebp + 0xc50]
mov eax, edx
mov ecx, dword [ebp + 0xc54]
and eax, ecx
cmp eax, 0xffffffff
je 0x1003ff2f
push ecx
push edx
push str._I64d
lea eax, [esp + 0x24]
push 0x40
push eax
call fcn.10028fc0
add esp, 0x14
jmp 0x1003ff39
mov eax, 0x30
mov word [esp + 0x18], ax
lea ebx, [edi + 6]
cmp ebx, dword [esi + 0x13c]
jbe 0x1003ff7c
push dword [esi + 0x140]
lea eax, [esp + 0x1c]
push 0x10071870
push 0x40
push eax
call fcn.10028fc0
push dword [esi + 0x1c]
lea eax, [esp + 0x2c]
push 0x10071870
push 0x40
push eax
call fcn.10028fc0
add esp, 0x20
push str.TFTP_buffer_too_small_for_options
jmp 0x1003fe81
mov ecx, dword [esi + 0x14c]
mov edx, str.tsize
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 0x1003ff90
lea ecx, [esp + 0x18]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x1003ffa5
sub ecx, edx
lea eax, [ebx + 1]
add eax, ecx
cmp eax, dword [esi + 0x13c]
ja 0x1003ff44
mov ecx, dword [esi + 0x14c]
lea edx, [esp + 0x18]
add ecx, ebx
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x1003ffc7
lea ecx, [esp + 0x18]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x1003ffe0
push dword [esi + 0x140]
lea eax, [esp + 0x1c]
sub ecx, edx
push 0x10071870
push 0x40
lea edi, [ebx + 1]
push eax
add edi, ecx
call fcn.10028fc0
lea ebx, [edi + 8]
add esp, 0x10
cmp ebx, dword [esi + 0x13c]
ja 0x1004004b
mov ecx, dword [esi + 0x14c]
mov edx, str.blksize
add ecx, edi
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x10040020
lea ecx, [esp + 0x18]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040035
sub ecx, edx
lea eax, [ebx + 1]
add eax, ecx
cmp eax, dword [esi + 0x13c]
jbe 0x1004006c
push dword [esi + 0x1c]
lea eax, [esp + 0x1c]
push 0x10071870
push 0x40
push eax
call fcn.10028fc0
add esp, 0x10
push str.TFTP_buffer_too_small_for_options
jmp 0x1003fe81
mov ecx, dword [esi + 0x14c]
lea edx, [esp + 0x18]
add ecx, ebx
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x10040078
lea ecx, [esp + 0x18]
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040090
push dword [esi + 0x1c]
lea eax, [esp + 0x1c]
sub ecx, edx
push 0x10071870
push 0x40
lea edi, [ebx + 1]
push eax
add edi, ecx
call fcn.10028fc0
lea ebx, [edi + 8]
add esp, 0x10
cmp ebx, dword [esi + 0x13c]
ja 0x1003ff72
mov ecx, dword [esi + 0x14c]
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 0x100400d1
lea ecx, [esp + 0x18]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x100400e6
sub ecx, edx
lea eax, [ebx + 1]
add eax, ecx
cmp eax, dword [esi + 0x13c]
ja 0x1003ff72
mov ecx, dword [esi + 0x14c]
lea edx, [esp + 0x18]
add ecx, ebx
nop dword [eax]
mov al, byte [edx]
lea edx, [edx + 1]
mov byte [ecx], al
lea ecx, [ecx + 1]
test al, al
jne 0x10040110
lea ecx, [esp + 0x18]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x10040125
sub ecx, edx
lea edi, [ebx + 1]
add edi, ecx
xor ebx, ebx
mov eax, dword [ebp + 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.WS2_32.dll_sendto]
cmp eax, edi
je 0x1004017c
push 0x100
lea eax, [esp + 0x5c]
push eax
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
call fcn.1002a9c0
push eax
push 0x1007849c
push ebp
call fcn.10017bb0
add esp, 0x18
push dword [esp + 0x10]
call dword [0x10086004]
add esp, 4
jmp 0x100401cd
push 6
push esi
cmp byte [ebp + 0x711], bl
je 0x100401ae
call fcn.1003f560
mov ebx, eax
jmp 0x100401ca
push 4
push esi
call fcn.1003f560
mov ebx, eax
jmp 0x100401ca
push 3
push esi
call fcn.1003f520
mov ebx, eax
jmp 0x100401ca
mov dword [esi], 3
jmp 0x100401cd
push str.tftp_send_first:_internal_error
push ebp
call fcn.10017bb0
add esp, 8
mov eax, ebx
mov ecx, dword [esp + 0x158]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.10052640
add esp, 0x14c
ret
mov eax, dword [esp + 4]
mov edx, dword [eax]
mov ecx, dword [eax + 0x10]
cmp edx, 3
ja case.default.0x1004031e
jmp dword [edx*4 + 0x10040370]
mov dword [esp + 4], eax
jmp 0x1003fd60
mov dword [esp + 4], eax
jmp fcn.1003fa10
mov dword [esp + 4], eax
jmp fcn.100404b0
push str.TFTP_finished
push 0x10071454
push ecx
call fcn.10017c70
add esp, 0xc
xor eax, eax
ret
push str.Internal_state_machine_error
push 0x1007849c
push ecx
call fcn.10017bb0
add esp, 0xc
mov eax, 0x47
ret