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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4c7af8
mov eax, dword fs:[0]
push eax
sub esp, 0x940
mov eax, dword [0x4fe37c]
xor eax, ebp
mov dword [ebp - 0x14], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov eax, dword [ebp + 8]
add eax, 8
mov dword [ebp - 0x58], eax
mov dword [ebp - 0x44], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0x38], 0
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x60], 0
mov dword [ebp - 0x48], 0
movzx ecx, byte [ebp + 0x10]
cmp ecx, 1
jne 0x489127
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0x60], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov dword [ebp - 0x48], edx
mov eax, dword [ebp - 0x44]
add eax, dword [ebp - 0x60]
mov dword [ebp - 0x44], eax
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x918], esp
push str.SetupIcon
call fcn.00406f50
mov dword [ebp - 0x938], eax
mov ecx, dword [ebp - 0x60]
push ecx
mov edx, dword [ebp - 0x48]
push edx
mov ecx, dword [ebp + 0xc]
call fcn.00488f10
mov dword [ebp - 0x93c], eax
mov eax, dword [ebp - 0x93c]
mov dword [ebp - 0x38], eax
mov ecx, dword [ebp - 0x58]
add ecx, dword [ebp - 0x44]
mov edx, dword [ecx]
mov dword [ebp - 0x34], edx
mov eax, dword [ebp - 0x44]
add eax, 4
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x58]
add ecx, dword [ebp - 0x44]
mov dword [ebp - 0x5c], ecx
mov edx, dword [ebp - 0x44]
add edx, dword [ebp - 0x34]
mov dword [ebp - 0x44], edx
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x91c], esp
push 0x4d9300
call fcn.00406f50
mov dword [ebp - 0x940], eax
mov eax, dword [ebp - 0x34]
push eax
mov ecx, dword [ebp - 0x5c]
push ecx
mov ecx, dword [ebp + 0xc]
call fcn.00488f10
mov dword [ebp - 0x944], eax
mov edx, dword [ebp - 0x944]
mov dword [ebp - 0x10], edx
mov dword [ebp - 0x54], 0
mov dword [ebp - 0x40], 0
movzx eax, byte [ebp + 0x10]
cmp eax, 1
jne 0x4891fe
mov ecx, dword [ebp - 0x58]
add ecx, dword [ebp - 0x44]
mov edx, dword [ecx]
mov dword [ebp - 0x54], edx
mov eax, dword [ebp - 0x44]
add eax, 4
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x58]
add ecx, dword [ebp - 0x44]
mov dword [ebp - 0x40], ecx
mov edx, dword [ebp - 0x44]
add edx, dword [ebp - 0x54]
mov dword [ebp - 0x44], edx
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x920], esp
push 0x4d9304
call fcn.00406f50
mov dword [ebp - 0x948], eax
mov eax, dword [ebp - 0x54]
push eax
mov ecx, dword [ebp - 0x40]
push ecx
mov ecx, dword [ebp + 0xc]
call fcn.00488f10
mov dword [ebp - 0x94c], eax
mov edx, dword [ebp - 0x94c]
mov dword [ebp - 0x4c], edx
push 0x4d9308
lea ecx, [ebp - 0x30]
call fcn.00406f50
mov dword [ebp - 4], 0
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x44]
mov ecx, dword [eax]
mov dword [ebp - 0x50], ecx
mov edx, dword [ebp - 0x44]
add edx, 4
mov dword [ebp - 0x44], edx
mov dword [ebp - 0x3c], 0
jmp 0x489238
mov eax, dword [ebp - 0x3c]
add eax, 1
mov dword [ebp - 0x3c], eax
mov ecx, dword [ebp - 0x3c]
cmp ecx, dword [ebp - 0x50]
jae 0x489424
movzx edx, byte [ebp + 0x10]
test edx, edx
je 0x489343
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x44]
mov ecx, dword [eax]
mov dword [ebp - 0x80], ecx
mov edx, dword [ebp - 0x44]
add edx, 4
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x44]
push eax
lea ecx, [ebp - 0x9c]
call fcn.00406f50
mov byte [ebp - 4], 1
mov ecx, dword [ebp - 0x80]
mov edx, dword [ebp - 0x44]
lea eax, [edx + ecx*2]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
add ecx, 2
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0x80], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
push edx
lea ecx, [ebp - 0x7c]
call fcn.00406f50
mov byte [ebp - 4], 2
mov eax, dword [ebp - 0x80]
mov ecx, dword [ebp - 0x44]
lea edx, [ecx + eax*2]
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x44]
add eax, 2
mov dword [ebp - 0x44], eax
push 6
push 0x4d930c
lea ecx, [ebp - 0x9c]
call fcn.00407070
push eax
call fcn.004459f8
add esp, 0xc
test eax, eax
jne 0x4892f8
lea ecx, [ebp - 0x7c]
push ecx
mov ecx, dword [ebp + 0xc]
call fcn.00406ff0
jmp 0x489323
push 6
push 0x4d931c
lea ecx, [ebp - 0x9c]
call fcn.00407070
push eax
call fcn.004459f8
add esp, 0xc
test eax, eax
jne 0x489323
lea edx, [ebp - 0x7c]
push edx
lea ecx, [ebp - 0x30]
call fcn.00406ff0
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x7c]
call fcn.00406fd0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x9c]
call fcn.00406fd0
jmp 0x48941f
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x44]
mov ecx, dword [eax]
mov dword [ebp - 0xb0], ecx
mov edx, dword [ebp - 0x44]
add edx, 4
mov dword [ebp - 0x44], edx
mov eax, dword [ebp - 0x58]
add eax, dword [ebp - 0x44]
push eax
lea ecx, [ebp - 0xcc]
call fcn.00406f50
mov byte [ebp - 4], 3
mov ecx, dword [ebp - 0xb0]
mov edx, dword [ebp - 0x44]
lea eax, [edx + ecx*2]
mov dword [ebp - 0x44], eax
mov ecx, dword [ebp - 0x44]
add ecx, 2
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0xac], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0xa8], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0xa4], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
mov edx, dword [ebp - 0x58]
add edx, dword [ebp - 0x44]
mov eax, dword [edx]
mov dword [ebp - 0xa0], eax
mov ecx, dword [ebp - 0x44]
add ecx, 4
mov dword [ebp - 0x44], ecx
lea edx, [ebp - 0xac]
push edx
lea ecx, [ebp - 0x930]
call fcn.00411520
lea eax, [ebp - 0x930]
push eax
lea ecx, [ebp - 0xcc]
push ecx
mov edx, dword [ebp - 0x10]
push edx
mov ecx, dword [ebp + 0xc]
call fcn.00488ec0
mov byte [ebp - 4], 0
lea ecx, [ebp - 0xcc]
call fcn.00406fd0
jmp 0x48922f
movzx eax, byte [ebp + 0x10]
test eax, eax
je 0x48962a
xor ecx, ecx
mov word [ebp - 0x8cc], cx
push 0x7fe
push 0
lea edx, [ebp - 0x8ca]
push edx
call fcn.00445020
add esp, 0xc
movzx eax, byte [ebp + 0x10]
cmp eax, 1
jne 0x489548
cmp dword [ebp - 0x60], 0
jle 0x489548
lea ecx, [ebp - 0x8cc]
push ecx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x489548
lea edx, [ebp - 0x30]
push edx
lea ecx, [ebp - 0x8ec]
call fcn.00406f90
mov byte [ebp - 4], 4
push 0x4d932c
lea ecx, [ebp - 0x8ec]
call fcn.00407050
lea ecx, [ebp - 0x8ec]
call fcn.00407070
push eax
push 0x400
lea eax, [ebp - 0x8cc]
push eax
call fcn.00445141
add esp, 0xc
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x8cc]
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x8d0], eax
cmp dword [ebp - 0x8d0], 0xffffffff
je 0x489539
push 2
push 0
push 0
mov edx, dword [ebp - 0x8d0]
push edx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x8f0], 0
push 0
lea eax, [ebp - 0x8f0]
push eax
mov ecx, dword [ebp - 0x60]
push ecx
mov edx, dword [ebp - 0x48]
push edx
mov eax, dword [ebp - 0x8d0]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x8d0]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x8ec]
call fcn.00406fd0
lea edx, [ebp - 0x8cc]
push edx
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
test eax, eax
jbe 0x48962a
lea eax, [ebp - 0x30]
push eax
lea ecx, [ebp - 0x910]
call fcn.00406f90
mov byte [ebp - 4], 5
push 0x4d934c
lea ecx, [ebp - 0x910]
call fcn.00407050
lea ecx, [ebp - 0x910]
call fcn.00407070
push eax
push 0x400
lea ecx, [ebp - 0x8cc]
push ecx
call fcn.00445141
add esp, 0xc
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea edx, [ebp - 0x8cc]
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x8f4], eax
cmp dword [ebp - 0x8f4], 0xffffffff
je 0x48961b
push 2
push 0
push 0
mov eax, dword [ebp - 0x8f4]
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x914], 0
push 0
lea ecx, [ebp - 0x914]
push ecx
mov edx, dword [ebp - 0x34]
push edx
mov eax, dword [ebp - 0x5c]
push eax
mov ecx, dword [ebp - 0x8f4]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebp - 0x8f4]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov byte [ebp - 4], 0
lea ecx, [ebp - 0x910]
call fcn.00406fd0
mov byte [ebp - 0x931], 1
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x30]
call fcn.00406fd0
mov al, byte [ebp - 0x931]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x14]
xor ecx, ebp
call fcn.004443e3
mov esp, ebp
pop ebp
ret