Function at 0x40afe0
Capabilities:
Check if file exists
Query or enumerate registry value
Read .ini file

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x4a9a27
push eax
mov eax, 0x2228
mov dword fs:[0], esp
call fcn.004a0d60
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x2248]
mov dword [esp + 0x2c], ecx
mov edx, dword [edi]
test edx, edx
je 0x40b02d
mov esi, dword [edi + 4]
test esi, esi
je 0x40b02d
mov eax, dword [edi + 0xc]
test eax, eax
je 0x40b02d
mov ecx, dword [edi + 0x10]
cmp ecx, 0x80
jg 0x40b034
xor eax, eax
jmp 0x40b839
push edx
push ecx
push eax
mov eax, dword [edi + 8]
push eax
push str.RegAppEntry
push esi
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov esi, dword [edi + 0xc]
cmp word [esi], 0
je 0x40b054
test esi, esi
jne 0x40b05b
xor eax, eax
jmp 0x40b839
mov ecx, dword [0x4c0080]
mov edx, esi
shr edx, 0x10
mov dword [esp + 0x10], ecx
jne 0x40b07e
and esi, 0xffff
lea ecx, [esp + 0x10]
push esi
call fcn.00404350
jmp 0x40b0b0
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, eax
test edi, edi
je 0x40b0b0
push edi
lea ecx, [esp + 0x14]
call fcn.00404720
test eax, eax
je 0x40b0b0
mov edx, dword [esp + 0x10]
lea eax, [edi + edi]
push eax
lea ecx, [edi + edi + 2]
push esi
push ecx
push edx
call fcn.004039f0
add esp, 0x10
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2240], 0
mov edi, dword [eax - 8]
test edi, edi
jne 0x40b0fe
mov edx, dword [0x4c0084]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40b834
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40b834
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.0049c000
add esp, 4
jmp 0x40b834
mov ecx, dword [eax - 0xc]
lea esi, [eax - 0xc]
xor ebp, ebp
cmp ecx, 1
jg 0x40b112
mov ecx, dword [eax - 4]
test ecx, ecx
jge 0x40b152
test edi, edi
jle 0x40b118
mov ebp, edi
push ebp
lea ecx, [esp + 0x14]
call fcn.00404720
test eax, eax
je 0x40b152
lea eax, [edi + edi + 2]
lea ecx, [esi + 0xc]
push eax
mov eax, dword [esp + 0x14]
lea edx, [ebp + ebp + 2]
push ecx
push edx
push eax
call fcn.004039f0
mov ecx, dword [esp + 0x20]
add esp, 0x10
push esi
mov dword [ecx - 8], edi
call fcn.00404b00
mov eax, dword [esp + 0x10]
push 0x4c0788
push eax
call dword [sym.imp.MSVCRT.dll_wcstok]
mov ebp, dword [sym.imp.USER32.dll_CharNextW]
mov ebx, dword [sym.imp.MSVCRT.dll_iswspace]
mov esi, eax
add esp, 8
test esi, esi
je 0x40b243
mov edx, dword [esp + 0x224c]
push esi
push esi
lea edi, [edx + 0x34]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
mov ecx, edi
call fcn.00404780
mov ecx, edi
call fcn.00404970
mov esi, dword [edi]
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
je 0x40b1b9
push esi
call ebp
mov esi, eax
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
jne 0x40b1a7
mov eax, dword [edi]
mov ecx, esi
sub ecx, eax
mov ebp, dword [eax - 8]
sar ecx, 1
sub ebp, ecx
mov ecx, dword [eax - 4]
lea edx, [ebp + ebp + 2]
push edx
lea edx, [ecx + ecx + 2]
push esi
push edx
push eax
call fcn.0040cc60
mov eax, dword [edi]
add esp, 0x10
mov ecx, edi
mov dword [eax - 8], ebp
call fcn.00404970
mov esi, dword [edi]
xor ebp, ebp
mov ax, word [esi]
test ax, ax
je 0x40b22b
push eax
call ebx
add esp, 4
test eax, eax
je 0x40b207
test ebp, ebp
jne 0x40b209
mov ebp, esi
jmp 0x40b209
xor ebp, ebp
push esi
call dword [sym.imp.USER32.dll_CharNextW]
mov esi, eax
mov ax, word [esi]
test ax, ax
jne 0x40b1f5
test ebp, ebp
je 0x40b22b
mov word [ebp], ax
mov edi, dword [edi]
sub ebp, edi
sar ebp, 1
mov dword [edi - 8], ebp
push 0x4c0788
push 0
call dword [sym.imp.MSVCRT.dll_wcstok]
mov ebp, dword [sym.imp.USER32.dll_CharNextW]
add esp, 8
mov esi, eax
mov ecx, dword [0x4c0080]
mov dword [esp + 0x14], ecx
test esi, esi
mov byte [esp + 0x2240], 1
je 0x40b34a
jne 0x40b263
xor eax, eax
jmp 0x40b26a
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push esi
push eax
lea ecx, [esp + 0x1c]
call fcn.00404780
lea ecx, [esp + 0x14]
call fcn.00404970
mov esi, dword [esp + 0x14]
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
je 0x40b2a1
push esi
call ebp
mov esi, eax
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
jne 0x40b28f
mov eax, dword [esp + 0x14]
mov edx, esi
sub edx, eax
mov edi, dword [eax - 8]
sar edx, 1
sub edi, edx
mov edx, dword [eax - 4]
lea ecx, [edi + edi + 2]
push ecx
lea ecx, [edx + edx + 2]
push esi
push ecx
push eax
call fcn.0040cc60
mov edx, dword [esp + 0x24]
add esp, 0x10
lea ecx, [esp + 0x14]
mov dword [edx - 8], edi
call fcn.00404970
mov esi, dword [esp + 0x14]
xor edi, edi
cmp word [esi], di
je 0x40b318
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
je 0x40b2f7
test edi, edi
jne 0x40b2f9
mov edi, esi
jmp 0x40b2f9
xor edi, edi
push esi
call ebp
mov esi, eax
cmp word [esi], 0
jne 0x40b2e2
test edi, edi
je 0x40b318
mov word [edi], 0
mov eax, dword [esp + 0x14]
sub edi, eax
sar edi, 1
mov dword [eax - 8], edi
mov eax, dword [esp + 0x224c]
lea edx, [esp + 0x14]
push edx
lea ecx, [eax + 0x38]
mov eax, dword [eax + 0x40]
push eax
call fcn.0040cd30
push 0x4c0788
push 0
call dword [sym.imp.MSVCRT.dll_wcstok]
mov esi, eax
add esp, 8
test esi, esi
jne 0x40b263
lea ecx, [esp + 0x10]
call fcn.00404970
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, dword [esp + 0x10]
mov esi, dword [esp + 0x2248]
mov dword [ecx - 8], eax
mov edx, dword [esp + 0x10]
mov word [edx + eax*2], 0
mov eax, dword [esi]
mov ecx, dword [esi + 0x10]
mov edx, dword [esi + 0xc]
push eax
mov eax, dword [esi + 8]
push ecx
mov ecx, dword [esi + 4]
push edx
push eax
push str.RegAppPath
push ecx
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringW]
mov esi, dword [esi + 0xc]
cmp word [esi], 0
je 0x40b3a1
test esi, esi
jne 0x40b404
mov eax, dword [esp + 0x14]
mov ecx, dword [0x4c0084]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x40b3d2
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40b3d2
mov eax, dword [esp + 0x14]
add eax, 0xfffffff4
push eax
call fcn.0049c000
add esp, 4
mov eax, dword [esp + 0x10]
mov edx, dword [0x4c0084]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40b3fd
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40b3fd
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.0049c000
add esp, 4
xor eax, eax
jmp 0x40b839
push esi
call fcn.004331a0
mov cx, word [0x4c0f3c]
mov edi, eax
mov ax, word [0x4cf81c]
push eax
push ecx
push esi
call fcn.00433090
mov edx, dword [0x4c0080]
mov eax, esi
add esp, 0x10
mov dword [esp + 0x18], edx
shr eax, 0x10
jne 0x40b448
mov eax, esi
lea ecx, [esp + 0x18]
and eax, 0xffff
push eax
call fcn.00404350
jmp 0x40b47b
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebp, eax
test ebp, ebp
je 0x40b47b
push ebp
lea ecx, [esp + 0x1c]
call fcn.00404720
test eax, eax
je 0x40b47b
mov eax, dword [esp + 0x18]
lea ecx, [ebp + ebp]
push ecx
lea edx, [ebp + ebp + 2]
push esi
push edx
push eax
call fcn.004039f0
add esp, 0x10
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 2
push ecx
mov ecx, dword [esp + 0x30]
call fcn.0040b860
mov ebx, dword [esp + 0x224c]
lea ebp, [ebx + 0x2c]
mov dword [ebx + 0x28], eax
push ebp
push edi
push esi
call fcn.00433200
lea esi, [ebx + 0x30]
push esi
push edi
push eax
call fcn.00433200
mov esi, dword [esi]
mov ebp, dword [ebp]
mov ecx, 0x800
xor eax, eax
lea edi, [esp + 0x250]
add esp, 0x18
rep stosd dword es:[edi], eax
lea edx, [esp + 0x28]
lea eax, [esp + 0x238]
push edx
mov edx, dword [ebx + 0x28]
lea ecx, [esp + 0x28]
push eax
push ecx
push esi
push ebp
push edx
mov dword [esp + 0x3c], 1
mov dword [esp + 0x40], 0x1000
call dword [sym.imp.SHLWAPI.dll_SHGetValueW]
cmp dword [esp + 0x24], 1
jne 0x40b7c4
cmp word [esp + 0x238], 0
je 0x40b7c4
mov eax, dword [esp + 0x28]
test eax, eax
jbe 0x40b7c4
lea eax, [esp + 0x238]
lea ecx, [esp + 0x1c]
push eax
call fcn.00406840
mov eax, dword [ebx + 0x34]
mov ecx, dword [esp + 0x1c]
mov edi, dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea esi, [ebx + 0x34]
push eax
lea edx, [esp + 0x23c]
push ecx
push edx
mov byte [esp + 0x224c], 3
call edi
mov ebp, dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
lea eax, [esp + 0x238]
push eax
call ebp
test eax, eax
jne 0x40b59e
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.004046f0
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.004046f0
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.004046f0
jmp 0x40b820
lea ecx, [esp + 0x1c]
mov dword [ebx + 0x88], 1
push ecx
lea ecx, [ebx + 0x24]
call fcn.0040d220
lea edx, [esp + 0x238]
push edx
call fcn.00439c40
add esp, 4
test eax, eax
jne 0x40b625
mov eax, str.0.0.0.0
lea esi, [ebx + 0x1c]
test eax, eax
je 0x40b5e0
push str.0.0.0.0
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push str.0.0.0.0
push eax
mov ecx, esi
call fcn.00404780
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.004046f0
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.004046f0
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.004046f0
jmp 0x40b820
mov ecx, dword [esp + 0x2248]
push str.RegVersionFile
call fcn.004098a0
push eax
lea ecx, [esp + 0x24]
call fcn.00406840
mov ecx, dword [esp + 0x20]
mov byte [esp + 0x2240], 4
mov eax, dword [ecx - 8]
test eax, eax
jne 0x40b65d
push esi
lea ecx, [esp + 0x24]
call fcn.0040d220
mov edx, dword [esp + 0x20]
mov eax, dword [esp + 0x1c]
push edx
lea ecx, [esp + 0x23c]
push eax
push ecx
call edi
lea edx, [esp + 0x238]
push edx
call ebp
test eax, eax
jne 0x40b691
mov esi, dword [esi]
mov eax, dword [esp + 0x1c]
push esi
lea ecx, [esp + 0x23c]
push eax
push ecx
call edi
lea edx, [esp + 0x238]
push edx
call fcn.00439c40
add esp, 4
test eax, eax
jne 0x40b6fb
push str.0.0.0.0
lea ecx, [ebx + 0x1c]
call fcn.00403cc0
lea ecx, [esp + 0x20]
mov byte [esp + 0x2240], 3
call fcn.004046f0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.004046f0
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.004046f0
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.004046f0
jmp 0x40b820
lea eax, [esp + 0x30]
push 0x104
lea ecx, [esp + 0x23c]
push eax
push ecx
call fcn.0040b910
mov esi, dword [esp + 0x2258]
add esp, 0xc
lea edx, [esp + 0x30]
lea ebx, [esi + 0x1c]
push edx
mov ecx, ebx
call fcn.00403cc0
mov eax, dword [esp + 0x224c]
mov esi, dword [esi + 0x3c]
cmp esi, dword [eax + 0x40]
je 0x40b77e
mov eax, dword [esi]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x40b761
mov ecx, dword [esp + 0x1c]
push eax
lea edx, [esp + 0x23c]
push ecx
push edx
call edi
lea eax, [esp + 0x238]
push eax
call ebp
test eax, eax
je 0x40b772
mov ecx, dword [esp + 0x224c]
add esi, 4
cmp esi, dword [ecx + 0x40]
jne 0x40b73a
jmp 0x40b77e
push str.0.0.0.0
mov ecx, ebx
call fcn.00403cc0
lea ecx, [esp + 0x20]
mov byte [esp + 0x2240], 3
call fcn.004046f0
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.004046f0
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.004046f0
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.004046f0
jmp 0x40b820
mov eax, dword [esp + 0x18]
mov ecx, dword [0x4c0084]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x40b7f5
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40b7f5
mov eax, dword [esp + 0x18]
add eax, 0xfffffff4
push eax
call fcn.0049c000
add esp, 4
mov eax, dword [esp + 0x14]
mov edx, dword [0x4c0084]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40b820
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40b820
mov edx, dword [esp + 0x14]
lea eax, [edx - 0xc]
push eax
call fcn.0049c000
add esp, 4
lea ecx, [esp + 0x10]
mov dword [esp + 0x2240], 0xffffffff
call fcn.004046f0
mov eax, 1
mov ecx, dword [esp + 0x2238]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2234
ret 8