Function at 0x415fc0
Capabilities:
Get common file path
Set current directory
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x45c683
mov eax, dword fs:[0]
push eax
sub esp, 0x87c
mov eax, dword [0x4713c0]
xor eax, esp
mov dword [esp + 0x878], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4713c0]
xor eax, esp
push eax
lea eax, [esp + 0x890]
mov dword fs:[0], eax
xor edi, edi
cmp dword [0x474f04], edi
jne 0x41658d
push 0x800
call fcn.00442462
add esp, 4
push 0x800
mov esi, eax
push edi
push esi
mov dword [esp + 0x40], esi
call fcn.00446fa0
add esp, 0xc
push esi
push 0x104
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryW]
push esi
push 0x4640fc
lea eax, [esp + 0x94]
push 0x200
push eax
call fcn.004414db
add esp, 0x10
lea ecx, [esp + 0x38]
mov word [esp + 0x48a], di
call fcn.0042bd40
mov dword [esp + 0x898], edi
mov ebx, 7
lea eax, [esp + 0x8c]
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416086
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x90]
push ecx
lea esi, [esp + 0x20]
call fcn.00406f80
mov edx, esi
push edi
push edx
or eax, 0xffffffff
lea esi, [esp + 0x40]
mov byte [esp + 0x8a0], 1
call fcn.00406df0
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x4160d7
mov eax, dword [esp + 0x1c]
push eax
call fcn.004415cb
add esp, 4
cmp dword [esp + 0x50], esi
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
jae 0x4160f2
lea edx, [esp + 0x3c]
mov ebp, dword [0x474bb0]
cmp ebp, edi
je 0x416131
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416101
sub eax, esi
sar eax, 1
push ebp
lea ecx, [eax + eax]
push ecx
push 1
push edx
call fcn.004422ed
mov edx, dword [0x474bb0]
push edx
call fcn.004428a9
add esp, 0x14
mov esi, 8
mov dword [esp + 0x898], 0xffffffff
cmp dword [esp + 0x50], esi
jb 0x41614f
mov eax, dword [esp + 0x3c]
push eax
call fcn.004415cb
add esp, 4
push 0x475024
lea eax, [esp + 0x58]
call fcn.0041dd10
add esp, 4
mov dword [esp + 0x898], 2
cmp dword [esp + 0x6c], esi
mov eax, dword [esp + 0x58]
jae 0x416179
lea eax, [esp + 0x58]
push eax
push 0x464140
lea ecx, [esp + 0x94]
push 0x200
push ecx
call fcn.004414db
add esp, 0x10
lea ecx, [esp + 0x38]
mov word [esp + 0x48a], di
call fcn.0042bd40
mov byte [esp + 0x898], 3
lea eax, [esp + 0x8c]
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4161c4
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0x90]
push edx
lea esi, [esp + 0x20]
call fcn.00406f80
mov eax, esi
push edi
push eax
or eax, 0xffffffff
lea esi, [esp + 0x40]
mov byte [esp + 0x8a0], 4
call fcn.00406df0
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x416215
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.004415cb
add esp, 4
cmp dword [esp + 0x50], esi
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x30], ebx
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
jae 0x416230
lea edx, [esp + 0x3c]
mov ebp, dword [0x474bb0]
cmp ebp, edi
je 0x41626f
mov eax, edx
lea esi, [eax + 2]
nop
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416240
sub eax, esi
sar eax, 1
push ebp
add eax, eax
push eax
push 1
push edx
call fcn.004422ed
mov ecx, dword [0x474bb0]
push ecx
call fcn.004428a9
add esp, 0x14
mov esi, 8
mov byte [esp + 0x898], 2
cmp dword [esp + 0x50], esi
jb 0x41628a
mov edx, dword [esp + 0x3c]
push edx
call fcn.004415cb
add esp, 4
cmp dword [esp + 0x6c], esi
mov eax, dword [esp + 0x58]
jae 0x416298
lea eax, [esp + 0x58]
mov ebx, dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryW]
push eax
call ebx
mov ecx, dword [0x475028]
mov esi, 8
cmp dword [0x47503c], esi
jae 0x4162b9
mov ecx, 0x475028
call fcn.0041a800
test eax, eax
je 0x416417
cmp dword [0x47503c], esi
mov eax, dword [0x475028]
jae 0x4162d8
mov eax, 0x475028
push eax
call fcn.00440e7e
mov ecx, dword [0x475028]
add esp, 4
cmp dword [0x47503c], esi
mov dword [0x474f04], eax
jae 0x4162f9
mov ecx, 0x475028
push eax
push ecx
push 0x4641b8
lea eax, [esp + 0x98]
push 0x200
push eax
call fcn.004414db
add esp, 0x14
lea ecx, [esp + 0x38]
mov word [esp + 0x48a], di
call fcn.0042bd40
mov byte [esp + 0x898], 5
mov ebp, 7
lea eax, [esp + 0x8c]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
lea edx, [eax + 2]
lea ebx, [ebx]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416350
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0x90]
push ecx
lea esi, [esp + 0x20]
call fcn.00406f80
mov edx, esi
push edi
push edx
or eax, 0xffffffff
lea esi, [esp + 0x40]
mov byte [esp + 0x8a0], 6
call fcn.00406df0
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x4163a1
mov eax, dword [esp + 0x1c]
push eax
call fcn.004415cb
add esp, 4
cmp dword [esp + 0x50], esi
mov edx, dword [esp + 0x3c]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
jae 0x4163bc
lea edx, [esp + 0x3c]
mov ebp, dword [0x474bb0]
cmp ebp, edi
je 0x4163fb
mov eax, edx
lea esi, [eax + 2]
jmp 0x4163d0
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4163d0
sub eax, esi
sar eax, 1
push ebp
lea ecx, [eax + eax]
push ecx
push 1
push edx
call fcn.004422ed
mov edx, dword [0x474bb0]
push edx
call fcn.004428a9
add esp, 0x14
mov byte [esp + 0x898], 2
cmp dword [esp + 0x50], 8
jb 0x416417
mov eax, dword [esp + 0x3c]
push eax
call fcn.004415cb
add esp, 4
mov ecx, dword [esp + 0x34]
push ecx
push 0x464140
lea edx, [esp + 0x494]
push 0x200
push edx
call fcn.004414db
add esp, 0x10
lea ecx, [esp + 0x70]
mov word [esp + 0x88a], di
call fcn.0042bd40
mov byte [esp + 0x898], 7
mov ebp, 7
lea eax, [esp + 0x48c]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
lea edx, [eax + 2]
jmp 0x416470
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x416470
sub eax, edx
sar eax, 1
push eax
lea eax, [esp + 0x490]
push eax
lea esi, [esp + 0x20]
call fcn.00406f80
mov ecx, esi
push edi
push ecx
or eax, 0xffffffff
lea esi, [esp + 0x78]
mov byte [esp + 0x8a0], 8
call fcn.00406df0
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x4164c1
mov edx, dword [esp + 0x1c]
push edx
call fcn.004415cb
add esp, 4
cmp dword [esp + 0x88], esi
mov edx, dword [esp + 0x74]
mov dword [esp + 0x30], ebp
mov dword [esp + 0x2c], edi
mov word [esp + 0x1c], di
jae 0x4164df
lea edx, [esp + 0x74]
mov ebp, dword [0x474bb0]
cmp ebp, edi
je 0x41651a
mov eax, edx
lea esi, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4164f0
sub eax, esi
sar eax, 1
push ebp
add eax, eax
push eax
push 1
push edx
call fcn.004422ed
mov ecx, dword [0x474bb0]
push ecx
call fcn.004428a9
add esp, 0x14
cmp dword [esp + 0x88], 8
jb 0x416531
mov edx, dword [esp + 0x74]
push edx
call fcn.004415cb
add esp, 4
mov esi, dword [esp + 0x34]
mov ebp, 7
push esi
mov dword [esp + 0x8c], ebp
mov dword [esp + 0x88], edi
mov word [esp + 0x78], di
call ebx
push esi
call fcn.0044245d
add esp, 4
mov dword [esp + 0x898], 0xffffffff
cmp dword [esp + 0x6c], 8
jb 0x416578
mov eax, dword [esp + 0x58]
push eax
call fcn.004415cb
add esp, 4
cmp dword [0x474f04], edi
mov dword [esp + 0x6c], ebp
mov dword [esp + 0x68], edi
mov word [esp + 0x58], di
je 0x4165e4
cmp dword [0x475004], edi
jne 0x41659f
call fcn.00427280
mov dword [0x475004], eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov ecx, dword [0x474f04]
mov edx, dword [ecx]
mov eax, dword [edx]
push edi
call eax
mov ecx, dword [0x474f04]
mov edx, dword [ecx]
mov eax, dword [0x475004]
mov edx, dword [edx + 0x10]
push eax
call edx
movzx eax, word [0x474f14]
cdq
mov ecx, 0x64
idiv ecx
mov ecx, dword [0x474f04]
mov esi, dword [ecx]
push edi
push edx
mov edx, dword [esi + 0xc]
push eax
call edx
mov eax, 1
mov ecx, dword [esp + 0x890]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x878]
xor ecx, esp
call fcn.004414cc
add esp, 0x888
ret