Function at 0x10050e27
Capabilities:
Create directory
Get common file path
Get file size
Move file
Read file on windows
Read file via mapping
Set file attributes

Disassembly:
mov eax, 0x1006aadf
call fcn.100575f8
sub esp, 0x68c
mov eax, dword [0x10084500]
push ebx
xor ebx, ebx
cmp dword [ebp + 8], ebx
push esi
mov dword [ebp - 0x10], eax
push edi
je 0x10051346
mov esi, dword [ebp + 0xc]
cmp esi, ebx
je 0x10051346
push dword [ebp + 8]
call fcn.10056d60
test eax, eax
pop ecx
je 0x10051346
push esi
call fcn.10056d60
test eax, eax
pop ecx
je 0x10051346
push ebx
lea ecx, [ebp - 0x2c]
mov dword [ebp - 0x14], 0xf
call fcn.1000125d
push 4
push str.temp
push esi
mov dword [ebp - 4], ebx
call fcn.1005b211
add esp, 0xc
test eax, eax
jne 0x10050ed1
lea eax, [ebp - 0x14c]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea eax, [ebp - 0x14c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.10003017
add esi, 6
push esi
lea ecx, [ebp - 0x2c]
call fcn.10003017
jmp 0x100510e2
push 6
push str.windir
push esi
call fcn.1005b211
add esp, 0xc
test eax, eax
jne 0x10050ef9
push 0x104
lea eax, [ebp - 0x14c]
push eax
call dword [sym.imp.KERNEL32.dll_GetWindowsDirectoryA]
jmp 0x10050f1f
push 6
push str.sysdir
push esi
call fcn.1005b211
add esp, 0xc
test eax, eax
jne 0x10050f5d
push 0x104
lea eax, [ebp - 0x14c]
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
lea eax, [ebp - 0x14c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.10003017
lea eax, [ebp - 0x14c]
push eax
call fcn.10056d60
pop ecx
lea ecx, [ebp - 0x14c]
dec ecx
cmp byte [eax + ecx], 0x5c
je 0x10050f55
push 0x1006caec
lea ecx, [ebp - 0x2c]
call fcn.10003017
add esi, 8
jmp 0x10050ec3
push 7
push str.profile
push esi
call fcn.1005b211
add esp, 0xc
test eax, eax
jne 0x10050fc4
lea eax, [ebp - 0x14c]
push eax
push ebx
push ebx
push 0x801a
push ebx
call dword [sym.imp.SHFOLDER.dll_SHGetFolderPathA]
lea eax, [ebp - 0x14c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.10003017
lea eax, [ebp - 0x14c]
push eax
call fcn.10056d60
pop ecx
lea ecx, [ebp - 0x14c]
dec ecx
cmp byte [eax + ecx], 0x5c
je 0x10050fbc
push 0x1006caec
lea ecx, [ebp - 0x2c]
call fcn.10003017
add esi, 9
jmp 0x10050ec3
push 2
push 0x100744b0
push esi
call fcn.1005b211
add esp, 0xc
test eax, eax
jne 0x100510d9
mov esi, 0x420
push esi
lea eax, [ebp - 0x670]
push ebx
push eax
call fcn.10056960
lea eax, [ebp - 0x250]
push eax
call fcn.10023308
add esp, 0x10
lea eax, [ebp - 0x250]
push eax
push esi
push ebx
push 4
push ebx
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
push ebx
push ebx
push ebx
push 0xf001f
push eax
mov dword [ebp - 0x674], eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
mov edi, eax
cmp edi, ebx
je 0x1005105a
push esi
lea eax, [ebp - 0x670]
push edi
push eax
call fcn.10056df0
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
lea eax, [ebp - 0x568]
push eax
lea eax, [ebp - 0x14c]
push eax
call fcn.10057da0
pop ecx
pop ecx
cmp dword [ebp - 0x674], ebx
je 0x1005106e
push dword [ebp - 0x674]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x14c]
push eax
call fcn.10056d60
cmp eax, ebx
pop ecx
jl 0x10051097
cmp byte [ebp + eax - 0x14c], 0x5c
je 0x1005108c
dec eax
jns 0x1005107f
cmp eax, ebx
jl 0x10051097
mov byte [ebp + eax - 0x14c], bl
lea eax, [ebp - 0x14c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.10003017
lea eax, [ebp - 0x14c]
push eax
call fcn.10056d60
pop ecx
lea ecx, [ebp - 0x14c]
dec ecx
cmp byte [eax + ecx], 0x5c
je 0x100510cd
push 0x1006caec
lea ecx, [ebp - 0x2c]
call fcn.10003017
mov eax, dword [ebp + 0xc]
add eax, 4
push eax
jmp 0x10050ec4
push esi
lea ecx, [ebp - 0x2c]
call fcn.10001619
push dword [ebp + 0x14]
push 1
sub esp, 0x1c
mov ecx, esp
mov dword [ebp - 0x67c], esp
push dword [ebp + 8]
call fcn.10001636
lea eax, [ebp - 0x48]
push eax
call fcn.10050c4e
add esp, 0x28
cmp dword [ebp - 0x34], ebx
mov byte [ebp - 4], 1
mov byte [ebp + 0xb], bl
je 0x100511d2
cmp dword [ebp - 0x30], 0x10
mov eax, dword [ebp - 0x44]
jae 0x10051122
lea eax, [ebp - 0x44]
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x100511d2
lea eax, [ebp - 0x67c]
push eax
push esi
mov dword [ebp - 0x67c], ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
push edi
call fcn.100556e2
cmp eax, ebx
pop ecx
mov dword [ebp - 0x674], eax
je 0x100511c6
push edi
push ebx
push eax
mov dword [ebp - 0x678], ebx
call fcn.10056960
add esp, 0xc
push ebx
lea eax, [ebp - 0x678]
push eax
push edi
push dword [ebp - 0x674]
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x100511ba
cmp dword [ebp + 0x10], ebx
je 0x100511b6
push dword [ebp - 0x678]
push dword [ebp - 0x674]
push dword [ebp + 0x10]
call fcn.10023620
add esp, 0xc
test al, al
je 0x100511ba
mov byte [ebp + 0xb], 1
push dword [ebp - 0x674]
call fcn.10057617
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp + 0xb], bl
jne 0x100511da
mov byte [ebp + 0xb], bl
jmp 0x1005132b
xor edi, edi
inc edi
push edi
push 0xffffffffffffffff
lea eax, [ebp + 0xb]
push eax
lea ecx, [ebp - 0x48]
mov byte [ebp + 0xb], 0x5c
call fcn.1001e4a4
mov esi, eax
cmp esi, 0xffffffff
je 0x100511d2
cmp dword [ebp - 0x14], 0x10
mov eax, dword [ebp - 0x28]
jae 0x10051203
lea eax, [ebp - 0x28]
mov ecx, dword [ebp - 0x18]
cmp byte [eax + ecx - 1], 0x5c
je 0x1005121a
push 0x1006caec
lea ecx, [ebp - 0x2c]
call fcn.10003017
cmp dword [ebp - 0x30], 0x10
mov eax, dword [ebp - 0x44]
jae 0x10051226
lea eax, [ebp - 0x44]
lea eax, [eax + esi + 1]
push eax
lea ecx, [ebp - 0x2c]
call fcn.10003017
push edi
push edi
jmp 0x1005126e
push esi
push ebx
lea eax, [ebp - 0x698]
push eax
lea ecx, [ebp - 0x2c]
call fcn.1000e891
cmp dword [eax + 0x18], 0x10
jb 0x10051253
mov eax, dword [eax + 4]
jmp 0x10051256
add eax, 4
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
push ebx
push edi
lea ecx, [ebp - 0x698]
call fcn.10001293
push edi
inc esi
push esi
lea eax, [ebp + 0xb]
lea ecx, [ebp - 0x2c]
push eax
mov byte [ebp + 0xb], 0x5c
call fcn.1000d93b
mov esi, eax
cmp esi, 0xffffffff
jne 0x10051237
mov eax, dword [ebp - 0x44]
push 0x10
pop esi
cmp dword [ebp - 0x30], esi
jae 0x10051293
lea eax, [ebp - 0x44]
push 0x80
push eax
call dword [sym.imp.KERNEL32.dll_SetFileAttributesA]
cmp dword [ebp - 0x14], esi
mov ecx, dword [ebp - 0x28]
jae 0x100512aa
lea ecx, [ebp - 0x28]
cmp dword [ebp - 0x30], esi
mov eax, dword [ebp - 0x44]
jae 0x100512b5
lea eax, [ebp - 0x44]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_MoveFileA]
test eax, eax
jne 0x100512d0
push 0xffffffffffffffff
push ebx
lea eax, [ebp - 0x48]
push eax
lea ecx, [ebp - 0x2c]
call fcn.100014f5
cmp dword [ebp + 0x14], ebx
mov eax, dword [ebp - 0x28]
je 0x10051306
cmp dword [ebp - 0x14], esi
jae 0x100512e0
lea eax, [ebp - 0x28]
push eax
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov esi, eax
cmp esi, ebx
je 0x10051327
push dword [ebp + 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
cmp eax, ebx
je 0x100512fd
call eax
push esi
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
jmp 0x10051327
cmp dword [ebp - 0x14], esi
jae 0x1005130e
lea eax, [ebp - 0x28]
push 5
push ebx
push ebx
push eax
push str.open
push ebx
call dword [0x10085db8]
cmp eax, 0x20
mov byte [ebp + 0xb], bl
jbe 0x1005132b
mov byte [ebp + 0xb], 1
push ebx
push 1
lea ecx, [ebp - 0x48]
call fcn.10001293
push ebx
push 1
lea ecx, [ebp - 0x2c]
call fcn.10001293
mov al, byte [ebp + 0xb]
jmp 0x10051348
xor al, al
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x10]
call fcn.100568ae
pop edi
pop esi
pop ebx
leave
ret