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

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xa34
mov eax, dword [0x1004024]
push ebx
push esi
xor esi, esi
push edi
mov edi, dword [sym.imp.msvcrt.dll_setlocale]
mov ebx, 0x100125a
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov dword [ebp - 0xa08], eax
mov dword [ebp - 0xa14], esi
mov dword [ebp - 0xa18], esi
mov dword [ebp - 0xa1c], esi
mov byte [0x1004868], 0
mov word [0x1004658], si
mov word [0x1004450], si
mov word [0x1004248], si
mov word [0x1004040], si
mov byte [ebp - 0x9fa], 0
call edi
pop ecx
pop ecx
push 0x64
lea eax, [ebp - 0x1d0]
push eax
push 0x100123c
mov dword [ebp - 0xa10], esi
call fcn.0100210e
test eax, eax
je 0x1001811
lea eax, [ebp - 0x1d0]
push eax
push 0x22
push esi
call fcn.01002367
add esp, 0xc
jmp 0x100181b
push 0x23
push esi
call fcn.01002367
pop ecx
pop ecx
push 0x24
push esi
call fcn.01002367
cmp dword [ebp + 8], 2
pop ecx
pop ecx
jge 0x1001838
call fcn.0100242e
xor eax, eax
inc eax
jmp 0x1002096
push ebx
push esi
call edi
pop ecx
pop ecx
xor eax, eax
push 0x40
mov byte [ebp - 0x108], 0
pop ecx
lea edi, [ebp - 0x107]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
xor ecx, ecx
stosb byte es:[edi], al
mov eax, dword [ebp + 8]
inc ecx
dec eax
cmp eax, ecx
mov word [ebp - 0x5e0], si
mov word [ebp - 0x9f0], si
mov word [ebp - 0x7e8], si
mov word [ebp - 0x3d8], si
mov byte [ebp - 0x9f9], 0
mov byte [ebp - 0x9fb], 0
mov dword [ebp - 0x9f8], esi
mov dword [ebp - 0xa00], esi
mov dword [ebp - 0x9f4], 8
mov dword [ebp - 0xa04], ecx
jle 0x1001d96
mov eax, dword [ebp - 0xa08]
mov ecx, dword [ebp - 0xa04]
lea edi, [eax + ecx*4]
mov eax, dword [edi]
cmp byte [eax], 0x2d
lea ebx, [eax + 1]
je 0x10018cc
cmp byte [eax], 0x2f
jne 0x100182b
push 0x1001234
push ebx
call fcn.010015c0
test eax, eax
jne 0x10018e7
or dword [ebp - 0x9f4], 1
jmp 0x1001d77
push 0x1001228
push ebx
call fcn.010015c0
test eax, eax
jne 0x1001902
or dword [ebp - 0x9f4], 2
jmp 0x1001d77
push 3
push 0x1001224
push ebx
call fcn.01001690
test eax, eax
jne 0x1001950
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001918
sub eax, edx
cmp eax, 3
jbe 0x100182b
push 0x104
add ebx, 3
push ebx
push 0x1004040
mov dword [ebp - 0xa14], 1
call dword [sym.imp.msvcrt.dll_mbstowcs]
add esp, 0xc
jmp 0x1001d77
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x4c
pop ecx
jne 0x1001986
cmp byte [ebx + 1], 0x3a
jne 0x1001986
add ebx, 2
push ebx
mov dword [ebp - 0xa18], 1
call dword [sym.imp.msvcrt.dll_atoi]
pop ecx
mov dword [ebp - 0xa1c], eax
jmp 0x1001d77
push 0x1001220
push ebx
call fcn.010015c0
test eax, eax
jne 0x10019be
push 2
push esi
push 0x1001204
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
cmp eax, esi
je 0x1001dab
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
or dword [ebp - 0x9f4], 4
jmp 0x1001d77
push 0x10011f0
push ebx
call fcn.010015c0
test eax, eax
jne 0x10019d9
or dword [ebp - 0x9f8], 1
jmp 0x1001d77
push 0x10011dc
push ebx
call fcn.010015c0
test eax, eax
jne 0x10019f4
or dword [ebp - 0x9f8], 2
jmp 0x1001d77
push 0x10011c8
push ebx
call fcn.010015c0
test eax, eax
jne 0x1001a0f
or dword [ebp - 0x9f8], 0x20
jmp 0x1001d77
push 0x10011b4
push ebx
call fcn.010015c0
test eax, eax
jne 0x1001a2a
or dword [ebp - 0x9f8], 0x40
jmp 0x1001d77
push 0x10011a0
push ebx
call fcn.010015c0
test eax, eax
jne 0x1001a54
cmp dword [ebp - 0xa00], esi
jne 0x100182b
mov dword [ebp - 0xa00], 1
jmp 0x1001d77
push 0x100118c
push ebx
call fcn.010015c0
test eax, eax
jne 0x1001a7e
cmp dword [ebp - 0xa00], esi
jne 0x100182b
mov dword [ebp - 0xa00], 2
jmp 0x1001d77
push 0xa
push 0x1001180
push ebx
call fcn.01001690
test eax, eax
jne 0x1001b14
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001a98
sub eax, edx
cmp eax, 0xa
jbe 0x100182b
lea edi, [ebp - 0x108]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1001ab1
mov esi, 0x100117c
movsw word es:[edi], word [esi]
lea eax, [ebx + 0xa]
movsb byte es:[edi], byte [esi]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001ac6
lea edi, [ebp - 0x108]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x1001ad6
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push 0x104
lea eax, [ebp - 0x108]
push eax
and ecx, 3
push 0x1004248
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.msvcrt.dll_mbstowcs]
add esp, 0xc
or dword [ebp - 0x9f4], 0x20
xor esi, esi
jmp 0x1001d77
push 4
push 0x1001174
push ebx
call fcn.01001690
test eax, eax
jne 0x1001b75
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001b2a
sub eax, edx
cmp eax, 4
jbe 0x100182b
lea edi, [ebp - 0x108]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1001b43
mov esi, 0x1001170
movsw word es:[edi], word [esi]
lea eax, [ebx + 4]
movsb byte es:[edi], byte [esi]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001b58
lea edi, [ebp - 0x108]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x1001b68
jmp 0x1001ade
push 4
push 0x1001168
push ebx
call fcn.01001690
test eax, eax
jne 0x1001bd6
mov eax, ebx
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001b8b
sub eax, edx
cmp eax, 4
jbe 0x100182b
lea edi, [ebp - 0x108]
dec edi
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x1001ba4
mov esi, 0x1001164
movsw word es:[edi], word [esi]
lea eax, [ebx + 4]
movsb byte es:[edi], byte [esi]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001bb9
lea edi, [ebp - 0x108]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x1001bc9
jmp 0x1001ade
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x43
pop ecx
jne 0x1001c15
cmp byte [ebx + 1], 0x3a
jne 0x1001c15
cmp dword [ebp - 0x9f8], esi
jne 0x100182b
add ebx, 2
push ebx
mov byte [ebp - 0x9f9], 1
call dword [sym.imp.msvcrt.dll_atol]
pop ecx
mov dword [ebp - 0x9f8], eax
jmp 0x1001d77
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x49
pop ecx
jne 0x1001c54
cmp byte [ebx + 1], 0x3a
jne 0x1001c54
cmp dword [ebp - 0xa00], esi
jne 0x100182b
add ebx, 2
push ebx
mov byte [ebp - 0x9fb], 1
call dword [sym.imp.msvcrt.dll_atol]
pop ecx
mov dword [ebp - 0xa00], eax
jmp 0x1001d77
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x4e
pop ecx
jne 0x1001c6f
lea eax, [ebp - 0x3d8]
jmp 0x1001d64
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x42
pop ecx
jne 0x1001cee
mov ecx, dword [edi]
mov eax, ecx
lea esi, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x1001c86
sub eax, esi
cmp eax, 3
jbe 0x100182b
cmp byte [ecx + 2], 0x3a
jne 0x100182b
mov esi, 0x1004248
push esi
call dword [sym.imp.msvcrt.dll_wcslen]
test eax, eax
pop ecx
jne 0x100182b
mov eax, dword [edi]
add eax, 3
lea edx, [ebp - 0x108]
mov cl, byte [eax]
inc eax
mov byte [edx], cl
inc edx
test cl, cl
jne 0x1001cc2
push 0x104
lea eax, [ebp - 0x108]
push eax
push esi
call dword [sym.imp.msvcrt.dll_mbstowcs]
add esp, 0xc
mov byte [ebp - 0x9fa], 1
jmp 0x1001b0d
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x55
pop ecx
jne 0x1001d06
lea eax, [ebp - 0x5e0]
jmp 0x1001d64
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x50
pop ecx
jne 0x1001d4a
mov edi, dword [edi]
cmp byte [edi + 2], 0x3a
jne 0x1001d24
cmp byte [edi + 3], 0
je 0x1001d3c
lea eax, [ebp - 0x9f0]
push eax
add edi, 2
push edi
call fcn.0100253e
test eax, eax
je 0x1001830
lea eax, [ebp - 0x9f0]
mov dword [ebp - 0xa10], eax
jmp 0x1001d77
movsx eax, byte [ebx]
push eax
call dword [sym.imp.msvcrt.dll_toupper]
cmp eax, 0x41
pop ecx
jne 0x100182b
lea eax, [ebp - 0x7e8]
push eax
mov eax, dword [edi]
inc eax
inc eax
push eax
call fcn.0100253e
test eax, eax
je 0x1001830
inc dword [ebp - 0xa04]
mov eax, dword [ebp + 8]
dec eax
cmp dword [ebp - 0xa04], eax
jl 0x10018aa
cmp byte [ebp - 0x9f9], 0
jne 0x1001dbb
push dword [ebp - 0x9f8]
xor edi, edi
inc edi
push edi
call fcn.01002315
test al, al
je 0x1001dd7
jmp 0x1001dbe
push 0x1e
push 1
call fcn.01002367
pop ecx
pop ecx
jmp 0x1001830
xor edi, edi
inc edi
cmp byte [ebp - 0x9fb], 0
jne 0x1001de3
push dword [ebp - 0xa00]
push esi
call fcn.01002315
test al, al
jne 0x1001de3
call fcn.0100242e
mov eax, edi
jmp 0x1002096
test byte [ebp - 0x9f4], 4
je 0x1001e0e
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001df5
sub eax, edx
cmp eax, edi
jae 0x1001e0e
push 0x1b
push edi
call fcn.01002367
pop ecx
pop ecx
jmp 0x1001ddc
mov eax, dword [ebp - 0xa08]
mov ecx, dword [ebp + 8]
lea ecx, [eax + ecx*4 - 4]
mov eax, dword [ecx]
mov dl, byte [eax]
cmp dl, 0x2d
je 0x1001e29
cmp dl, 0x2f
jne 0x1001e35
cmp byte [eax + 1], 0x3f
jne 0x1001e35
cmp byte [eax + 2], 0
je 0x1001dd7
test byte [ebp - 0x9f4], 0x20
je 0x1001e47
cmp byte [ebp - 0x9fa], 0
jne 0x1001dd7
mov edi, 0x1004868
mov dl, byte [eax]
inc eax
mov byte [edi], dl
inc edi
test dl, dl
jne 0x1001e4c
mov edi, 0x104
push edi
push dword [ecx]
mov ebx, 0x1004450
push ebx
call dword [sym.imp.msvcrt.dll_mbstowcs]
add esp, 0xc
push edi
mov edi, 0x1004658
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x1001e87
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_lstrcpyW]
push edi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x1001ea5
push edi
push 0x1d
push 1
call fcn.01002367
add esp, 0xc
jmp 0x1001830
call fcn.01002b7d
cmp eax, esi
jge 0x1001eb6
push eax
push 0x26
jmp 0x1002089
xor esi, esi
push esi
push esi
push esi
push 2
push esi
push esi
push esi
push 0xffffffffffffffff
push esi
call fcn.01002b8d
mov ebx, dword [sym.imp.ole32.dll_CoCreateInstance]
lea eax, [ebp - 0xa0c]
push eax
push 0x100150c
push 1
push esi
mov dword [ebp - 0xa0c], esi
mov esi, 0x100149c
push esi
call ebx
test eax, eax
mov dword [ebp - 0xa04], eax
je 0x1001f4e
push 0x1001150
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
test eax, eax
mov dword [ebp - 0xa08], eax
je 0x1001f41
push 0x100113c
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x1001f35
call eax
lea eax, [ebp - 0xa0c]
push eax
push 0x100150c
push 1
push 0
push esi
call ebx
mov dword [ebp - 0xa04], eax
push dword [ebp - 0xa08]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
cmp dword [ebp - 0xa04], 0
jne 0x1002081
lea eax, [ebp - 0x108]
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x1001f57
sub eax, edx
mov dword [ebp - 0xa08], eax
je 0x1001f9f
mov eax, dword [ebp - 0xa0c]
mov ecx, dword [eax]
lea edx, [ebp - 0xa34]
push edx
push dword [ebp - 0xa00]
lea edx, [ebp - 0x3d8]
push dword [ebp - 0x9f8]
push dword [ebp - 0x9f4]
push edx
push 0x1004248
push edi
push eax
call dword [ecx + 0x14]
jmp 0x100203c
cmp dword [ebp - 0xa14], 0
je 0x1001ffb
push dword [ebp - 0xa1c]
lea eax, [ebp - 0xa34]
push dword [ebp - 0xa18]
push eax
push dword [ebp - 0xa00]
lea eax, [ebp - 0x7e8]
push dword [ebp - 0x9f8]
push dword [ebp - 0x9f4]
push dword [ebp - 0xa10]
push eax
lea eax, [ebp - 0x5e0]
push eax
lea eax, [ebp - 0x3d8]
push eax
push edi
push 0x1004040
push dword [ebp - 0xa0c]
call fcn.01002676
jmp 0x100203c
mov eax, dword [ebp - 0xa0c]
mov ecx, dword [eax]
lea edx, [ebp - 0xa34]
push edx
push dword [ebp - 0xa00]
lea edx, [ebp - 0x7e8]
push dword [ebp - 0x9f8]
push dword [ebp - 0x9f4]
push dword [ebp - 0xa10]
push edx
lea edx, [ebp - 0x5e0]
push edx
lea edx, [ebp - 0x3d8]
push edx
push edi
push eax
call dword [ecx + 0xc]
mov esi, eax
test esi, esi
je 0x1002054
push dword [ebp - 0xa30]
push 0x27
push 1
call fcn.01002367
add esp, 0xc
mov eax, dword [ebp - 0xa0c]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
call dword [sym.imp.ole32.dll_CoUninitialize]
test esi, esi
jne 0x1002079
push 0x20
push 1
call fcn.01002367
pop ecx
pop ecx
xor eax, eax
jmp 0x1002096
mov eax, dword [ebp - 0xa34]
jmp 0x1002096
push dword [ebp - 0xa04]
push 0x25
push 1
call fcn.01002367
add esp, 0xc
push 3
pop eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.010027ef
leave
ret