Function at 0x103c27d
Capabilities:
Check if file exists
Get common file path
Get file attributes
Query environment variable
Set current directory

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x328
mov eax, dword [0x1099a38]
push ebx
push esi
mov ebx, 0x104
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push ebx
push 0x10c64c0
mov dword [ebp - 0x318], eax
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
jne 0x103c2cc
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
push eax
push 0x100f994
call fcn.010430af
pop ecx
pop ecx
call esi
jmp 0x103c99a
cmp eax, ebx
jb 0x103c2e6
push 0x6f
push 0x100f960
call fcn.010430af
pop ecx
pop ecx
push 0x6f
pop eax
jmp 0x103c99a
xor eax, eax
mov cl, byte [eax + 0x10c64c0]
mov byte [eax + 0x10f54c0], cl
inc eax
test cl, cl
jne 0x103c2e8
push edi
mov edi, dword [sym.imp.msvcrt.dll_strrchr]
push 0x5c
mov esi, 0x10f54c0
push esi
call edi
test eax, eax
pop ecx
pop ecx
je 0x103c313
mov byte [eax], 0
push esi
call dword [sym.imp.msvcrt.dll__mbslwr]
pop ecx
push esi
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
push ebx
push 0x10c6920
push 0x100f94c
push esi
call fcn.01070fc9
push ebx
push 0x10c6040
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
xor eax, eax
mov cl, byte [eax + 0x10c6040]
mov byte [ebp + eax - 0x108], cl
inc eax
test cl, cl
jne 0x103c343
jmp 0x103c397
push ebx
lea eax, [ebp - 0x20c]
push eax
push 0xf0a5
push 0
call fcn.010312a2
lea eax, [ebp - 0x20c]
mov ecx, esi
mov edx, eax
sub ecx, edx
inc ecx
mov dl, byte [eax]
mov byte [ecx + eax], dl
inc eax
test dl, dl
jne 0x103c378
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x103c3ac
mov byte [esi], 0
lea eax, [ebp - 0x108]
push 0x5c
push eax
call edi
mov esi, eax
test esi, esi
pop ecx
pop ecx
jne 0x103c357
jmp 0x103c3c3
xor eax, eax
mov cl, byte [ebp + eax - 0x108]
mov byte [eax + 0x10c6800], cl
inc eax
test cl, cl
jne 0x103c3ae
mov byte [esi + 1], cl
xor eax, eax
mov cl, byte [eax + 0x10c6040]
mov byte [ebp + eax - 0x108], cl
inc eax
test cl, cl
jne 0x103c3c5
lea eax, [ebp - 0x108]
push 0x5c
push eax
call edi
jmp 0x103c41e
mov edi, dword [ebp - 0x314]
inc edi
mov esi, 0x100f940
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
lea eax, [ebp - 0x108]
push eax
movsw word es:[edi], word [esi]
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
mov eax, dword [ebp - 0x314]
jne 0x103c45f
mov byte [eax], 0
lea eax, [ebp - 0x108]
push 0x5c
push eax
call dword [sym.imp.msvcrt.dll_strrchr]
test eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x314], eax
jne 0x103c3e4
and dword [0x109951c], eax
push 4
push 0x1000
push 0x10000
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
test eax, eax
mov dword [0x10f6820], eax
jne 0x103c465
push 0x100f914
call fcn.01071aad
push 8
pop eax
jmp 0x103c999
mov byte [eax + 1], 0
jmp 0x103c430
call fcn.01078999
push ebx
mov esi, 0x10c6040
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
push esi
call dword [sym.imp.msvcrt.dll__mbslwr]
mov dword [esp], 0x100f900
push esi
call dword [sym.imp.msvcrt.dll_strstr]
test eax, eax
pop ecx
pop ecx
jne 0x103c4a8
push 0x100f8d0
call fcn.01071aad
mov eax, 0xf00c
jmp 0x103c999
push esi
mov byte [eax + 1], 0
call fcn.0102f82c
push ebx
lea eax, [ebp - 0x310]
push eax
push 0x100f8bc
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
xor edi, edi
inc edi
test eax, eax
je 0x103c551
xor eax, eax
mov cl, byte [eax + 0x10c6040]
mov byte [ebp + eax - 0x20c], cl
inc eax
test cl, cl
jne 0x103c4d2
push 0x5c
lea eax, [ebp - 0x20c]
push eax
call fcn.0104fdc1
push 0x5c
lea eax, [ebp - 0x310]
push eax
call fcn.0104fdc1
lea eax, [ebp - 0x20c]
push eax
lea eax, [ebp - 0x310]
push eax
call dword [sym.imp.msvcrt.dll__stricmp]
test eax, eax
pop ecx
pop ecx
jne 0x103c522
mov dword [0x109a02c], edi
jmp 0x103c551
lea eax, [ebp - 0x310]
push eax
push 0x100f8a4
call fcn.01071ac0
lea eax, [ebp - 0x20c]
push eax
push 0x100f88c
call fcn.01071ac0
push 0x100f870
call fcn.01071ac0
add esp, 0x14
mov byte [0x10f5700], 0
call fcn.01073631
cmp eax, edi
jne 0x103c572
push ebx
push 0x10f5700
push 0x100f864
push esi
call fcn.01070fc9
push ebx
mov edi, 0x109a4a0
push edi
push 0x100f858
push 0x10f54c0
call fcn.01070fc9
mov eax, edi
lea ecx, [eax + 1]
mov dl, byte [eax]
inc eax
test dl, dl
jne 0x103c58d
sub eax, ecx
push eax
push esi
push edi
call dword [sym.imp.msvcrt.dll__strnicmp]
add esp, 0xc
test eax, eax
jne 0x103c5b0
mov dword [0x109a094], 1
mov eax, 0x10000
push eax
push eax
call fcn.0106dfca
test eax, eax
mov dword [0x10c65cc], eax
je 0x103c457
push eax
push 0x10c6028
call fcn.0107e2ed
push 0xfffa
mov edi, 0x1106960
push edi
push 0x100ea2c
push esi
mov dword [0x109a090], 1
call fcn.01070fc9
push 0
push edi
call fcn.01073f21
test eax, eax
mov edi, 0x100f828
je 0x103c635
push 0
call fcn.0103ae6c
test eax, eax
jne 0x103c62c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push 0x100f7d8
call fcn.010430af
pop ecx
pop ecx
mov eax, esi
jmp 0x103c999
push edi
call fcn.010430af
pop ecx
jmp 0x103c63c
and dword [0x109a090], 0
call fcn.0103b05a
test eax, eax
jne 0x103c655
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
push esi
push 0x100f7a4
jmp 0x103c61e
push 0x100f77c
call fcn.010430af
cmp dword [0x1099520], 0xffffffff
pop ecx
je 0x103c779
push edi
call fcn.010430af
mov edi, dword [ebp - 0x318]
add edi, 0x2a8
cmp byte [edi], 0
pop ecx
je 0x103c6b9
push edi
call dword [sym.imp.msvcrt.dll__mbslwr]
pop ecx
push edi
call fcn.010356bc
test eax, eax
mov dword [0x109a498], eax
je 0x103c6a2
cmp dword [eax + 0x14], 0
jne 0x103c71f
push edi
push 0x100f740
call fcn.010430af
pop ecx
pop ecx
mov eax, 0xf007
jmp 0x103c999
call fcn.010721ad
mov edi, eax
shr edi, 8
push edi
call fcn.0103ab15
test eax, eax
mov dword [0x109a498], eax
jne 0x103c71f
push edi
push 0x100f720
call fcn.010430af
and dword [ebp - 0x314], 0
pop ecx
pop ecx
push dword [ebp - 0x314]
call fcn.0103ab15
test eax, eax
je 0x103c704
cmp dword [ebp - 0x314], edi
mov dword [0x109a498], eax
ja 0x103c71b
jmp 0x103c709
mov eax, dword [0x109a498]
inc dword [ebp - 0x314]
cmp dword [ebp - 0x314], 0x100
jb 0x103c6e6
test eax, eax
je 0x103c6af
test dword [0x10bd0b0], 0x40
je 0x103c759
push 0x100f6d8
call fcn.010430af
mov dword [esp], 0x100f6a8
call fcn.010430af
pop ecx
push dword [0x109a498]
call fcn.01037549
and dword [0x109a090], 0
mov dword [0x109a498], eax
push dword [eax + 0xc]
push 0x100f68c
call fcn.010430af
mov eax, dword [0x109a498]
pop ecx
pop ecx
push ebx
mov edi, 0x10c63a0
push edi
push dword [eax + 0x14]
jmp 0x103c78c
and dword [0x109a090], 0
push ebx
mov edi, 0x10c63a0
push edi
push 0x100f678
push esi
call fcn.01070fc9
cmp dword [0x109a090], 0
mov eax, 0x100b28c
jne 0x103c7a5
mov eax, 0x100b284
push eax
push 0x100f658
call fcn.010430af
pop ecx
pop ecx
push 0
push edi
call fcn.01073f21
test eax, eax
push edi
jne 0x103c7c9
push 0x100f634
jmp 0x103c6a8
push 0x100f618
call fcn.010430af
pop ecx
pop ecx
xor eax, eax
mov cl, byte [eax + 0x10c6040]
mov byte [ebp + eax - 0x108], cl
inc eax
test cl, cl
jne 0x103c7d7
jmp 0x103c835
push ebx
lea eax, [ebp - 0x20c]
push eax
push 0xf0a5
push 0
call fcn.010312a2
mov ecx, dword [ebp - 0x314]
lea eax, [ebp - 0x20c]
mov edx, eax
sub ecx, edx
inc ecx
mov dl, byte [eax]
mov byte [ecx + eax], dl
inc eax
test dl, dl
jne 0x103c810
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
jne 0x103c852
mov eax, dword [ebp - 0x314]
mov byte [eax], 0
lea eax, [ebp - 0x108]
push 0x5c
push eax
call dword [sym.imp.msvcrt.dll_strrchr]
test eax, eax
pop ecx
pop ecx
mov dword [ebp - 0x314], eax
jne 0x103c7eb
jmp 0x103c86f
xor eax, eax
mov cl, byte [ebp + eax - 0x108]
mov byte [eax + 0x10c6800], cl
inc eax
test cl, cl
jne 0x103c854
mov eax, dword [ebp - 0x314]
mov byte [eax + 1], cl
push 0
push 2
push 0
push edi
call dword [sym.imp.UPDSPAPI.dll_UpdSpOpenInfFileA]
cmp eax, 0xffffffff
mov dword [0x109a040], eax
je 0x103c8cc
xor edi, edi
push edi
push 0xfffa
lea ecx, [ebp - 0x108]
push ecx
push 0x100f608
push 0x100a264
push eax
push edi
call dword [sym.imp.UPDSPAPI.dll_UpdSpGetLineTextA]
test eax, eax
je 0x103c8bf
push ebx
mov eax, 0x109a4a0
push eax
lea ecx, [ebp - 0x108]
push ecx
push eax
call fcn.01070fc9
push dword [0x109a040]
call fcn.010397f3
jmp 0x103c8e3
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
push 0x100f5d8
call fcn.01071ac0
add esp, 0xc
xor edi, edi
push ebx
lea eax, [ebp - 0x108]
push eax
push 0x100f5c4
push esi
call fcn.01070fc9
push edi
push 1
push edi
lea eax, [ebp - 0x108]
push eax
call dword [sym.imp.UPDSPAPI.dll_UpdSpOpenInfFileA]
cmp eax, 0xffffffff
mov dword [0x109a048], eax
jne 0x103c92a
push 0x100f5b8
push 0x100f5a0
mov dword [0x109a048], edi
call fcn.01071b14
pop ecx
pop ecx
jmp 0x103c98c
lea ecx, [ebp - 0x328]
push ecx
push 0x100f590
push 0x100f588
push eax
call dword [sym.imp.UPDSPAPI.dll_UpdSpFindFirstLineA]
test eax, eax
je 0x103c98c
push edi
push ebx
lea eax, [ebp - 0x108]
push eax
push edi
lea eax, [ebp - 0x328]
push eax
call dword [sym.imp.UPDSPAPI.dll_UpdSpGetStringFieldA]
test eax, eax
je 0x103c98c
cmp byte [ebp - 0x108], 0
je 0x103c98c
push edi
lea eax, [ebp - 0x108]
push edi
push eax
call dword [sym.imp.msvcrt.dll_strtoul]
push eax
push 0x100f564
mov dword [0x1099518], eax
call fcn.01071b29
add esp, 0x14
push 0x10c5ba0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
xor eax, eax
pop edi
mov ecx, dword [ebp - 4]
pop esi
pop ebx
call fcn.0106bc50
leave
ret 4