Function at 0x4064dc
Capabilities:
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe0
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x1c], eax
mov ebx, 0x409ac8
mov esi, 0x409af4
mov edi, 0x409a96
xor eax, eax
push ebp
push 0x406c5d
push dword fs:[eax]
mov dword fs:[eax], esp
mov byte [ebp - 1], 0
mov byte [0x409a85], 0
mov byte [0x409a86], 0
mov byte [edi], 0
mov eax, 0x105
call fcn.004023c8
mov dword [0x409a7c], eax
mov eax, 0x105
call fcn.004023c8
mov dword [0x409a80], eax
mov edx, dword [0x40807c]
lea eax, [ebp - 0x18]
call fcn.00402ccc
lea eax, [ebp - 0x18]
mov edx, 0x406c78
call fcn.00402da4
mov eax, dword [ebp - 0x18]
call fcn.00402f10
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
mov edx, 0x3e
call fcn.004039f4
mov eax, 0x40807c
mov edx, dword [ebp - 0x10]
call fcn.00402d54
push 0x409568
push pe_nt_image_headers32
call sub.kernel32.dll_GetCurrentDirectoryA
push 0x7f
push 0x4094e8
call sub.kernel32.dll_GetSystemDirectoryA
mov byte [ebp - 0xa], al
mov eax, dword [0x409494]
push eax
push 0xfe
call sub.kernel32.dll_GetTempPathA
dec eax
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x4065d4
lea eax, [ebp - 0x18]
mov edx, dword [0x409494]
call fcn.00402d54
mov edx, dword [ebp - 0x18]
mov eax, 0x406c84
call fcn.00402f90
test eax, eax
jle 0x4065f2
xor ecx, ecx
mov cl, byte [ebp - 0xa]
inc ecx
mov edx, dword [0x409494]
mov eax, 0x4094e8
call fcn.00402500
xor eax, eax
mov al, byte [ebp - 0xa]
mov dword [ebp - 8], eax
mov eax, dword [0x409494]
call fcn.00404074
push esi
push edi
mov esi, 0x406c88
mov edi, 0x409498
mov ecx, 0x14
rep movsd dword es:[edi], dword [esi]
pop edi
pop esi
mov eax, dword [0x409494]
mov edx, dword [ebp - 8]
lea edx, [eax + edx]
mov eax, 0x409498
mov ecx, 0xd
call fcn.00402500
mov eax, dword [0x409494]
mov edx, dword [ebp - 8]
mov byte [eax + edx + 0xe], 0
push esi
push edi
mov esi, 0x406cd8
mov edi, 0x409498
mov ecx, 0x14
rep movsd dword es:[edi], dword [esi]
pop edi
pop esi
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
lea edx, [ebp - 0x18]
xor eax, eax
call fcn.004025ac
mov eax, dword [ebp - 0x18]
call fcn.00402f10
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [esi], eax
cmp dword [esi], 0xffffffff
jne 0x4066a5
push 0x10
mov eax, dword [0x4081f4]
push eax
lea edx, [ebp - 0x18]
xor eax, eax
call fcn.004025ac
mov eax, dword [ebp - 0x18]
call fcn.00402f10
push eax
push 0
call sub.user32.dll_MessageBoxA_1
jmp 0x406c42
xor edx, edx
mov eax, 0x8a00
call fcn.00403cf8
push 0
lea eax, [ebp - 8]
push eax
push 3
lea eax, [ebp - 4]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
cmp dword [ebp - 8], 3
jne 0x40699a
lea eax, [ebp - 0x18]
lea edx, [ebp - 4]
mov ecx, 3
call fcn.00402d84
mov eax, dword [ebp - 0x18]
mov edx, 0x406d30
call fcn.00402e5c
jne 0x40699a
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x409a87
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 9]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0xa]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x409a88
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x409a94
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 4
push 0x409a90
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 4
push 0x409a8c
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x409a89
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x409a8a
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
push 0x409aa8
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 1
lea eax, [ebp - 0x11]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
push 0
lea eax, [ebp - 8]
push eax
push 4
push 0x409aa4
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
cmp byte [ebp - 9], 0
seta byte [0x409a86]
cmp byte [0x409a88], 0
je 0x406822
call fcn.00403a34
test al, al
jne 0x406822
push 0x10
mov eax, dword [0x4081f8]
push eax
mov eax, dword [0x408204]
push eax
push 0
call sub.user32.dll_MessageBoxA_1
jmp 0x406c42
cmp byte [0x409a86], 0
je 0x406845
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [ebp - 9]
push eax
mov eax, dword [0x409a80]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [ebp - 9]
mov edx, dword [0x409a80]
mov byte [edx + eax], 0
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [ebp - 0xa]
push eax
mov eax, dword [0x409a7c]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [ebp - 0xa]
mov edx, dword [0x409a7c]
mov byte [edx + eax], 0
xor eax, eax
mov al, byte [0x409a94]
inc eax
call fcn.004023c8
mov dword [0x409aa0], eax
push 0
lea eax, [ebp - 8]
push eax
xor eax, eax
mov al, byte [0x409a94]
push eax
mov eax, dword [0x409aa0]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
xor eax, eax
mov al, byte [0x409a94]
mov edx, dword [0x409aa0]
mov byte [edx + eax], 0
xor edx, edx
mov dl, byte [0x409a94]
mov eax, 0x409aa0
call fcn.004039f4
mov eax, dword [0x409a90]
inc eax
call fcn.004023c8
mov dword [0x409a98], eax
cmp dword [0x409a90], 0
jle 0x406913
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [0x409a90]
push eax
mov eax, dword [0x409a98]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
mov eax, 0x409a98
mov edx, dword [0x409a90]
call fcn.004039f4
jmp 0x40691d
mov eax, 0x406d34
mov dword [0x409a98], eax
mov eax, dword [0x409a8c]
inc eax
call fcn.004023c8
mov dword [0x409a9c], eax
cmp dword [0x409a8c], 0
jle 0x406960
push 0
lea eax, [ebp - 8]
push eax
mov eax, dword [0x409a8c]
push eax
mov eax, dword [0x409a9c]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_ReadFile_1
mov eax, 0x409a9c
mov edx, dword [0x409a8c]
call fcn.004039f4
cmp byte [0x409a8a], 0
jne 0x40696e
call fcn.004062fc
xor eax, eax
mov al, byte [ebp - 9]
add eax, 0x8a18
xor edx, edx
mov dl, byte [ebp - 0xa]
add eax, edx
add eax, dword [0x409a90]
add eax, dword [0x409a8c]
xor edx, edx
mov dl, byte [0x409a94]
add eax, edx
mov dword [0x409a70], eax
cmp byte [0x409a8a], 0
je 0x406c3e
lea eax, [ebp - 0x18]
mov edx, dword [0x409494]
call fcn.00402d54
mov eax, dword [ebp - 0x18]
call fcn.00403fc0
lea eax, [ebp - 0x18]
mov edx, dword [0x409494]
call fcn.00402d54
lea eax, [ebp - 0x18]
mov edx, 0x406d68
call fcn.00402da4
lea eax, [ebp - 0x18]
mov edx, 0x406c78
call fcn.00402da4
mov eax, dword [ebp - 0x18]
call fcn.00402f10
mov edx, eax
mov eax, 0x409aac
call fcn.00402d54
mov byte [0x409a95], 0
push 0
push 0x80
push 2
push 0
push 2
push 0x40000000
mov eax, dword [0x409aac]
call fcn.00402f10
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [esi], eax
cmp dword [esi], 0xffffffff
sete byte [edi]
mov eax, 0x8000
call fcn.004023c8
mov dword [0x409abc], eax
mov edx, 0x409a74
xor eax, eax
call fcn.004025ac
jmp 0x406bbd
cmp byte [0x409a95], 0
jbe 0x406ab2
lea eax, [ebp - 0x18]
push eax
mov eax, dword [0x409a74]
call fcn.00402d9c
mov ecx, eax
sub ecx, 3
mov edx, 1
mov eax, dword [0x409a74]
call fcn.00402f50
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x20]
xor eax, eax
mov al, byte [0x409a95]
mov dl, 3
call fcn.00403984
lea edx, [ebp - 0x20]
lea eax, [ebp - 0x1c]
call fcn.00402d48
mov edx, dword [ebp - 0x1c]
pop eax
call fcn.00402da4
mov eax, dword [ebp - 0x18]
call fcn.00402f10
mov edx, eax
mov eax, 0x409a74
call fcn.00402d54
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
mov eax, dword [0x409a74]
call fcn.00402f10
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [0x409af8], eax
cmp dword [0x409af8], 0xffffffff
je 0x406b57
push 0
mov eax, dword [0x409af8]
push eax
call sub.kernel32.dll_GetFileSize_1
mov dword [0x409af0], eax
jmp 0x406b41
push 0
push ebx
mov edx, 0x8000
mov eax, dword [0x409af0]
call fcn.00403bc4
push eax
mov eax, dword [0x409abc]
push eax
mov eax, dword [0x409af8]
push eax
call sub.kernel32.dll_ReadFile_1
mov eax, dword [ebx]
sub dword [0x409af0], eax
push 0
push ebx
mov eax, dword [ebx]
push eax
mov eax, dword [0x409abc]
push eax
mov eax, dword [esi]
push eax
call sub.kernel32.dll_WriteFile_1
neg eax
sbb eax, eax
neg eax
test al, al
sete byte [edi]
cmp dword [0x409af0], 0
jle 0x406b4f
cmp byte [edi], 0
je 0x406af6
inc byte [0x409a95]
jmp 0x406bb2
push 0x41
mov eax, dword [0x409a80]
push eax
mov edx, dword [0x408208]
lea eax, [ebp - 0x18]
call fcn.00402ccc
xor eax, eax
mov al, byte [0x409a95]
inc eax
call fcn.00403918
mov edx, eax
lea eax, [ebp - 0x1c]
call fcn.00402d54
mov edx, dword [ebp - 0x1c]
lea eax, [ebp - 0x18]
call fcn.00402da4
lea eax, [ebp - 0x18]
mov edx, 0x406d80
call fcn.00402da4
mov eax, dword [ebp - 0x18]
call fcn.00402f10
push eax
push 0
call sub.user32.dll_MessageBoxA_1
cmp eax, 2
sete byte [edi]
mov eax, dword [0x409af8]
push eax
call sub.kernel32.dll_CloseHandle_1
push 0
mov eax, dword [esi]
push eax
call sub.kernel32.dll_GetFileSize_1
cmp eax, dword [0x409aa4]
jge 0x406bd8
cmp byte [edi], 0
je 0x406a4a
mov edx, 0x8001
mov eax, dword [0x409abc]
call fcn.004023e0
mov eax, dword [esi]
push eax
call sub.kernel32.dll_CloseHandle_1
cmp byte [edi], 0
je 0x406c0b
push 0x10
mov eax, dword [0x4081f8]
push eax
mov eax, dword [0x40820c]
push eax
push 0
call sub.user32.dll_MessageBoxA_1
jmp 0x406c42
push 0
push 0x80
push 3
push 0
push 1
push 0x80000000
mov eax, dword [0x409aac]
call fcn.00402f10
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [esi], eax
cmp dword [esi], 0xffffffff
sete byte [edi]
mov al, byte [edi]
xor al, 1
mov byte [ebp - 1], al
jmp 0x406c42
mov byte [ebp - 1], 1
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x406c64
lea eax, [ebp - 0x1c]
mov edx, 2
call fcn.00402c58
ret