Function at 0x40337d
Capabilities:
Check if file exists
Get disk information
Get file attributes
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [0x406804]
push ebx
xor ebx, ebx
push esi
cmp eax, 0x100
push edi
mov dword [ebp - 4], ebx
je 0x4035eb
mov edi, dword [ebp + 8]
cmp edi, ebx
je 0x4033aa
cmp eax, ebx
jne 0x403437
push ebx
push 0x8000080
push 4
push ebx
push 1
push 0xc0000000
push ebx
push ebx
call fcn.00403063
pop ecx
pop ecx
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
mov dword [ebp - 0xc], esi
je 0x4035eb
cmp dword [0x406804], ebx
jne 0x403437
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
cmp eax, ebx
mov dword [ebp + 8], eax
je 0x403420
add eax, 2
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
cmp eax, ebx
mov dword [0x406804], eax
je 0x403420
lea ecx, [ebp + 8]
push ebx
push ecx
push dword [ebp + 8]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebp + 8]
mov ecx, dword [0x406804]
mov word [ecx + eax], bx
cmp edi, ebx
je 0x40342d
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x403437
push ebx
push ebx
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp edi, ebx
jne 0x403559
mov esi, 0x40674c
lea edi, [ebp - 0x28]
mov ecx, dword [esi - 4]
cmp ecx, ebx
je 0x4034c7
test word [esi], 0x1c0
mov dword [edi], 1
jne 0x4034b9
and byte [ecx], 0xdf
mov bl, byte [ecx]
cmp bl, 0x43
jl 0x4034b7
test bl, bl
mov eax, ecx
je 0x403471
inc eax
cmp byte [eax], 0
jne 0x40346b
sub eax, ecx
cmp eax, 3
jbe 0x4034b7
cmp eax, 0x48
ja 0x4034b7
mov edx, dword [esi]
mov dword [edi], eax
and edx, 0x23e
cmp edx, 0x3e
jge 0x4034b1
test byte [0x406801], 2
je 0x40349a
cmp bl, 0x5c
je 0x4034b3
lea edx, [ebp + 8]
push 0
inc eax
push edx
push eax
push ecx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
add dword [ebp - 4], eax
jmp 0x4034b7
jle 0x4034b7
or dword [ebp - 4], 1
xor ebx, ebx
add esi, 8
add edi, 4
cmp esi, 0x406774
jbe 0x403447
cmp dword [ebp - 4], ebx
je 0x40354b
mov edi, dword [0x406804]
cmp edi, ebx
je 0x403542
mov al, byte [edi]
test al, al
je 0x403542
mov esi, edi
mov dword [ebp - 0x10], esi
inc esi
cmp byte [esi], 0
jne 0x4034e1
mov dword [ebp - 0x10], esi
sub esi, edi
mov dword [ebp - 8], 0x406748
lea ebx, [ebp - 0x28]
mov eax, dword [ebp - 8]
mov eax, dword [eax]
test eax, eax
je 0x40351f
cmp dword [ebx], esi
jne 0x40350f
push edi
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiA]
test eax, eax
je 0x40353a
add dword [ebp - 8], 8
add ebx, 4
cmp dword [ebp - 8], 0x406770
jbe 0x4034f6
lea eax, [ebp + 8]
push 0
inc esi
push eax
push esi
push edi
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_WriteFile]
add dword [ebp - 4], eax
cmp dword [ebp - 4], 0x48
jge 0x403542
mov eax, dword [ebp - 0x10]
lea edi, [eax + 1]
jmp 0x4034d6
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x4035eb
mov esi, dword [0x406804]
cmp esi, ebx
mov ebx, dword [sym.imp.USER32.dll_AppendMenuA]
je 0x4035dc
mov al, byte [esi]
test al, al
je 0x4035dc
cmp al, 0x5c
je 0x40359b
movzx eax, word [esi]
mov dword [ebp + 8], eax
lea eax, [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, 2
jb 0x4035c9
cmp eax, 4
je 0x4035a4
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x4035a4
jmp 0x4035c9
test byte [0x406801], 2
jne 0x4035c9
mov eax, dword [ebp - 4]
push esi
add eax, 0x8700
push eax
push 0
push edi
call ebx
add dword [ebp - 4], eax
cmp dword [ebp - 4], 0x28
jge 0x4035d6
mov eax, dword [0x406848]
add eax, 0xfffffffd
cmp dword [ebp - 4], eax
jge 0x4035d6
mov al, byte [esi]
inc esi
test al, al
jne 0x4035c9
mov al, byte [esi]
test al, al
jne 0x40356f
cmp dword [ebp - 4], 0
jne 0x4035eb
push str._None
push 0x8310
push 1
push edi
call ebx
pop edi
pop esi
pop ebx
leave
ret