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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x848
mov eax, dword [0x417044]
xor eax, ebp
mov dword [ebp - 8], eax
mov dword [ebp - 4], 0
xor eax, eax
mov word [ebp - 0x210], ax
push 0x206
push 0
lea ecx, [ebp - 0x20e]
push ecx
call fcn.0040cfd0
add esp, 0xc
xor edx, edx
mov word [ebp - 0x428], dx
push 0x206
push 0
lea eax, [ebp - 0x426]
push eax
call fcn.0040cfd0
add esp, 0xc
xor ecx, ecx
mov word [ebp - 0x848], cx
push 0x206
push 0
lea edx, [ebp - 0x846]
push edx
call fcn.0040cfd0
add esp, 0xc
mov dword [ebp - 0x430], 0
mov ax, word [0x415128]
mov word [ebp - 0x640], ax
push 0x206
push 0
lea ecx, [ebp - 0x63e]
push ecx
call fcn.0040cfd0
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edx, edx
mov ecx, 0x3e8
div ecx
xor edx, edx
mov ecx, 0x3e8
div ecx
mov dword [ebp - 0x218], edx
mov edx, dword [ebp - 0x218]
push edx
push 0x41512c
lea eax, [ebp - 0x640]
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push 0x104
lea ecx, [ebp - 0x210]
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea edx, [ebp - 0x428]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
lea eax, [ebp - 0x428]
push eax
push 0x104
lea ecx, [ebp - 0x848]
push ecx
call fcn.0040673f
add esp, 0xc
lea edx, [ebp - 0x428]
push edx
lea eax, [ebp - 0x210]
push eax
call fcn.00401af0
add esp, 8
test eax, eax
je 0x4021ca
mov dword [ebp - 4], 1
jmp 0x4023a9
push 0x5c
lea ecx, [ebp - 0x210]
push ecx
call fcn.00401b10
add esp, 8
mov dword [ebp - 0x430], eax
cmp dword [ebp - 0x430], 0
jne 0x4021f4
jmp 0x4023a9
lea edx, [ebp - 0x640]
push edx
push 0x104
lea eax, [ebp - 0x428]
push eax
call fcn.00407050
add esp, 0xc
mov dword [ebp - 0x214], 0
push 0x415158
lea ecx, [ebp - 0x210]
push ecx
lea edx, [ebp - 0x214]
push edx
call fcn.004071aa
add esp, 0xc
test eax, eax
je 0x40223f
xor eax, eax
jmp 0x4023ac
mov dword [ebp - 0x434], 0
push 2
push 0
mov eax, dword [ebp - 0x214]
push eax
call fcn.00407287
add esp, 0xc
mov ecx, dword [ebp - 0x214]
push ecx
call fcn.004074a9
add esp, 4
mov dword [ebp - 0x434], eax
push 0
push 0
mov edx, dword [ebp - 0x214]
push edx
call fcn.00407287
add esp, 0xc
mov eax, dword [ebp - 0x434]
add eax, 0x32000
push eax
call fcn.00406d40
add esp, 4
mov dword [ebp - 0x21c], eax
mov ecx, dword [ebp - 0x214]
push ecx
push 1
mov edx, dword [ebp - 0x434]
push edx
mov eax, dword [ebp - 0x21c]
push eax
call fcn.004077b7
add esp, 0x10
mov ecx, dword [ebp - 0x214]
push ecx
call fcn.0040784b
add esp, 4
push 0x19000
mov edx, dword [ebp - 0x434]
mov eax, dword [ebp - 0x21c]
lea ecx, [eax + edx + 0x19000]
push ecx
mov edx, dword [ebp - 0x21c]
add edx, dword [ebp - 0x434]
push edx
call fcn.0040da00
add esp, 0xc
push 0x415160
lea eax, [ebp - 0x428]
push eax
lea ecx, [ebp - 0x214]
push ecx
call fcn.004071aa
add esp, 0xc
test eax, eax
je 0x402320
xor eax, eax
jmp 0x4023ac
call dword [sym.imp.KERNEL32.dll_GetTickCount]
xor edx, edx
mov ecx, 0xc350
div ecx
add edx, dword [ebp - 0x434]
mov dword [ebp - 0x42c], edx
mov edx, dword [ebp - 0x214]
push edx
push 1
mov eax, dword [ebp - 0x42c]
push eax
mov ecx, dword [ebp - 0x21c]
push ecx
call fcn.00407a29
add esp, 0x10
mov edx, dword [ebp - 0x214]
push edx
push 1
push 0x4ae
mov eax, dword [ebp - 0x434]
mov ecx, dword [ebp - 0x21c]
lea edx, [ecx + eax - 0x4ae]
push edx
call fcn.00407a29
add esp, 0x10
mov eax, dword [ebp - 0x214]
push eax
call fcn.0040784b
add esp, 4
lea ecx, [ebp - 0x848]
push ecx
lea edx, [ebp - 0x428]
push edx
call fcn.00401ec0
add esp, 8
mov eax, dword [ebp - 4]
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.00406704
mov esp, ebp
pop ebp
ret