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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x571036
mov eax, dword fs:[0]
push eax
mov eax, 0x223c
call fcn.004acf60
mov eax, dword [0x5d7c7c]
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.005126f0
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 0x46d1a5
sub ecx, edx
lea eax, [ebp - 0x1a10]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x2240]
call fcn.00412940
cmp dword [ebp - 0x2230], 0x104
mov ebx, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
mov byte [ebp - 4], 1
jbe 0x46d1e4
mov bl, 1
jmp 0x46d2db
push 0x800
lea eax, [ebp - 0x2210]
push 0
push eax
call fcn.005126f0
push 0x800
lea eax, [ebp - 0x1210]
push 0
push eax
call fcn.005126f0
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.0053e09c
push 0x100
lea eax, [ebp - 0x110]
push 0
push eax
call fcn.005126f0
add esp, 0x30
xor esi, esi
nop dword [eax + eax]
push 0x80
lea eax, [ebp - 0x110]
mov ecx, edi
push eax
call fcn.0046da20
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.0053dfc7
add esp, 0xc
lea eax, [ebp - 0x1210]
push eax
call ebx
test eax, eax
je 0x46d2ae
inc esi
cmp esi, 0xa
jl 0x46d250
mov bl, 1
jmp 0x46d2db
lea ecx, [ebp - 0x1210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x46d2b7
sub ecx, edx
lea eax, [ebp - 0x1210]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x2228]
call fcn.00412940
xor bl, bl
mov edx, dword [ebp - 0x222c]
mov byte [ebp - 4], 0
cmp edx, 8
jb 0x46d31f
mov ecx, dword [ebp - 0x2240]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46d315
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x46d5a6
push edx
push ecx
call fcn.004acb1e
add esp, 8
test bl, bl
jne 0x46d543
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 0x46d365
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.005126f0
push 0x800
lea eax, [ebp - 0xa10]
push 0
push eax
call fcn.005126f0
add esp, 0x18
lea eax, [ebp - 0x210]
mov ecx, edi
push 0x80
push eax
call fcn.0046da20
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.0053dfc7
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 0x46d414
sub ecx, edx
lea eax, [ebp - 0xa10]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x2240]
call fcn.00412940
cmp dword [ebp - 0x222c], 8
lea eax, [ebp - 0x2240]
push 0x595bb8
cmovae eax, dword [ebp - 0x2240]
push eax
lea eax, [ebp - 0x2244]
mov dword [ebp - 0x2244], 0
push eax
call fcn.00542034
mov ecx, dword [ebp - 0x2244]
add esp, 0xc
test ecx, ecx
jne 0x46d47e
call fcn.0052fc09
mov esi, dword [eax]
neg esi
jmp 0x46d4b1
mov eax, dword [ebp - 0x2248]
cmp dword [eax + 0x14], 0x10
lea ebx, [eax + 0x10]
jb 0x46d48f
mov eax, dword [eax]
push ecx
push dword [ebx]
push 1
push eax
call fcn.005451f8
push dword [ebp - 0x2244]
mov esi, eax
call fcn.00541b45
xor eax, eax
add esp, 0x14
cmp esi, dword [ebx]
cmovne esi, eax
mov edx, dword [ebp - 0x222c]
cmp edx, 8
jb 0x46d4f1
mov ecx, dword [ebp - 0x2240]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46d4e7
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x46d5ab
push edx
push ecx
call fcn.004acb1e
add esp, 8
test esi, esi
jle 0x46d543
cmp dword [ebp - 0x2214], 8
lea eax, [ebp - 0x2228]
cmovae eax, dword [ebp - 0x2228]
push eax
lea eax, [ebp - 0xa10]
push eax
call fcn.004e9bd0
add esp, 8
test eax, eax
js 0x46d543
lea eax, [ebp - 0x2228]
cmp edi, eax
je 0x46d543
cmp dword [ebp - 0x2214], 8
mov ecx, edi
push dword [ebp - 0x2218]
cmovae eax, dword [ebp - 0x2228]
push eax
call fcn.00412940
cmp dword [edi + 0x10], 0
mov edx, dword [ebp - 0x2214]
setne bl
cmp edx, 8
jb 0x46d586
mov ecx, dword [ebp - 0x2228]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x46d57c
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x46d5b0
push edx
push ecx
call fcn.004acb1e
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.004acb08
mov esp, ebp
pop ebp
ret 4
call fcn.0052faf3
call fcn.0052faf3
call fcn.0052faf3
int3