Function at 0x401aa0
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 0x401cbb
cmp dword [ebx + 0x18], 0
je 0x401c0a
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 0x401c00
lea edi, [esp + 0x120]
cmp byte [edi + esi - 1], 0x5c
je 0x401b40
nop
test esi, esi
je 0x401bfa
dec esi
cmp byte [edi + esi - 1], 0x5c
jne 0x401b30
test esi, esi
je 0x401bfa
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 0x40f644
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 0x401bf2
push ebp
push 0x104
push 0x40f644
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 0x401bf2
cmp eax, 0xffffffff
je 0x401bf2
test al, 0x10
je 0x401ef0
test esi, esi
jne 0x401b28
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 0x401cbb
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 0x40f64d
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 0x401cbb
lea eax, [esp + 0x1c]
push eax
call fcn.004021a0
add esp, 4
test eax, eax
je 0x401cbb
push ebp
push 0x104
push 0x40f644
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 0x401cbb
cmp eax, 0xffffffff
je 0x401cbb
test al, 0x10
je 0x401eea
push 0x104
lea eax, [esp + 0x20]
push eax
push 0
call edi
mov dword [esp + 0x14], eax
test eax, eax
je 0x401d40
cmp byte [esp + eax + 0x1b], 0x5c
je 0x401cec
lea ecx, [esp + 0x1c]
nop dword [eax]
dec eax
cmp byte [ecx + eax - 1], 0x5c
jne 0x401ce0
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 0x401d40
push ebp
push 0x104
push 0x40f644
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 0x401d40
cmp eax, 0xffffffff
je 0x401d40
test al, 0x10
je 0x401eea
cmp dword [ebx], 0
je 0x40208b
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 0x401e7d
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 0x40f644
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 0x401e6a
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 0x401e6a
push dword [esp + 0x10]
call esi
cmp dword [esp + 0x18], 2
mov dword [esp + 0x10], 0
jne 0x401e49
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.00401a40
add esp, 0xc
test al, al
jne 0x401eea
mov eax, dword [esp + 0x10]
test eax, eax
je 0x401e75
push eax
call esi
mov dword [esp + 0x10], 0
mov eax, dword [ebx + 4]
test eax, eax
je 0x401f1b
push 0x104
lea ecx, [esp + 0x20]
push ecx
push eax
call edi
mov dword [esp + 0x14], eax
dec eax
cmp eax, 0x102
ja 0x401f1b
cmp byte [esp + 0x1c], 0x25
je 0x401f1b
push dword [ebx]
lea eax, [esp + 0x20]
push 0x104
push 0x40f644
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.00401a40
add esp, 0x18
test al, al
je 0x401f22
lea eax, [esp + 0x1c]
jmp 0x401ef7
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 0x401fe3
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 0x401fd8
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 0x401fd8
push dword [ebx + 0xc]
lea eax, [esp + 0x20]
push 0x104
push 0x40f644
push 0x104
push eax
call fcn.00402150
add esp, 0xc
push eax
call fcn.00402150
add esp, 0xc
push dword [ebx]
push 0x104
push 0x40f644
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.00401a40
add esp, 0x18
test al, al
je 0x401fd8
push dword [esp + 0x10]
call esi
lea eax, [esp + 0x1c]
jmp 0x401ef7
mov eax, dword [esp + 0x10]
test eax, eax
je 0x401fe3
push eax
call esi
mov eax, dword [ebx + 8]
test eax, eax
je 0x402084
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 0x40f644
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 0x40208b
push ebp
push 0x104
push 0x40f644
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 0x40208b
cmp eax, 0xffffffff
je 0x40208b
test al, 0x10
jne 0x40208b
lea eax, [esp + 0x1c]
jmp 0x401ef7
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