Function at 0x402caa
Capabilities:
Get common file path
Get disk information
Get file attributes
Get file size
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
xor ebx, ebx
cmp dword [ebp + 8], 3
push esi
push edi
mov dword [ebp - 4], ebx
jbe 0x402ccc
mov esi, dword [0x405614]
cmp esi, ebx
jne 0x402e0f
cmp dword [ebp + 8], 0xffffffff
je 0x402d3b
push ebx
push 0x1a
mov esi, 0x4053e8
push esi
push ebx
mov edi, esi
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathA]
test eax, eax
je 0x402cf7
cmp byte [0x4053e8], 0
je 0x402cf7
inc edi
cmp byte [edi], 0
jne 0x402cf1
xor ebx, ebx
cmp dword [ebp + 0xc], ebx
mov dword [edi], 0x4662535c
mov dword [edi + 4], 0x65646c6f
mov dword [edi + 0xc], 0x747874
jne 0x402d3e
cmp dword [ebp + 8], ebx
je 0x402d2b
cmp dword [ebp + 8], 1
mov dword [edi + 8], 0x2e465672
ja 0x402d3e
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret
mov dword [edi + 8], 0x2e435272
mov dword [edi + 0xc], 0x7a7874
jmp 0x402d24
mov esi, dword [ebp + 0xc]
push ebx
push 0x8000080
push 4
push ebx
push 1
push 0x80000000
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x402f72
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
test ebx, ebx
jg 0x402d7a
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402f72
lea eax, [ebx + 4]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov esi, eax
test esi, esi
je 0x402d6e
push 0
lea eax, [ebp - 8]
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 8]
and dword [eax + esi], 0
xor edi, edi
cmp byte [esi], 0
mov eax, esi
je 0x402de8
mov edx, eax
mov cl, byte [eax]
test cl, cl
je 0x402dd2
cmp cl, 0xa
je 0x402dc2
inc eax
jmp 0x402db4
cmp byte [eax - 1], 0xd
jne 0x402dce
and byte [eax - 1], 0
jmp 0x402dd1
and byte [eax], 0
inc eax
mov cl, byte [edx]
test cl, cl
je 0x402de3
cmp cl, 0x2d
je 0x402de2
cmp cl, 0x40
jle 0x402de3
inc edi
cmp byte [eax], 0
jne 0x402db2
shl edi, 2
push edi
push 0
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
test eax, eax
mov dword [0x405610], eax
je 0x402deb
cmp dword [ebp + 8], 0xffffffff
mov dword [0x405614], esi
je 0x402d24
xor ebx, ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp + 0xc], ebx
mov al, byte [esi]
test al, al
mov ecx, esi
mov dword [ebp - 0x10], ecx
je 0x402e29
inc ecx
cmp byte [ecx], 0
jne 0x402e20
mov dword [ebp - 0x10], ecx
cmp al, 0x21
jne 0x402e45
cmp dword [ebp - 4], ebx
mov dword [ebp + 0xc], ebx
jle 0x402f56
mov dword [ebp - 0xc], 0x20
jmp 0x402f56
cmp al, 0x2d
jne 0x402e55
mov eax, 0x800
xor edi, edi
jmp 0x402f2a
cmp al, 0x40
jne 0x402e64
lea eax, [esi + 1]
mov dword [ebp + 0xc], eax
jmp 0x402f56
jle 0x402f56
cmp dword [ebp + 0xc], ebx
jne 0x402e72
mov dword [ebp + 0xc], esi
sub ecx, esi
cmp ecx, 4
jle 0x402f50
movzx eax, word [esi]
cmp eax, 0x5c5c
mov dword [ebp - 8], eax
je 0x402ecb
lea eax, [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetDriveTypeA]
cmp eax, ebx
je 0x402f50
cmp eax, 4
je 0x402ecb
cmp eax, 5
je 0x402ecb
cmp eax, 2
je 0x402ecb
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, ebx
jl 0x402f50
test al, 0x10
jne 0x402ecb
mov eax, dword [ebp - 4]
lea edi, [eax + 0x8400]
xor eax, eax
jmp 0x402f2a
push 1
pop edi
xor edx, edx
lea eax, [esi + 1]
mov cl, byte [eax]
test cl, cl
je 0x402f00
cmp cl, 0x5c
jne 0x402ee3
inc edi
mov edx, eax
jmp 0x402efd
cmp cl, 0x81
jb 0x402efd
cmp cl, 0x9f
jbe 0x402ef7
cmp cl, 0xe0
jb 0x402efd
cmp cl, 0xfc
ja 0x402efd
inc eax
cmp byte [eax], 0
je 0x402f00
inc eax
jmp 0x402ed3
sub eax, edx
cmp eax, 1
jg 0x402f0d
mov word [edx], 0xa00
dec edi
cmp dword [edi*4 + 0x405648], ebx
lea edi, [edi*4 + 0x405648]
jne 0x402f25
call dword [sym.imp.USER32.dll_CreatePopupMenu]
mov dword [edi], eax
mov edi, dword [edi]
push 0x10
pop eax
push dword [ebp + 0xc]
or eax, dword [ebp - 0xc]
push edi
push eax
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_AppendMenuA]
test eax, eax
je 0x402f50
mov ecx, dword [ebp - 4]
mov eax, dword [0x405610]
inc dword [ebp - 4]
mov dword [ebp - 0xc], ebx
mov dword [eax + ecx*4], esi
mov ecx, dword [ebp - 0x10]
mov dword [ebp + 0xc], ebx
cmp dword [ecx], ebx
je 0x402f69
lea esi, [ecx + 1]
cmp byte [esi], 0xa
jne 0x402e15
inc esi
jmp 0x402f5d
cmp dword [ebp - 4], ebx
jg 0x402d24
push 0x40508b
push 0x8310
push 1
push dword [ebp + 8]
call dword [sym.imp.USER32.dll_AppendMenuA]
xor eax, eax
jmp 0x402d26