Function at 0x1016770
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 0x10167a0
mov eax, dword [eax]
mov dword [ebp - 8], eax
jmp 0x10167a4
or dword [ebp - 8], 0xffffffff
test byte [edi + 0x10], 0x10
mov ebx, 0xffff
mov esi, 0x80070000
je 0x10167f1
push dword [ebp + 0x10]
mov dword [ebp - 0x14], 3
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x10167f1
push 0
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
test eax, eax
jne 0x10167f1
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x10167e6
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
test eax, eax
jl 0x10168b5
cmp dword [ebp - 8], 0xffffffff
jne 0x101683f
push dword [ebp + 8]
call fcn.0101a025
push eax
call fcn.0101fc0f
mov dword [ebp - 0xc], eax
test eax, eax
je 0x101682e
push 0
lea ecx, [ebp - 8]
push ecx
push 0
push eax
add edi, 0x14
push edi
push dword [ebp + 8]
call fcn.0101e277
test eax, eax
je 0x101682e
mov dword [ebp - 0x18], 1
jmp 0x101683f
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x101683c
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jl 0x10168b5
push 0
push dword [ebp + 8]
call fcn.01015de9
test eax, 0x20000
je 0x10168b5
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 0x10168ac
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 0x10166c7
call dword [sym.imp.ADVAPI32.dll_WriteEncryptedFileRaw]
test eax, eax
je 0x10168a1
jle 0x101689e
and eax, ebx
or eax, esi
mov dword [ebp - 4], eax
push dword [ebp - 0x10]
call dword [sym.imp.ADVAPI32.dll_CloseEncryptedFileRaw]
jmp 0x10168b5
jle 0x10168b2
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 0x10168cc
cmp dword [ebp - 0x18], 0
je 0x10168cc
push dword [ebp - 8]
call edi
cmp dword [ebp - 0xc], 0
je 0x10168ed
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 0x101693a
mov eax, dword [ebp + 0xc]
test eax, eax
je 0x101693a
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x1016904
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 0x101693a
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1016937
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