Function at 0x1001b87
Capabilities:
Check if file exists
Get common file path
Get file attributes
Query environment variable

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xf4c
mov eax, dword [0x1005044]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0xc]
push esi
push edi
xor edi, edi
push edi
push edi
mov dword [ebp - 0xf20], eax
xor eax, eax
push 1
push edi
mov dword [ebp - 0xf34], edi
mov dword [ebp - 0xf2c], edi
mov dword [ebp - 0xf30], edi
mov word [0x1005a98], ax
mov word [0x1005888], ax
mov word [0x1005270], ax
mov word [0x1005068], ax
mov byte [ebp - 0xf0d], al
call dword [sym.imp.KERNEL32.dll_HeapSetInformation]
push edi
push edi
push 0x100
call dword [sym.imp.KERNEL32.dll_SetThreadPreferredUILanguages]
mov esi, 0x1005ca0
push esi
call fcn.01001993
push 0x10013a8
mov dword [0x1005ce0], 0x10011ac
mov dword [0x1005ce4], 0x10011bc
mov dword [section..data], esi
call fcn.01001a7b
push 0x10013a6
push edi
call dword [sym.imp.msvcrt.dll_setlocale]
pop ecx
pop ecx
push 0x64
lea eax, [ebp - 0xcc]
push eax
push 0x1001388
mov dword [ebp - 0xf28], edi
call fcn.01002d26
test eax, eax
je 0x1001c61
lea eax, [ebp - 0xcc]
push eax
push 0x22
push edi
call fcn.01002aaa
add esp, 0xc
jmp 0x1001c6b
push 0x23
push edi
call fcn.01002aaa
pop ecx
pop ecx
push 0x24
push edi
call fcn.01002aaa
cmp dword [ebp + 8], 2
pop ecx
pop ecx
jge 0x1001c8d
call fcn.01002c1f
call fcn.01001ac8
xor eax, eax
inc eax
jmp 0x1002447
xor eax, eax
push ebx
push 0x616
mov word [ebp - 0xaf4], ax
mov word [ebp - 0xf04], ax
mov word [ebp - 0xcfc], ax
mov word [ebp - 0x2d4], ax
mov word [ebp - 0x8ec], ax
lea eax, [ebp - 0x8ea]
push edi
push eax
call sub.msvcrt.dll_memset
mov eax, dword [ebp + 8]
xor ecx, ecx
inc ecx
add esp, 0xc
dec eax
cmp eax, ecx
mov byte [ebp - 0xf0e], 0
mov byte [ebp - 0xf0f], 0
mov dword [ebp - 0xf0c], edi
mov dword [ebp - 0xf14], edi
mov dword [ebp - 0xf08], 8
mov dword [ebp - 0xf18], ecx
mov ebx, 0x30c
jle 0x100236f
mov eax, dword [ebp - 0xf20]
mov ecx, dword [ebp - 0xf18]
lea edi, [eax + ecx*4]
mov eax, dword [edi]
cmp word [eax], 0x2d
lea esi, [eax + 2]
je 0x1001d2a
cmp word [eax], 0x2f
jne 0x1002439
push 0x100137c
push esi
call fcn.010017b0
test eax, eax
jne 0x1001d45
or dword [ebp - 0xf08], 1
jmp 0x1002357
push 0x1001364
push esi
call fcn.010017b0
test eax, eax
jne 0x1001d60
or dword [ebp - 0xf08], 2
jmp 0x1002357
push 3
push 0x100135c
push esi
call fcn.01001880
test eax, eax
jne 0x1001daf
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1001d76
sub eax, edx
sar eax, 1
cmp eax, 3
jbe 0x1002439
add esi, 6
push esi
push 0x104
push 0x1005068
mov dword [ebp - 0xf34], 1
call fcn.01001b0c
jmp 0x1002357
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x4c
jne 0x1001dea
cmp word [esi + 2], 0x3a
jne 0x1001dea
add esi, 4
push esi
mov dword [ebp - 0xf2c], 1
call dword [sym.imp.msvcrt.dll__wtoi]
movzx eax, ax
pop ecx
mov dword [ebp - 0xf30], eax
jmp 0x1002357
push 0x1001354
push esi
call fcn.010017b0
test eax, eax
jne 0x1001e22
push 2
push eax
push 0x1001338
call dword [sym.imp.KERNEL32.dll_LoadLibraryExW]
test eax, eax
je 0x100242c
push eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
or dword [ebp - 0xf08], 4
jmp 0x1002357
push 0x1001314
push esi
call fcn.010017b0
test eax, eax
jne 0x1001e3d
or dword [ebp - 0xf0c], 1
jmp 0x1002357
push 0x10012f0
push esi
call fcn.010017b0
test eax, eax
jne 0x1001e58
or dword [ebp - 0xf0c], 2
jmp 0x1002357
push 0x10012cc
push esi
call fcn.010017b0
test eax, eax
jne 0x1001e73
or dword [ebp - 0xf0c], 0x20
jmp 0x1002357
push 0x10012a8
push esi
call fcn.010017b0
test eax, eax
jne 0x1001e8e
or dword [ebp - 0xf0c], 0x40
jmp 0x1002357
push 0x1001280
push esi
call fcn.010017b0
test eax, eax
jne 0x1001eb8
cmp dword [ebp - 0xf14], eax
jne 0x1002439
mov dword [ebp - 0xf14], 1
jmp 0x1002357
push 0x1001258
push esi
call fcn.010017b0
test eax, eax
jne 0x1001ee2
cmp dword [ebp - 0xf14], eax
jne 0x1002439
mov dword [ebp - 0xf14], 2
jmp 0x1002357
push 0xa
push 0x1001240
push esi
call fcn.01001880
test eax, eax
jne 0x1001fbc
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1001efc
sub eax, edx
sar eax, 1
cmp eax, 0xa
jbe 0x1002439
push 0x1001238
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b46
mov edi, eax
test edi, edi
jge 0x1001f63
push edi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x1001f63
test byte [eax + 0x1c], 1
je 0x1001f63
cmp byte [eax + 0x19], 2
jb 0x1001f63
push edi
push 0x10011cc
push 0xa
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
add esi, 0x14
push esi
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b46
mov esi, eax
test esi, esi
jge 0x1002166
push esi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x1002166
test byte [eax + 0x1c], 1
je 0x1002166
cmp byte [eax + 0x19], 2
jb 0x1002166
push esi
push 0x10011cc
push 0xb
jmp 0x100215b
push 4
push 0x100122c
push esi
call fcn.01001880
test eax, eax
jne 0x1002096
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1001fd6
sub eax, edx
sar eax, 1
cmp eax, 4
jbe 0x1002439
push 0x1001224
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b46
mov edi, eax
test edi, edi
jge 0x100203d
push edi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x100203d
test byte [eax + 0x1c], 1
je 0x100203d
cmp byte [eax + 0x19], 2
jb 0x100203d
push edi
push 0x10011cc
push 0xc
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
add esi, 8
push esi
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b46
mov esi, eax
test esi, esi
jge 0x1002166
push esi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x1002166
test byte [eax + 0x1c], 1
je 0x1002166
cmp byte [eax + 0x19], 2
jb 0x1002166
push esi
push 0x10011cc
push 0xd
jmp 0x100215b
push 4
push 0x1001218
push esi
call fcn.01001880
test eax, eax
jne 0x1002172
mov eax, esi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x10020b0
sub eax, edx
sar eax, 1
cmp eax, 4
jbe 0x1002439
push 0x1001210
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b46
mov edi, eax
test edi, edi
jge 0x1002117
push edi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x1002117
test byte [eax + 0x1c], 1
je 0x1002117
cmp byte [eax + 0x19], 2
jb 0x1002117
push edi
push 0x10011cc
push 0xe
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
add esi, 8
push esi
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b46
mov esi, eax
test esi, esi
jge 0x1002166
push esi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x1002166
test byte [eax + 0x1c], 1
je 0x1002166
cmp byte [eax + 0x19], 2
jb 0x1002166
push esi
push 0x10011cc
push 0xf
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
or dword [ebp - 0xf08], 0x20
jmp 0x1002357
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x43
jne 0x10021b4
cmp word [esi + 2], 0x3a
jne 0x10021b4
cmp dword [ebp - 0xf0c], 0
jne 0x1002439
add esi, 4
push esi
mov byte [ebp - 0xf0e], 1
call dword [sym.imp.msvcrt.dll__wtol]
pop ecx
mov dword [ebp - 0xf0c], eax
jmp 0x1002357
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x49
jne 0x10021f6
cmp word [esi + 2], 0x3a
jne 0x10021f6
cmp dword [ebp - 0xf14], 0
jne 0x1002439
add esi, 4
push esi
mov byte [ebp - 0xf0f], 1
call dword [sym.imp.msvcrt.dll__wtol]
pop ecx
mov dword [ebp - 0xf14], eax
jmp 0x1002357
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x4e
jne 0x1002212
lea eax, [ebp - 0x2d4]
jmp 0x1002343
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x42
jne 0x10022c8
mov edi, dword [edi]
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x100222e
sub eax, edx
sar eax, 1
cmp eax, 3
jbe 0x1002439
cmp word [edi + 4], 0x3a
jne 0x1002439
lea eax, [ebp - 0x8ec]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1002259
sub eax, edx
sar eax, 1
jne 0x1002439
add edi, 6
push edi
push ebx
lea eax, [ebp - 0x8ec]
push eax
call fcn.01001b0c
mov esi, eax
test esi, esi
jge 0x10022bc
push esi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x10022bc
test byte [eax + 0x1c], 1
je 0x10022bc
cmp byte [eax + 0x19], 2
jb 0x10022bc
push esi
push 0x10011cc
push 0x10
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
mov byte [ebp - 0xf0d], 1
jmp 0x1002357
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x55
jne 0x10022e1
lea eax, [ebp - 0xaf4]
jmp 0x1002343
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x50
jne 0x1002328
mov edi, dword [edi]
cmp word [edi + 4], 0x3a
jne 0x1002302
cmp word [edi + 6], 0
je 0x100231a
lea eax, [ebp - 0xf04]
push eax
add edi, 4
push edi
call fcn.01002ebc
test eax, eax
je 0x100243e
lea eax, [ebp - 0xf04]
mov dword [ebp - 0xf28], eax
jmp 0x1002357
movzx eax, word [esi]
push eax
call dword [sym.imp.msvcrt.dll_towupper]
pop ecx
cmp ax, 0x41
jne 0x1002439
lea eax, [ebp - 0xcfc]
push eax
mov eax, dword [edi]
add eax, 4
push eax
call fcn.01002ebc
test eax, eax
je 0x100243e
inc dword [ebp - 0xf18]
mov eax, dword [ebp + 8]
dec eax
cmp dword [ebp - 0xf18], eax
jl 0x1001d06
xor edi, edi
lea eax, [ebp - 0x8ec]
push eax
push ebx
push 0x1005270
call fcn.01001b0c
mov esi, eax
cmp esi, edi
jge 0x10023bf
push esi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x10023bf
test byte [eax + 0x1c], 1
je 0x10023bf
cmp byte [eax + 0x19], 2
jb 0x10023bf
push esi
push 0x10011cc
push 0x11
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
xor ebx, ebx
inc ebx
cmp byte [ebp - 0xf0e], 0
jne 0x10023df
push dword [ebp - 0xf0c]
push ebx
call fcn.01002991
test al, al
je 0x1002492
cmp byte [ebp - 0xf0f], 0
jne 0x10023fc
push dword [ebp - 0xf14]
push edi
call fcn.01002991
test al, al
je 0x1002492
test byte [ebp - 0xf08], 4
je 0x1002455
lea eax, [ebp - 0x8ec]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
cmp cx, di
jne 0x100240e
sub eax, edx
sar eax, 1
cmp eax, ebx
jae 0x1002455
push 0x1b
push ebx
call fcn.01002aaa
pop ecx
pop ecx
jmp 0x1002497
push 0x1e
push 1
call fcn.01002aaa
pop ecx
pop ecx
jmp 0x100243e
call fcn.01002c1f
call fcn.01001ac8
xor eax, eax
inc eax
pop ebx
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.01003565
leave
ret
mov eax, dword [ebp - 0xf20]
mov ecx, dword [ebp + 8]
lea esi, [eax + ecx*4 - 4]
mov eax, dword [esi]
movzx ecx, word [eax]
cmp cx, 0x2d
je 0x1002473
cmp cx, 0x2f
jne 0x1002480
cmp word [eax + 2], 0x3f
jne 0x1002480
cmp word [eax + 4], di
je 0x1002492
test byte [ebp - 0xf08], 0x20
je 0x10024a0
cmp byte [ebp - 0xf0d], 0
je 0x10024a0
call fcn.01002c1f
call fcn.01001ac8
mov eax, ebx
jmp 0x1002446
push eax
mov ebx, 0x104
push ebx
push 0x1005a98
call fcn.01001b0c
mov edi, eax
test edi, edi
jge 0x10024ef
push edi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x10024ef
test byte [eax + 0x1c], 1
je 0x10024ef
cmp byte [eax + 0x19], 2
jb 0x10024ef
push edi
push 0x10011cc
push 0x12
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
mov eax, dword [esi]
push ebx
mov esi, 0x1005888
push esi
push eax
mov dword [0x1005ce8], eax
call dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsW]
test eax, eax
jne 0x1002557
push dword [0x1005ce8]
push 0x105
push esi
call fcn.01001b0c
mov edi, eax
test edi, edi
jge 0x1002557
push edi
call sub.wbemcomn.dll_class_CMemoryLog____stdcall_GetMemLogObject_void_
mov ecx, eax
call sub.wbemcomn.dll_public:_void___thiscall_CMemoryLog::Write_long_int_
mov eax, dword [section..data]
cmp eax, section..data
je 0x1002557
test byte [eax + 0x1c], 1
je 0x1002557
cmp byte [eax + 0x19], 2
jb 0x1002557
push edi
push 0x10011cc
push 0x13
push dword [eax + 0x14]
push dword [eax + 0x10]
call fcn.01001967
push esi
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x100257e
push esi
xor esi, esi
push 0x1d
inc esi
push esi
call fcn.01002aaa
add esp, 0xc
call fcn.01001ac8
mov eax, esi
jmp 0x1002446
call fcn.01003b6d
test eax, eax
jge 0x1002599
push eax
push 0x26
push 1
call fcn.01002aaa
add esp, 0xc
push 3
pop esi
jmp 0x1002572
xor edi, edi
push edi
push edi
push edi
push 2
push edi
push edi
push edi
push 0xffffffffffffffff
push edi
call fcn.01003b7d
lea eax, [ebp - 0xf1c]
push eax
push 0x10016a8
push 1
push edi
mov dword [ebp - 0xf1c], edi
mov edi, dword [sym.imp.ole32.dll_CoCreateInstance]
mov ebx, 0x1001638
push ebx
call edi
mov dword [ebp - 0xf20], eax
test eax, eax
je 0x100267c
push 0x208
call fcn.010031e4
pop ecx
mov dword [ebp - 0xf18], eax
test eax, eax
je 0x100266f
push 0x104
push eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryW]
test eax, eax
je 0x1002663
push 0x10011f0
push 0x104
push dword [ebp - 0xf18]
call fcn.01001b46
push dword [ebp - 0xf18]
call dword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov dword [ebp - 0xf24], eax
test eax, eax
je 0x1002663
push 0x10011dc
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
test eax, eax
je 0x1002657
call eax
lea eax, [ebp - 0xf1c]
push eax
push 0x10016a8
push 1
push 0
push ebx
call edi
mov dword [ebp - 0xf20], eax
push dword [ebp - 0xf24]
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
push dword [ebp - 0xf18]
call fcn.01003182
pop ecx
cmp dword [ebp - 0xf20], 0
jne 0x10027b7
lea eax, [ebp - 0x8ec]
lea edx, [eax + 2]
mov cx, word [eax]
inc eax
inc eax
test cx, cx
jne 0x1002685
sub eax, edx
sar eax, 1
je 0x10026cc
mov eax, dword [ebp - 0xf1c]
mov ecx, dword [eax]
lea edx, [ebp - 0xf4c]
push edx
push dword [ebp - 0xf14]
lea edx, [ebp - 0x2d4]
push dword [ebp - 0xf0c]
push dword [ebp - 0xf08]
push edx
push 0x1005270
push esi
push eax
call dword [ecx + 0x14]
jmp 0x1002769
cmp dword [ebp - 0xf34], 0
je 0x1002728
push dword [ebp - 0xf30]
lea eax, [ebp - 0xf4c]
push dword [ebp - 0xf2c]
push eax
push dword [ebp - 0xf14]
lea eax, [ebp - 0xcfc]
push dword [ebp - 0xf0c]
push dword [ebp - 0xf08]
push dword [ebp - 0xf28]
push eax
lea eax, [ebp - 0xaf4]
push eax
lea eax, [ebp - 0x2d4]
push eax
push esi
push 0x1005068
push dword [ebp - 0xf1c]
call fcn.01002fe3
jmp 0x1002769
mov eax, dword [ebp - 0xf1c]
mov ecx, dword [eax]
lea edx, [ebp - 0xf4c]
push edx
push dword [ebp - 0xf14]
lea edx, [ebp - 0xcfc]
push dword [ebp - 0xf0c]
push dword [ebp - 0xf08]
push dword [ebp - 0xf28]
push edx
lea edx, [ebp - 0xaf4]
push edx
lea edx, [ebp - 0x2d4]
push edx
push esi
push eax
call dword [ecx + 0xc]
mov esi, eax
test esi, esi
je 0x1002781
push dword [ebp - 0xf48]
push 0x27
push 1
call fcn.01002aaa
add esp, 0xc
mov eax, dword [ebp - 0xf1c]
mov ecx, dword [eax]
push eax
call dword [ecx + 8]
call dword [sym.imp.ole32.dll_CoUninitialize]
test esi, esi
jne 0x10027a7
push 0x20
push 1
call fcn.01002aaa
pop ecx
pop ecx
jmp 0x1002572
call fcn.01001ac8
mov eax, dword [ebp - 0xf4c]
jmp 0x1002446
push dword [ebp - 0xf20]
push 0x25
jmp 0x100258a