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

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x4b04d7
push eax
mov eax, 0x2228
mov dword fs:[0], esp
call fcn.004a7630
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 0x40becd
mov esi, dword [edi + 4]
test esi, esi
je 0x40becd
mov eax, dword [edi + 0xc]
test eax, eax
je 0x40becd
mov ecx, dword [edi + 0x10]
cmp ecx, 0x80
jg 0x40bed4
xor eax, eax
jmp 0x40c6c2
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 0x40bef4
test esi, esi
jne 0x40befb
xor eax, eax
jmp 0x40c6c2
mov ecx, dword [0x4c8080]
mov edx, esi
shr edx, 0x10
mov dword [esp + 0x10], ecx
jne 0x40bf1e
and esi, 0xffff
lea ecx, [esp + 0x10]
push esi
call fcn.004056a0
jmp 0x40bf50
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov edi, eax
test edi, edi
je 0x40bf50
push edi
lea ecx, [esp + 0x14]
call fcn.00405a70
test eax, eax
je 0x40bf50
mov edx, dword [esp + 0x10]
lea eax, [edi + edi]
push eax
lea ecx, [edi + edi + 2]
push esi
push ecx
push edx
call fcn.00404530
add esp, 0x10
mov eax, dword [esp + 0x10]
mov dword [esp + 0x2240], 0
mov edi, dword [eax - 8]
test edi, edi
jne 0x40bf9e
mov edx, dword [0x4c8084]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40c6bd
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x40c6bd
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.0043b3d0
add esp, 4
jmp 0x40c6bd
mov ecx, dword [eax - 0xc]
lea esi, [eax - 0xc]
xor ebp, ebp
cmp ecx, 1
jg 0x40bfb2
mov ecx, dword [eax - 4]
test ecx, ecx
jge 0x40bff2
test edi, edi
jle 0x40bfb8
mov ebp, edi
push ebp
lea ecx, [esp + 0x14]
call fcn.00405a70
test eax, eax
je 0x40bff2
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.00404530
mov ecx, dword [esp + 0x20]
add esp, 0x10
push esi
mov dword [ecx - 8], edi
call fcn.00405e50
mov eax, dword [esp + 0x10]
push 0x4c8a1c
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 0x40c0e3
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.00405ad0
mov ecx, edi
call fcn.00405cc0
mov esi, dword [edi]
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
je 0x40c059
push esi
call ebp
mov esi, eax
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
jne 0x40c047
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.0040d860
mov eax, dword [edi]
add esp, 0x10
mov ecx, edi
mov dword [eax - 8], ebp
call fcn.00405cc0
mov esi, dword [edi]
xor ebp, ebp
mov ax, word [esi]
test ax, ax
je 0x40c0cb
push eax
call ebx
add esp, 4
test eax, eax
je 0x40c0a7
test ebp, ebp
jne 0x40c0a9
mov ebp, esi
jmp 0x40c0a9
xor ebp, ebp
push esi
call dword [sym.imp.USER32.dll_CharNextW]
mov esi, eax
mov ax, word [esi]
test ax, ax
jne 0x40c095
test ebp, ebp
je 0x40c0cb
mov word [ebp], ax
mov edi, dword [edi]
sub ebp, edi
sar ebp, 1
mov dword [edi - 8], ebp
push 0x4c8a1c
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 [0x4c8080]
mov dword [esp + 0x14], ecx
test esi, esi
mov byte [esp + 0x2240], 1
je 0x40c1ea
jne 0x40c103
xor eax, eax
jmp 0x40c10a
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push esi
push eax
lea ecx, [esp + 0x1c]
call fcn.00405ad0
lea ecx, [esp + 0x14]
call fcn.00405cc0
mov esi, dword [esp + 0x14]
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
je 0x40c141
push esi
call ebp
mov esi, eax
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
jne 0x40c12f
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.0040d860
mov edx, dword [esp + 0x24]
add esp, 0x10
lea ecx, [esp + 0x14]
mov dword [edx - 8], edi
call fcn.00405cc0
mov esi, dword [esp + 0x14]
xor edi, edi
cmp word [esi], di
je 0x40c1b8
mov ax, word [esi]
push eax
call ebx
add esp, 4
test eax, eax
je 0x40c197
test edi, edi
jne 0x40c199
mov edi, esi
jmp 0x40c199
xor edi, edi
push esi
call ebp
mov esi, eax
cmp word [esi], 0
jne 0x40c182
test edi, edi
je 0x40c1b8
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.0040d950
push 0x4c8a1c
push 0
call dword [sym.imp.MSVCRT.dll_wcstok]
mov esi, eax
add esp, 8
test esi, esi
jne 0x40c103
lea ecx, [esp + 0x10]
call fcn.00405cc0
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 0x40c241
test esi, esi
jne 0x40c2a4
mov eax, dword [esp + 0x14]
mov ecx, dword [0x4c8084]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x40c272
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40c272
mov eax, dword [esp + 0x14]
add eax, 0xfffffff4
push eax
call fcn.0043b3d0
add esp, 4
mov eax, dword [esp + 0x10]
mov edx, dword [0x4c8084]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40c29d
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40c29d
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.0043b3d0
add esp, 4
xor eax, eax
jmp 0x40c6c2
push esi
call fcn.00434360
mov cx, word [0x4c91fc]
mov edi, eax
mov ax, word [0x4d758c]
push eax
push ecx
push esi
call fcn.00434250
mov edx, dword [0x4c8080]
mov eax, esi
add esp, 0x10
mov dword [esp + 0x18], edx
shr eax, 0x10
jne 0x40c2e8
mov eax, esi
lea ecx, [esp + 0x18]
and eax, 0xffff
push eax
call fcn.004056a0
jmp 0x40c31b
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebp, eax
test ebp, ebp
je 0x40c31b
push ebp
lea ecx, [esp + 0x1c]
call fcn.00405a70
test eax, eax
je 0x40c31b
mov eax, dword [esp + 0x18]
lea ecx, [ebp + ebp]
push ecx
lea edx, [ebp + ebp + 2]
push esi
push edx
push eax
call fcn.00404530
add esp, 0x10
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 2
push ecx
mov ecx, dword [esp + 0x30]
call fcn.0040c6e0
mov ebx, dword [esp + 0x224c]
lea ebp, [ebx + 0x2c]
mov dword [ebx + 0x28], eax
push ebp
push edi
push esi
call fcn.004343c0
lea esi, [ebx + 0x30]
push esi
push edi
push eax
call fcn.004343c0
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 0x40c64d
cmp word [esp + 0x238], 0
je 0x40c64d
mov eax, dword [esp + 0x28]
test eax, eax
jbe 0x40c64d
lea eax, [esp + 0x238]
lea ecx, [esp + 0x1c]
push eax
call fcn.00404800
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 0x40c43e
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.00405a40
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.00405a40
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.00405a40
jmp 0x40c6a9
lea ecx, [esp + 0x1c]
mov dword [ebx + 0x88], 1
push ecx
lea ecx, [ebx + 0x24]
call fcn.00404aa0
lea edx, [esp + 0x238]
push edx
call fcn.0040e070
add esp, 4
test eax, eax
jne 0x40c4ae
push str.0.0.0.0
lea ecx, [ebx + 0x1c]
call fcn.00404b70
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.00405a40
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.00405a40
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.00405a40
jmp 0x40c6a9
mov ecx, dword [esp + 0x2248]
push str.RegVersionFile
call fcn.0040ac40
push eax
lea ecx, [esp + 0x24]
call fcn.00404800
mov eax, dword [esp + 0x20]
mov byte [esp + 0x2240], 4
mov ecx, dword [eax - 8]
test ecx, ecx
jne 0x40c4e6
push esi
lea ecx, [esp + 0x24]
call fcn.00404aa0
mov ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x1c]
push ecx
lea eax, [esp + 0x23c]
push edx
push eax
call edi
lea ecx, [esp + 0x238]
push ecx
call ebp
test eax, eax
jne 0x40c51a
mov esi, dword [esi]
mov edx, dword [esp + 0x1c]
push esi
lea eax, [esp + 0x23c]
push edx
push eax
call edi
lea ecx, [esp + 0x238]
push ecx
call fcn.0040e070
add esp, 4
test eax, eax
jne 0x40c584
push str.0.0.0.0
lea ecx, [ebx + 0x1c]
call fcn.00404b70
lea ecx, [esp + 0x20]
mov byte [esp + 0x2240], 3
call fcn.00405a40
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.00405a40
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.00405a40
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.00405a40
jmp 0x40c6a9
lea edx, [esp + 0x30]
push 0x104
lea eax, [esp + 0x23c]
push edx
push eax
call fcn.0040c790
mov esi, dword [esp + 0x2258]
add esp, 0xc
lea ecx, [esp + 0x30]
lea ebx, [esi + 0x1c]
push ecx
mov ecx, ebx
call fcn.00404b70
mov edx, dword [esp + 0x224c]
mov esi, dword [esi + 0x3c]
cmp esi, dword [edx + 0x40]
je 0x40c607
mov eax, dword [esi]
mov ecx, dword [eax - 8]
test ecx, ecx
je 0x40c5ea
push eax
mov eax, dword [esp + 0x20]
lea ecx, [esp + 0x23c]
push eax
push ecx
call edi
lea edx, [esp + 0x238]
push edx
call ebp
test eax, eax
je 0x40c5fb
mov eax, dword [esp + 0x224c]
add esi, 4
cmp esi, dword [eax + 0x40]
jne 0x40c5c3
jmp 0x40c607
push str.0.0.0.0
mov ecx, ebx
call fcn.00404b70
lea ecx, [esp + 0x20]
mov byte [esp + 0x2240], 3
call fcn.00405a40
lea ecx, [esp + 0x1c]
mov byte [esp + 0x2240], 2
call fcn.00405a40
lea ecx, [esp + 0x18]
mov byte [esp + 0x2240], 1
call fcn.00405a40
lea ecx, [esp + 0x14]
mov byte [esp + 0x2240], 0
call fcn.00405a40
jmp 0x40c6a9
mov eax, dword [esp + 0x18]
mov edx, dword [0x4c8084]
mov esi, dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40c67e
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40c67e
mov edx, dword [esp + 0x18]
lea eax, [edx - 0xc]
push eax
call fcn.0043b3d0
add esp, 4
mov eax, dword [esp + 0x14]
mov edx, dword [0x4c8084]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x40c6a9
add eax, 0xfffffff4
push eax
call esi
test eax, eax
jg 0x40c6a9
mov edx, dword [esp + 0x14]
lea eax, [edx - 0xc]
push eax
call fcn.0043b3d0
add esp, 4
lea ecx, [esp + 0x10]
mov dword [esp + 0x2240], 0xffffffff
call fcn.00405a40
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