Function at 0x406ea0
Capabilities:
Check if file exists
Set registry value

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x47bdc4
mov eax, dword fs:[0]
push eax
sub esp, 0x420
mov eax, dword [0x4be5b4]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, dword [0x4c25c0]
mov dword [0x4c24d4], 0
test esi, esi
jne 0x406f4e
mov esi, dword [0x4c25c4]
push esi
mov dword [ebp - 0x424], esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [0x4c25c0], 0
mov dword [ebp - 4], 0
jne 0x406f32
push 0x4c2644
push 0x34
call fcn.0042cd78
add esp, 8
mov dword [ebp - 0x41c], eax
mov byte [ebp - 4], 1
test eax, eax
je 0x406f2b
mov ecx, eax
call fcn.0041a6d0
jmp 0x406f2d
xor eax, eax
mov dword [0x4c25c0], eax
push esi
mov dword [ebp - 4], 0xffffffff
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [0x4c25c0]
test esi, esi
je 0x40756c
push 0
mov ecx, esi
call fcn.0041b360
test eax, eax
je 0x406f6a
mov dword [0x4c24d4], 5
jmp 0x40756c
push 0
mov ecx, esi
call fcn.0041b1d0
test eax, eax
je 0x406f86
mov dword [0x4c24d4], 6
jmp 0x40756c
lea eax, [ebp - 0x428]
push eax
call fcn.0040ad60
push dword [ebp - 0x428]
mov dword [ebp - 4], 2
push 0x485f68
call fcn.0044e890
mov eax, dword [0x4c2544]
add eax, 0xfffffff0
push eax
call fcn.00407840
add eax, 0x10
mov dword [ebp - 0x420], eax
push eax
push 0x485f7c
mov byte [ebp - 4], 3
call fcn.0044e890
add esp, 0x14
call fcn.0040b4c0
mov ecx, eax
test ecx, ecx
je 0x407588
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x41c], eax
push 0xd4
lea ecx, [ebp - 0x41c]
mov byte [ebp - 4], 4
call fcn.00406bc0
test al, al
jne 0x407030
mov ecx, 0xd4
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407010
sub ecx, edx
sar ecx, 1
push ecx
push 0xd4
lea ecx, [ebp - 0x41c]
call fcn.00416a50
mov esi, dword [ebp - 0x41c]
push 0x4846a4
push esi
call fcn.004405f1
xor ebx, ebx
mov byte [ebp - 4], 3
add esp, 8
test eax, eax
sete bl
or edi, 0xffffffff
add esi, 0xfffffff0
mov eax, edi
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x407069
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
test ebx, ebx
je 0x40711b
lea eax, [ebp - 0x41c]
push eax
call fcn.004554b0
add esp, 4
mov ecx, dword [eax]
mov esi, dword [ebp - 0x420]
add esi, 0xfffffff0
mov byte [ebp - 4], 6
lea edx, [ecx - 0x10]
cmp edx, esi
je 0x4070e7
cmp dword [esi + 0xc], 0
lea ebx, [esi + 0xc]
jl 0x4070d8
mov eax, dword [edx]
cmp eax, dword [esi]
jne 0x4070d8
push edx
call fcn.00407840
add esp, 4
mov dword [ebp - 0x424], eax
mov ecx, edi
lock xadd dword [ebx], ecx
dec ecx
test ecx, ecx
jg 0x4070cd
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov eax, dword [ebp - 0x424]
add eax, 0x10
mov dword [ebp - 0x420], eax
jmp 0x4070e7
push dword [ecx - 0xc]
push ecx
lea ecx, [ebp - 0x420]
call fcn.00416a50
mov edx, dword [ebp - 0x41c]
mov eax, edi
mov byte [ebp - 4], 3
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x407108
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
push dword [ebp - 0x420]
push 0x485f8c
call fcn.0044e890
add esp, 8
mov eax, dword [ebp - 0x428]
cmp dword [eax - 0xc], 0
jne 0x407158
push str.newinstall
push str.installpkg
mov dword [0x4c24d4], 4
call fcn.0040b360
push eax
call fcn.00450840
push 0x485fbc
call fcn.0044e890
add esp, 0x10
jmp 0x407529
mov eax, dword [ebp - 0x420]
cmp dword [eax - 0xc], 0
jne 0x407178
mov dword [0x4c24d4], 4
push 0x485fbc
jmp 0x407521
lea eax, [ebp - 0x428]
push eax
lea eax, [ebp - 0x420]
push eax
call fcn.00452880
add esp, 8
test eax, eax
jle 0x40726a
mov eax, dword [0x4c2638]
test eax, eax
jne 0x407219
mov eax, dword [vtable.CDHCriticalSection.0]
mov ecx, 0x4be280
mov dword [ebp - vtable.CDHCriticalSection.0], 0x4be280
call dword [eax + 4]
cmp dword [0x4c2638], 0
jne 0x4071ff
cmp dword [0x4be27c], 0
je 0x4071ff
push 0x4c2644
push 0x58
call fcn.0042cd78
add esp, 8
mov dword [ebp - 0x41c], eax
mov byte [ebp - 4], 8
test eax, eax
je 0x4071ee
mov ecx, eax
call fcn.0044f9c0
jmp 0x4071f0
xor eax, eax
mov dword [0x4c2638], eax
mov dword [0x4be27c], 0
mov eax, dword [vtable.CDHCriticalSection.0]
mov ecx, 0x4be280
mov byte [ebp - 4], 9
call dword [eax + 8]
mov eax, dword [0x4c2638]
mov byte [ebp - 4], 3
push str.reinstall
push str.installpkg
push eax
call fcn.00450840
add esp, 0xc
mov dword [0x4c24d4], 2
lea eax, [ebp - 0x424]
mov dword [ebp - 0x424], 1
push 4
push eax
push 4
push str.Override
push str.SOFTWARELDSGameMaster
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.SHLWAPI.dll_SHSetValueW]
push 0x485fe4
jmp 0x407521
jne 0x407512
call fcn.0040b4c0
mov ecx, eax
test ecx, ecx
je 0x407592
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x41c], eax
push 0xd4
lea ecx, [ebp - 0x41c]
mov byte [ebp - 4], 0xa
call fcn.00406bc0
test al, al
jne 0x4072d0
mov ecx, 0xd4
lea edx, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4072b0
sub ecx, edx
sar ecx, 1
push ecx
push 0xd4
lea ecx, [ebp - 0x41c]
call fcn.00416a50
mov esi, dword [ebp - 0x41c]
push 0x4846a4
push esi
call fcn.004405f1
xor ebx, ebx
mov byte [ebp - 4], 3
add esp, 8
test eax, eax
mov eax, edi
sete bl
add esi, 0xfffffff0
lock xadd dword [esi + 0xc], eax
dec eax
test eax, eax
jg 0x407306
mov ecx, dword [esi]
push esi
mov eax, dword [ecx]
call dword [eax + 4]
test ebx, ebx
je 0x407512
mov dword [0x4c24d4], 3
call fcn.0040b4c0
mov ecx, eax
test ecx, ecx
je 0x40759c
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x41c], eax
push 0xdd
lea ecx, [ebp - 0x41c]
mov byte [ebp - 4], 0xc
call fcn.00406bc0
test al, al
jne 0x407375
mov ecx, 0xdd
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407355
sub ecx, edx
sar ecx, 1
push ecx
push 0xdd
lea ecx, [ebp - 0x41c]
call fcn.00416a50
lea eax, [ebp - 0x424]
mov byte [ebp - 4], 0xd
push eax
call fcn.0040af00
add esp, 4
push str...LDSGamePlayerPKLDSBox_7.exe
push dword [ebp - 0x424]
lea eax, [ebp - 0x418]
mov byte [ebp - 4], 0xe
push eax
call dword [sym.imp.SHLWAPI.dll_PathCombineW]
lea eax, [ebp - 0x418]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40748d
push 0x200
lea eax, [ebp - 0x210]
push 0
push eax
call fcn.00432c40
push 0x100
lea eax, [ebp - 0x210]
push eax
lea eax, [ebp - 0x418]
push eax
call fcn.00452ab0
add esp, 0x18
call fcn.0040b4c0
mov ecx, eax
test ecx, ecx
je 0x4075a6
mov eax, dword [ecx]
call dword [eax + 0xc]
add eax, 0x10
mov dword [ebp - 0x42c], eax
lea eax, [ebp - 0x210]
mov byte [ebp - 4], 0xf
push eax
lea ecx, [ebp - 0x42c]
call fcn.00406bc0
test al, al
jne 0x407449
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x407427
sub ecx, edx
lea eax, [ebp - 0x210]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x42c]
call fcn.00416a50
lea eax, [ebp - 0x42c]
mov byte [ebp - 4], 0x10
push eax
lea eax, [ebp - 0x41c]
push eax
call fcn.00452880
mov edx, dword [ebp - 0x42c]
add esp, 8
test eax, eax
mov byte [ebp - 4], 0xe
mov eax, edi
setg bl
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x407489
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
test bl, bl
je 0x4074ce
push 4
lea eax, [ebp - 0x42c]
mov dword [0x4c24d4], 2
push eax
push 4
push str.Override
push str.SOFTWARELDSGameMaster
push reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 0x42c], 1
call dword [sym.imp.SHLWAPI.dll_SHSetValueW]
push 0x486040
call fcn.0044e890
add esp, 4
mov edx, dword [ebp - 0x424]
mov eax, edi
mov byte [ebp - 4], 0xd
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x4074ef
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x41c]
mov eax, edi
mov byte [ebp - 4], 3
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x407529
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x407529
mov dword [0x4c24d4], 3
push 0x48605c
call fcn.0044e890
add esp, 4
mov edx, dword [ebp - 0x420]
mov eax, edi
mov byte [ebp - 4], 2
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], eax
dec eax
test eax, eax
jg 0x40754a
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov edx, dword [ebp - 0x428]
mov dword [ebp - 4], 0xffffffff
add edx, 0xfffffff0
lock xadd dword [edx + 0xc], edi
dec edi
test edi, edi
jg 0x40756c
mov ecx, dword [edx]
push edx
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0042c75e
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.004068b0
push 0x80004005
call fcn.004068b0
push 0x80004005
call fcn.004068b0
push 0x80004005
call fcn.004068b0
int3