Function at 0x1016851
Capabilities:
Check if file exists
Create directory
Delete file
Get file attributes
Get file size

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
xor ecx, ecx
push edi
mov edi, eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 4], ecx
mov dword [ebp - 0x18], ecx
mov dword [ebp - 0x14], 1
mov dword [ebp - 0x10], ecx
mov dword [ebp - 0xc], ecx
cmp eax, ecx
je 0x1016881
mov eax, dword [eax]
mov dword [ebp - 8], eax
jmp 0x1016885
or dword [ebp - 8], 0xffffffff
test byte [edi + 0x10], 0x10
mov ebx, 0xffff
mov esi, 0x80070000
je 0x10168d2
push dword [ebp + 0x10]
mov dword [ebp - 0x14], 3
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x10168d2
push 0
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x10168d2
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10168c7
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
test eax, eax
jl 0x1016996
cmp dword [ebp - 8], 0xffffffff
jne 0x1016920
push dword [ebp + 8]
call fcn.0101a106
push eax
call fcn.0101fcf0
mov dword [ebp - 0xc], eax
test eax, eax
je 0x101690f
push 0
lea ecx, [ebp - 8]
push ecx
push 0
push eax
add edi, 0x14
push edi
push dword [ebp + 8]
call fcn.0101e358
test eax, eax
je 0x101690f
mov dword [ebp - 0x18], 1
jmp 0x1016920
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x101691d
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jl 0x1016996
push 0
push dword [ebp + 8]
call fcn.01015eca
test eax, 0x20000
je 0x1016996
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x14]
push dword [ebp + 0x10]
call dword [sym.imp.ADVAPI32.dll_OpenEncryptedFileRawW]
test eax, eax
jne 0x101698d
lea edi, [ebp - 0x28]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
mov eax, dword [ebp - 8]
lea ecx, [ebp - 0x28]
push ecx
push eax
mov dword [ebp - 0x30], eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
push dword [ebp - 0x10]
lea eax, [ebp - 0x30]
push eax
push 0x10167a8
call dword [sym.imp.ADVAPI32.dll_WriteEncryptedFileRaw]
test eax, eax
je 0x1016982
jle 0x101697f
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CloseEncryptedFileRaw]
jmp 0x1016996
jle 0x1016993
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
cmp dword [ebp - 8], 0xffffffff
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
je 0x10169ad
cmp dword [ebp - 0x18], 0
je 0x10169ad
push dword [ebp - 8]
call edi
cmp dword [ebp - 0xc], 0
je 0x10169ce
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push dword [ebp - 0xc]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
cmp dword [ebp - 4], 0
jl 0x1016a1b
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x1016a1b
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x10169e5
push eax
call edi
push 0
push 0x2200000
push 3
push 0
push 7
push 0x11e0100
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ecx, dword [ebp + 0xc]
mov dword [ecx], eax
cmp eax, 0xffffffff
jne 0x1016a1b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1016a18
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret 0xc