Function at 0x402040
Capabilities:
Check if file exists
Query or enumerate registry value

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x420321
push eax
mov eax, 0x2220
mov dword fs:[0], esp
call fcn.00414240
mov ax, word [0x42b98c]
push ebx
push esi
mov esi, ecx
push edi
mov word [esp + 0x24], ax
mov ecx, 0x81
xor eax, eax
lea edi, [esp + 0x26]
xor ebx, ebx
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
mov eax, dword [esp + 0x2240]
mov dword [esp + 0x10], ebx
cmp eax, ebx
mov dword [esp + 0x20], 1
mov dword [esp + 0x1c], 0x104
jne 0x4020bc
mov ecx, dword [esi]
cmp dword [ecx - 8], ebx
je 0x4020bc
push esi
mov esi, dword [esp + 0x2240]
mov ecx, esi
call fcn.00413e4a
mov eax, esi
jmp 0x402385
cmp dword [esi + 0xc], ebx
je 0x402100
mov eax, dword [esi + 0x18]
lea edx, [esp + 0x1c]
mov ecx, dword [esi + 0x14]
push edx
lea edx, [esp + 0x28]
push edx
lea edx, [esp + 0x28]
push edx
push eax
mov eax, dword [esi + 0x10]
push ecx
push eax
call dword [0x4224d8]
lea ecx, [esp + 0x24]
push ecx
call dword [sym.imp.MSVCRT.dll_wcslen]
add esp, 4
test eax, eax
jne 0x402113
lea edx, [esp + 0x24]
push str.configdefaultskin
push edx
jmp 0x40210a
lea eax, [esp + 0x24]
push str.configdefaultskin
push eax
call dword [sym.imp.MSVCRT.dll_wcscpy]
add esp, 8
lea ecx, [esp + 0x24]
push ecx
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_1
push 1
push 0x5c
lea ecx, [esp + 0x14]
call sub.MFC42u.DLL_CString::CString_1
lea edx, [esp + 0x10]
push 1
push edx
mov ecx, esi
mov dword [esp + 0x223c], ebx
call sub.MFC42u.DLL_CString::Right
mov ecx, dword [esp + 0xc]
mov edx, dword [eax]
mov edi, dword [sym.imp.MSVCRT.dll_wcscmp]
push ecx
push edx
mov byte [esp + 0x223c], 1
call edi
add esp, 8
cmp eax, ebx
je 0x4021b3
push 1
push 0x2f
lea ecx, [esp + 0x1c]
call sub.MFC42u.DLL_CString::CString_1
lea eax, [esp + 0x18]
push 1
push eax
mov ecx, esi
mov byte [esp + 0x223c], 2
call sub.MFC42u.DLL_CString::Right
mov ecx, dword [esp + 0x14]
mov edx, dword [eax]
push ecx
push edx
call edi
add esp, 8
cmp eax, ebx
lea ecx, [esp + 0x18]
sete bl
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0x14]
mov byte [esp + 0x2234], 1
call sub.MFC42u.DLL_CString::CString
test bl, bl
je 0x4021b5
mov bl, 1
lea ecx, [esp + 0x10]
mov byte [esp + 0x2234], 0
call sub.MFC42u.DLL_CString::CString
lea ecx, [esp + 0xc]
mov dword [esp + 0x2234], 0xffffffff
call sub.MFC42u.DLL_CString::CString
test bl, bl
je 0x4021ee
mov eax, dword [esi]
push 1
mov ecx, dword [eax - 8]
dec ecx
push ecx
mov ecx, esi
call sub.MFC42u.DLL_CString::Delete
mov ebx, dword [sym.imp.MSVCRT.dll_wcsncpy]
lea edx, [esp + 0x22c]
push ebp
mov ebp, dword [0x4224f0]
test edx, edx
je 0x402259
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x1230]
push 0x800
rep stosd dword es:[edi], eax
lea eax, [esp + 0x1234]
mov word [esp + 0x234], 0
push eax
push 0
call dword [0x4220c8]
lea ecx, [esp + 0x1230]
push ecx
call ebp
lea edx, [esp + 0x1230]
push 0x400
lea eax, [esp + 0x234]
push edx
push eax
call ebx
add esp, 0xc
mov eax, dword [esi + 8]
xor edi, edi
test eax, eax
jle 0x402274
lea ecx, [esp + 0x230]
push ecx
call ebp
mov eax, dword [esi + 8]
inc edi
cmp edi, eax
jl 0x402262
mov edx, dword [esi]
lea eax, [esp + 0x230]
push edx
lea ecx, [esp + 0x234]
push eax
push ecx
call dword [0x4224e0]
lea edx, [esp + 0x230]
test edx, edx
je 0x402367
mov ecx, 0x200
xor eax, eax
lea edi, [esp + 0xa30]
rep stosd dword es:[edi], eax
lea eax, [esp + 0xa30]
test eax, eax
je 0x402367
mov ecx, 0x400
xor eax, eax
lea edi, [esp + 0x1230]
mov word [esp + 0xa30], 0
rep stosd dword es:[edi], eax
lea ecx, [esp + 0x230]
push ecx
call dword [0x4224d4]
test eax, eax
je 0x40233b
lea edx, [esp + 0x1230]
push 0x800
push edx
push 0
call dword [0x4220c8]
lea eax, [esp + 0x1230]
push eax
call ebp
lea ecx, [esp + 0x230]
lea edx, [esp + 0x1230]
push ecx
lea eax, [esp + 0x1234]
push edx
push eax
call dword [0x4224e0]
lea ecx, [esp + 0x1230]
push 0x400
lea edx, [esp + 0xa34]
push ecx
push edx
jmp 0x402350
lea eax, [esp + 0x230]
push 0x400
lea ecx, [esp + 0xa34]
push eax
push ecx
call ebx
add esp, 0xc
lea edx, [esp + 0xa30]
push edx
call dword [0x4224ec]
test eax, eax
jne 0x402373
push str.configdefaultskin
mov ecx, esi
call sub.MFC42u.DLL_CString::operator_1
push esi
mov esi, dword [esp + 0x2244]
mov ecx, esi
call fcn.00413e4a
mov eax, esi
pop ebp
mov ecx, dword [esp + 0x222c]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x222c
ret 8