Function at 0x4018a0
Capabilities:
Get file attributes
Query environment variable
Query or enumerate registry value
Read .ini file

Disassembly:
sub esp, 0x41c
push ebx
push ebp
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x328]
push 0x104
push eax
push 0
call edi
mov ebx, dword [esp + 0x43c]
mov ecx, eax
mov ebp, dword [esp + 0x430]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [esp + 0x14], ecx
test ecx, ecx
je 0x401abb
cmp dword [ebx + 0x18], 0
je 0x401a0a
lea eax, [esp + 0x328]
push eax
lea eax, [esp + 0x124]
push 0x104
push eax
call fcn.00402180
lea eax, [esp + 0x12c]
push eax
call fcn.004021a0
mov esi, eax
add esp, 0x10
test esi, esi
je 0x401a00
lea edi, [esp + 0x120]
cmp byte [edi + esi - 1], 0x5c
je 0x401940
nop
test esi, esi
je 0x4019fa
dec esi
cmp byte [edi + esi - 1], 0x5c
jne 0x401930
test esi, esi
je 0x4019fa
lea eax, [esp + 0x120]
mov byte [esp + esi + 0x11f], 0
push eax
dec esi
lea eax, [esp + 0x228]
push 0x104
push eax
call fcn.00402180
add esp, 0xc
lea eax, [esp + 0x224]
push dword [ebx + 0x18]
push 0x104
push 0x40f558
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
lea eax, [esp + 0x230]
push eax
call fcn.004021a0
add esp, 0x10
test eax, eax
je 0x4019f2
push ebp
push 0x104
push 0x40f558
lea eax, [esp + 0x230]
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
lea eax, [esp + 0x224]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
test eax, eax
je 0x4019f2
cmp eax, 0xffffffff
je 0x4019f2
test al, 0x10
je 0x401cf0
test esi, esi
jne 0x401928
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ecx, dword [esp + 0x14]
mov esi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp dword [ebx + 0x14], 0
je 0x401abb
mov eax, 0x108
sub eax, ecx
push str..ini
push eax
lea eax, [esp + ecx + 0x32c]
push eax
call fcn.00402180
add esp, 0xc
mov byte [esp + 0x1c], 0
lea eax, [esp + 0x328]
push eax
push 0x104
lea eax, [esp + 0x24]
push eax
push 0x40f561
push str.DLLPath
push dword [ebx + 0x14]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [esp + 0x1c]
push eax
call fcn.004021a0
add esp, 4
test eax, eax
je 0x401abb
lea eax, [esp + 0x1c]
push eax
call fcn.004021a0
add esp, 4
test eax, eax
je 0x401abb
push ebp
push 0x104
push 0x40f558
lea eax, [esp + 0x28]
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
call esi
test eax, eax
je 0x401abb
cmp eax, 0xffffffff
je 0x401abb
test al, 0x10
je 0x401cea
push 0x104
lea eax, [esp + 0x20]
push eax
push 0
call edi
mov dword [esp + 0x14], eax
test eax, eax
je 0x401b40
cmp byte [esp + eax + 0x1b], 0x5c
je 0x401aec
lea ecx, [esp + 0x1c]
nop dword [eax]
dec eax
cmp byte [ecx + eax - 1], 0x5c
jne 0x401ae0
mov dword [esp + 0x14], eax
mov byte [esp + eax + 0x1b], 0
lea eax, [esp + 0x1c]
push eax
call fcn.004021a0
add esp, 4
test eax, eax
je 0x401b40
push ebp
push 0x104
push 0x40f558
lea eax, [esp + 0x28]
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
call esi
test eax, eax
je 0x401b40
cmp eax, 0xffffffff
je 0x401b40
test al, 0x10
je 0x401cea
cmp dword [ebx], 0
je 0x401e8b
mov eax, dword [ebx + 0x10]
mov ebp, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
mov dword [esp + 0x10], 0
test eax, eax
je 0x401c7d
push eax
lea eax, [esp + 0x124]
push 0xc8
push eax
call fcn.00402180
add esp, 0xc
lea eax, [esp + 0x120]
push dword [ebx]
push 0xc8
push 0x40f558
push 0xc8
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
mov dword [esp + 0x14], 0x104
lea eax, [esp + 0x10]
mov dword [esp + 0x18], 0
push eax
push 1
push 0
lea eax, [esp + 0x12c]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401c6a
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x20]
push eax
push 0
push str.Path
push dword [esp + 0x24]
call ebp
test eax, eax
jne 0x401c6a
push dword [esp + 0x10]
call esi
cmp dword [esp + 0x18], 2
mov dword [esp + 0x10], 0
jne 0x401c49
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x32c]
push 0x104
push eax
call fcn.00402180
add esp, 0xc
lea eax, [esp + 0x1c]
push 0x104
push eax
lea eax, [esp + 0x330]
push eax
call edi
mov dword [esp + 0x14], eax
push dword [esp + 0x430]
lea eax, [esp + 0x20]
push 0x104
push eax
call fcn.00401840
add esp, 0xc
test al, al
jne 0x401cea
mov eax, dword [esp + 0x10]
test eax, eax
je 0x401c75
push eax
call esi
mov dword [esp + 0x10], 0
mov eax, dword [ebx + 4]
test eax, eax
je 0x401d1b
push 0x104
lea ecx, [esp + 0x20]
push ecx
push eax
call edi
mov dword [esp + 0x14], eax
dec eax
cmp eax, 0x102
ja 0x401d1b
cmp byte [esp + 0x1c], 0x25
je 0x401d1b
push dword [ebx]
lea eax, [esp + 0x20]
push 0x104
push 0x40f558
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
mov edi, dword [esp + 0x43c]
lea eax, [esp + 0x28]
push edi
push 0x104
push eax
call fcn.00401840
add esp, 0x18
test al, al
je 0x401d22
lea eax, [esp + 0x1c]
jmp 0x401cf7
lea eax, [esp + 0x224]
push eax
push dword [esp + 0x43c]
push dword [esp + 0x43c]
call fcn.00402180
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret
mov edi, dword [esp + 0x430]
cmp dword [ebx + 0xc], 0
je 0x401de3
lea eax, [esp + 0x10]
push eax
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x401dd8
lea eax, [esp + 0x14]
push eax
lea eax, [esp + 0x20]
push eax
push 0
push 0
push str.ProgramFilesDir
push dword [esp + 0x24]
call ebp
test eax, eax
jne 0x401dd8
push dword [ebx + 0xc]
lea eax, [esp + 0x20]
push 0x104
push 0x40f558
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
push dword [ebx]
push 0x104
push 0x40f558
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
push edi
lea eax, [esp + 0x2c]
push 0x104
push eax
call fcn.00401840
add esp, 0x18
test al, al
je 0x401dd8
push dword [esp + 0x10]
call esi
lea eax, [esp + 0x1c]
jmp 0x401cf7
mov eax, dword [esp + 0x10]
test eax, eax
je 0x401de3
push eax
call esi
mov eax, dword [ebx + 8]
test eax, eax
je 0x401e84
push eax
lea eax, [esp + 0x20]
push 0x104
push eax
call fcn.00402180
add esp, 0xc
lea eax, [esp + 0x1c]
push dword [ebx]
push 0x104
push 0x40f558
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
lea eax, [esp + 0x28]
push eax
call fcn.004021a0
mov ebp, dword [esp + 0x440]
add esp, 0x10
test eax, eax
je 0x401e8b
push ebp
push 0x104
push 0x40f558
lea eax, [esp + 0x28]
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
lea eax, [esp + 0x1c]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
test eax, eax
je 0x401e8b
cmp eax, 0xffffffff
je 0x401e8b
test al, 0x10
jne 0x401e8b
lea eax, [esp + 0x1c]
jmp 0x401cf7
mov ebp, dword [esp + 0x430]
push ebp
push dword [esp + 0x43c]
push dword [esp + 0x43c]
call fcn.00402180
add esp, 0xc
mov eax, 0x485
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x41c
ret