Function at 0x105d21f
Capabilities:
Check if file exists
Get file attributes
Query environment variable

Disassembly:
push ecx
mov eax, dword [0x109aa64]
test eax, eax
je 0x105d238
push eax
call dword [sym.imp.msvcrt.dll_free]
and dword [0x109aa64], 0
pop ecx
push esi
mov esi, dword [esp + 0xc]
test esi, esi
je 0x105d276
cmp byte [esi], 0
je 0x105d276
mov eax, esi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x105d24b
sub eax, ecx
inc eax
push 1
push eax
call dword [sym.imp.msvcrt.dll_calloc]
pop ecx
pop ecx
mov dword [0x109aa64], eax
mov edx, esi
mov cl, byte [edx]
inc edx
mov byte [eax], cl
inc eax
test cl, cl
jne 0x105d267
jmp 0x105d400
push ebp
push edi
mov edi, dword [sym.imp.msvcrt.dll_getenv]
push 0x1005618
xor esi, esi
call edi
mov ebp, eax
test ebp, ebp
pop ecx
mov dword [esp + 0x14], ebp
je 0x105d2a1
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x105d295
sub eax, edx
lea esi, [eax + 2]
push 0x100d78c
call edi
mov edi, eax
test edi, edi
pop ecx
je 0x105d2bf
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x105d2b2
sub eax, edx
lea esi, [esi + eax + 2]
push ebx
push 1
push esi
call dword [sym.imp.msvcrt.dll_calloc]
test edi, edi
pop ecx
pop ecx
mov dword [0x109aa64], eax
mov ebx, 0x100d788
je 0x105d36b
push edi
call dword [sym.imp.msvcrt.dll__strdup]
push ebx
push eax
mov dword [esp + 0x1c], eax
call dword [sym.imp.msvcrt.dll_strtok]
add esp, 0xc
jmp 0x105d356
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x105d34b
test al, 0x10
je 0x105d34b
mov eax, dword [0x109aa64]
cmp byte [eax], 0
je 0x105d323
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x105d310
mov edi, eax
mov esi, ebx
movsw word es:[edi], word [esi]
mov eax, dword [0x109aa64]
mov ecx, ebp
mov esi, ebp
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x105d327
sub ecx, esi
mov ebp, ecx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x105d333
mov ecx, ebp
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push ebx
push 0
call dword [sym.imp.msvcrt.dll_strtok]
pop ecx
pop ecx
mov ebp, eax
test ebp, ebp
jne 0x105d2f5
push dword [esp + 0x10]
call dword [sym.imp.msvcrt.dll_free]
mov ebp, dword [esp + 0x1c]
pop ecx
test ebp, ebp
je 0x105d3fd
push ebp
call dword [sym.imp.msvcrt.dll__strdup]
push ebx
push eax
mov dword [esp + 0x24], eax
call dword [sym.imp.msvcrt.dll_strtok]
add esp, 0xc
jmp 0x105d3ec
push ebp
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x105d3e1
test al, 0x10
je 0x105d3e1
mov eax, dword [0x109aa64]
cmp byte [eax], 0
je 0x105d3b9
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x105d3a6
mov edi, eax
mov esi, ebx
movsw word es:[edi], word [esi]
mov eax, dword [0x109aa64]
mov ecx, ebp
mov esi, ebp
mov dl, byte [ecx]
inc ecx
test dl, dl
jne 0x105d3bd
sub ecx, esi
mov ebp, ecx
dec eax
mov cl, byte [eax + 1]
inc eax
test cl, cl
jne 0x105d3c9
mov ecx, ebp
shr ecx, 2
mov edi, eax
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push ebx
push 0
call dword [sym.imp.msvcrt.dll_strtok]
pop ecx
pop ecx
mov ebp, eax
test ebp, ebp
jne 0x105d38b
push dword [esp + 0x18]
call dword [sym.imp.msvcrt.dll_free]
pop ecx
pop ebx
pop edi
pop ebp
pop esi
pop ecx
ret 4