Function at 0x1000d990
Capabilities:
Check if file exists
Create directory
Get file attributes
Query environment variable
Write file on windows

Disassembly:
sub esp, 0x310
mov al, 0x6f
push ebp
push esi
mov byte [esp + 0xc], al
mov byte [esp + 0xe], al
push edi
lea eax, [esp + 0x1c]
push 0x100
mov dl, 0x6d
mov cl, 0x63
push eax
push str.ALLUSERSPROFILE
mov byte [esp + 0x18], dl
mov byte [esp + 0x19], 0x69
mov byte [esp + 0x1a], cl
mov byte [esp + 0x1b], 0x72
mov byte [esp + 0x1d], cl
mov byte [esp + 0x1f], 0x73
mov byte [esp + 0x20], dl
mov byte [esp + 0x21], 0
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x1000dc0e
lea edi, [esp + 0x1c]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
cmp byte [esp + ecx + 0x1b], 0x5c
je 0x1000da2b
mov edi, 0x1002b228
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebp, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebp
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ebp, dword [esp + 0x320]
push ebp
call fcn.10001680
lea edi, [esp + 0x10]
or ecx, 0xffffffff
xor eax, eax
add esp, 4
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [esp + 0x1c]
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
lea eax, [esp + 0x1c]
and ecx, 3
push eax
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x1000da8d
lea ecx, [esp + 0x1c]
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
test eax, eax
je 0x1000dc0e
mov edi, str._shellerrorlog.txt
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x1c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov byte [esp + 0x11c], al
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
mov byte [esp + 0x21c], al
lea eax, [esp + 0x11c]
and ecx, 3
push 0x100
push eax
rep movsb byte es:[edi], byte [esi]
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x11c]
push 0x5c
push ecx
call fcn.1001e050
add esp, 8
test eax, eax
je 0x1000db2d
lea edx, [esp + 0x11c]
push 0x5c
push edx
call fcn.1001e050
mov edi, eax
add esp, 8
inc edi
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x21c]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
movsx edx, byte [ebp + 0x1e0f]
movsx eax, byte [ebp + 0x1e10]
lea ecx, [esp + 0x21c]
push ecx
push edx
movsx ecx, byte [ebp + 0x1e11]
movsx edx, word [ebp + 0x1e14]
push eax
push ecx
movsx eax, byte [ebp + 0x1e13]
movsx ecx, byte [ebp + 0x1e12]
push edx
push eax
push ecx
lea edx, [esp + 0x138]
push str._.2d__.2d__.4d__.2d:_.2d:_.2d____s_has_terminated_with_the_message:__n
push edx
call fcn.1001dc70
mov eax, dword [ebp + 0x2902]
add esp, 0x24
lea ecx, [esp + 0x1c]
push 0
push pe_nt_image_headers32
push 4
push eax
push 3
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
je 0x1000dc0e
push ebp
call fcn.100017f0
add esp, 4
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x1000dc07
lea edi, [esp + 0x11c]
or ecx, 0xffffffff
xor eax, eax
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
repne scasb al, byte es:[edi]
not ecx
lea edx, [esp + 0x18]
push 0
dec ecx
push edx
lea eax, [esp + 0x124]
push ecx
push eax
push esi
call ebp
mov edx, dword [esp + 0x324]
lea ecx, [esp + 0x18]
push 0
push ecx
mov edi, edx
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push edx
push esi
call ebp
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
add esp, 0x310
ret