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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x41c
push ebx
push esi
push edi
push 0x104
lea eax, [ebp - 0x41c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ebx, dword [ebp + 0x14]
mov ecx, eax
mov esi, dword [ebp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov dword [ebp - 8], ecx
test ecx, ecx
je 0x401f95
cmp dword [ebx + 0x18], 0
je 0x401ed9
lea eax, [ebp - 0x41c]
push eax
lea eax, [ebp - 0x214]
push 0x104
push eax
call fcn.00402760
lea eax, [ebp - 0x214]
push eax
call fcn.00402780
mov esi, eax
add esp, 0x10
test esi, esi
je 0x401ed3
lea edi, [ebp - 0x214]
nop word [eax + eax]
cmp byte [edi + esi - 1], 0x5c
je 0x401e17
test esi, esi
je 0x401ecd
dec esi
cmp byte [edi + esi - 1], 0x5c
jne 0x401e07
test esi, esi
je 0x401ecd
lea eax, [ebp - 0x214]
mov byte [ebp + esi - 0x215], 0
push eax
dec esi
lea eax, [ebp - 0x318]
push 0x104
push eax
call fcn.00402760
add esp, 0xc
lea eax, [ebp - 0x318]
push dword [ebx + 0x18]
push 0x104
push 0x43f794
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
lea eax, [ebp - 0x318]
push eax
call fcn.00402780
add esp, 0x10
test eax, eax
je 0x401ec5
push dword [ebp + 8]
lea eax, [ebp - 0x318]
push 0x104
push 0x43f794
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
add esp, 0xc
lea eax, [ebp - 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
test eax, eax
je 0x401ec5
cmp eax, 0xffffffff
je 0x401ec5
test al, 0x10
je 0x4021cd
test esi, esi
jne 0x401e00
mov edi, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
mov ecx, dword [ebp - 8]
mov esi, dword [ebp + 8]
cmp dword [ebx + 0x14], 0
je 0x401f95
mov eax, pe_nt_image_headers32
sub eax, ecx
push str..ini
push eax
lea eax, [ebp + ecx - 0x420]
push eax
call fcn.00402760
add esp, 0xc
mov byte [ebp - 0x110], 0
lea eax, [ebp - 0x41c]
push eax
push 0x104
lea eax, [ebp - 0x110]
push eax
push 0x43f79d
push str.DLLPath
push dword [ebx + 0x14]
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [ebp - 0x110]
push eax
call fcn.00402780
add esp, 4
test eax, eax
je 0x401f95
lea eax, [ebp - 0x110]
push eax
call fcn.00402780
add esp, 4
test eax, eax
je 0x401f95
push esi
push 0x104
push 0x43f794
lea eax, [ebp - 0x110]
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
add esp, 0xc
lea eax, [ebp - 0x110]
push eax
call edi
test eax, eax
je 0x401f95
cmp eax, 0xffffffff
je 0x401f95
test al, 0x10
je 0x4021c5
push 0x104
lea eax, [ebp - 0x110]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov dword [ebp - 8], eax
test eax, eax
je 0x402028
cmp byte [ebp + eax - 0x111], 0x5c
je 0x401fcb
lea ecx, [ebp - 0x110]
dec eax
cmp byte [ecx + eax - 1], 0x5c
jne 0x401fc0
mov dword [ebp - 8], eax
mov byte [ebp + eax - 0x111], 0
lea eax, [ebp - 0x110]
push eax
call fcn.00402780
add esp, 4
test eax, eax
je 0x402028
push esi
push 0x104
push 0x43f794
lea eax, [ebp - 0x110]
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
add esp, 0xc
lea eax, [ebp - 0x110]
push eax
call edi
test eax, eax
je 0x402028
cmp eax, 0xffffffff
je 0x402028
test al, 0x10
je 0x4021c5
cmp dword [ebx], 0
je 0x402355
mov eax, dword [ebx + 0x10]
mov esi, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov edi, dword [sym.imp.KERNEL32.dll_ExpandEnvironmentStringsA]
mov dword [ebp - 4], 0
test eax, eax
je 0x402155
push eax
lea eax, [ebp - 0x1d8]
push 0xc8
push eax
call fcn.00402760
add esp, 0xc
lea eax, [ebp - 0x1d8]
push dword [ebx]
push 0xc8
push 0x43f794
push 0xc8
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
add esp, 0xc
mov dword [ebp - 8], 0x104
lea eax, [ebp - 4]
mov dword [ebp - 0xc], 0
push eax
push 1
push 0
lea eax, [ebp - 0x1d8]
push eax
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x402144
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0xc]
push eax
push 0
push str.Path
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x402144
push dword [ebp - 4]
call esi
cmp dword [ebp - 0xc], 2
mov dword [ebp - 4], 0
jne 0x402125
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x41c]
push 0x104
push eax
call fcn.00402760
add esp, 0xc
lea eax, [ebp - 0x110]
push 0x104
push eax
lea eax, [ebp - 0x41c]
push eax
call edi
mov dword [ebp - 8], eax
push dword [ebp + 8]
lea eax, [ebp - 0x110]
push 0x104
push eax
call fcn.00401d10
add esp, 0xc
test al, al
jne 0x4021c5
mov eax, dword [ebp - 4]
test eax, eax
je 0x40214e
push eax
call esi
mov dword [ebp - 4], 0
mov eax, dword [ebx + 4]
test eax, eax
je 0x4021eb
push 0x104
lea ecx, [ebp - 0x110]
push ecx
push eax
call edi
mov dword [ebp - 8], eax
dec eax
cmp eax, 0x102
ja 0x4021eb
cmp byte [ebp - 0x110], 0x25
je 0x4021eb
push dword [ebx]
lea eax, [ebp - 0x110]
push 0x104
push 0x43f794
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
mov edi, dword [ebp + 8]
lea eax, [ebp - 0x110]
push edi
push 0x104
push eax
call fcn.00401d10
add esp, 0x18
test al, al
je 0x4021ee
lea eax, [ebp - 0x110]
jmp 0x4021d3
lea eax, [ebp - 0x318]
push eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call fcn.00402760
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edi, dword [ebp + 8]
cmp dword [ebx + 0xc], 0
je 0x4022b6
lea eax, [ebp - 4]
push eax
push 1
push 0
push str.SoftwareMicrosoftWindowsCurrentVersion
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
test eax, eax
jne 0x4022ac
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x110]
push eax
push 0
push 0
push str.ProgramFilesDir
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x4022ac
push dword [ebx + 0xc]
lea eax, [ebp - 0x110]
push 0x104
push 0x43f794
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
add esp, 0xc
push dword [ebx]
push 0x104
push 0x43f794
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
push edi
lea eax, [ebp - 0x110]
push 0x104
push eax
call fcn.00401d10
add esp, 0x18
test al, al
je 0x4022ac
push dword [ebp - 4]
call esi
lea eax, [ebp - 0x110]
jmp 0x4021d3
mov eax, dword [ebp - 4]
test eax, eax
je 0x4022b6
push eax
call esi
mov eax, dword [ebx + 8]
test eax, eax
je 0x402355
push eax
lea eax, [ebp - 0x110]
push 0x104
push eax
call fcn.00402760
add esp, 0xc
lea eax, [ebp - 0x110]
push dword [ebx]
push 0x104
push 0x43f794
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
lea eax, [ebp - 0x110]
push eax
call fcn.00402780
add esp, 0x10
test eax, eax
je 0x402355
push edi
push 0x104
push 0x43f794
lea eax, [ebp - 0x110]
push 0x104
push eax
call fcn.00402730
add esp, 0xc
push eax
call fcn.00402730
add esp, 0xc
lea eax, [ebp - 0x110]
push eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
test eax, eax
je 0x402355
cmp eax, 0xffffffff
je 0x402355
test al, 0x10
je 0x4021c5
push dword [ebp + 8]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
call fcn.00402760
add esp, 0xc
mov eax, 0x485
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret