Function at 0x1005d9a0
Capabilities:
Check if file exists
Create directory
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x1013f216
mov eax, dword fs:[0]
push eax
mov eax, 0x223c
call fcn.1009e2b0
mov eax, dword [0x1019bc84]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edi, ecx
mov eax, dword [ebp + 8]
push 0x800
mov dword [ebp - 0x2248], eax
lea eax, [ebp - 0x1a10]
push 0
push eax
call fcn.100e3030
add esp, 0xc
lea eax, [ebp - 0x1a10]
push eax
push 0x400
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
xor eax, eax
mov dword [ebp - 0x2218], 0
mov dword [ebp - 0x2214], 7
mov word [ebp - 0x2228], ax
lea ecx, [ebp - 0x1a10]
mov dword [ebp - 4], eax
mov dword [ebp - 0x2230], eax
lea edx, [ecx + 2]
mov dword [ebp - 0x222c], 7
mov word [ebp - 0x2240], ax
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1005da45
sub ecx, edx
lea eax, [ebp - 0x1a10]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x2240]
call fcn.100125f0
cmp dword [ebp - 0x2230], 0x104
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov byte [ebp - 4], 1
jbe 0x1005da84
mov bl, 1
jmp 0x1005db7b
push 0x800
lea eax, [ebp - 0x2210]
push 0
push eax
call fcn.100e3030
push 0x800
lea eax, [ebp - 0x1210]
push 0
push eax
call fcn.100e3030
cmp dword [ebp - 0x222c], 8
lea eax, [ebp - 0x2240]
cmovae eax, dword [ebp - 0x2240]
push eax
lea eax, [ebp - 0x2210]
push 0x400
push eax
call fcn.1010e35c
push 0x100
lea eax, [ebp - 0x110]
push 0
push eax
call fcn.100e3030
add esp, 0x30
xor esi, esi
nop dword [eax + eax]
push 0x80
lea eax, [ebp - 0x110]
mov ecx, edi
push eax
call fcn.1005e2c0
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x2210]
push eax
lea eax, [ebp - 0x1210]
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
push str..tmp
lea eax, [ebp - 0x1210]
push 0x400
push eax
call fcn.1010e287
add esp, 0xc
lea eax, [ebp - 0x1210]
push eax
call ebx
test eax, eax
je 0x1005db4e
inc esi
cmp esi, 0xa
jl 0x1005daf0
mov bl, 1
jmp 0x1005db7b
lea ecx, [ebp - 0x1210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1005db57
sub ecx, edx
lea eax, [ebp - 0x1210]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x2228]
call fcn.100125f0
xor bl, bl
mov edx, dword [ebp - 0x222c]
mov byte [ebp - 4], 0
cmp edx, 8
jb 0x1005dbbf
mov ecx, dword [ebp - 0x2240]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x1005dbb5
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1005de46
push edx
push ecx
call fcn.1009de6e
add esp, 8
test bl, bl
jne 0x1005dde3
cmp dword [ebp - 0x2214], 8
lea eax, [ebp - 0x2228]
cmovae eax, dword [ebp - 0x2228]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
jne 0x1005dc05
cmp dword [ebp - 0x2214], 8
lea eax, [ebp - 0x2228]
push 0
cmovae eax, dword [ebp - 0x2228]
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHCreateDirectoryExW]
push 0x100
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.100e3030
push 0x800
lea eax, [ebp - 0xa10]
push 0
push eax
call fcn.100e3030
add esp, 0x18
lea eax, [ebp - 0x210]
mov ecx, edi
push 0x80
push eax
call fcn.1005e2c0
cmp dword [ebp - 0x2214], 8
lea eax, [ebp - 0x2228]
mov esi, dword [sym.imp.SHLWAPI.dll_PathAppendW]
cmovae eax, dword [ebp - 0x2228]
push eax
lea eax, [ebp - 0xa10]
push eax
call esi
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0xa10]
push eax
call esi
push str..tmp
lea eax, [ebp - 0xa10]
push 0x400
push eax
call fcn.1010e287
add esp, 0xc
mov dword [ebp - 0x2230], 0
xor eax, eax
mov dword [ebp - 0x222c], 7
lea ecx, [ebp - 0xa10]
mov word [ebp - 0x2240], ax
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x1005dcb4
sub ecx, edx
lea eax, [ebp - 0xa10]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x2240]
call fcn.100125f0
cmp dword [ebp - 0x222c], 8
lea eax, [ebp - 0x2240]
push 0x1015f278
cmovae eax, dword [ebp - 0x2240]
push eax
lea eax, [ebp - 0x2244]
mov dword [ebp - 0x2244], 0
push eax
call fcn.101122f4
mov ecx, dword [ebp - 0x2244]
add esp, 0xc
test ecx, ecx
jne 0x1005dd1e
call fcn.100ffec9
mov esi, dword [eax]
neg esi
jmp 0x1005dd51
mov eax, dword [ebp - 0x2248]
cmp dword [eax + 0x14], 0x10
lea ebx, [eax + 0x10]
jb 0x1005dd2f
mov eax, dword [eax]
push ecx
push dword [ebx]
push 1
push eax
call fcn.10113422
push dword [ebp - 0x2244]
mov esi, eax
call fcn.10111e05
xor eax, eax
add esp, 0x14
cmp esi, dword [ebx]
cmovne esi, eax
mov edx, dword [ebp - 0x222c]
cmp edx, 8
jb 0x1005dd91
mov ecx, dword [ebp - 0x2240]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x1005dd87
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1005de4b
push edx
push ecx
call fcn.1009de6e
add esp, 8
test esi, esi
jle 0x1005dde3
cmp dword [ebp - 0x2214], 8
lea eax, [ebp - 0x2228]
cmovae eax, dword [ebp - 0x2228]
push eax
lea eax, [ebp - 0xa10]
push eax
call fcn.100dac10
add esp, 8
test eax, eax
js 0x1005dde3
lea eax, [ebp - 0x2228]
cmp edi, eax
je 0x1005dde3
cmp dword [ebp - 0x2214], 8
mov ecx, edi
push dword [ebp - 0x2218]
cmovae eax, dword [ebp - 0x2228]
push eax
call fcn.100125f0
cmp dword [edi + 0x10], 0
mov edx, dword [ebp - 0x2214]
setne bl
cmp edx, 8
jb 0x1005de26
mov ecx, dword [ebp - 0x2228]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x1005de1c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x1005de50
push edx
push ecx
call fcn.1009de6e
add esp, 8
mov al, bl
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.1009de58
mov esp, ebp
pop ebp
ret 4
call fcn.100ffdb3
call fcn.100ffdb3
call fcn.100ffdb3
int3