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

Disassembly:
push 0xffffffffffffffff
push 0x4102f7
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x264
push ebx
push ebp
push esi
push edi
xor edi, edi
mov esi, 0x104
xor ebp, ebp
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], esi
lea eax, [esp + 0x20]
mov dword [esp + 0x27c], ebp
push eax
push 0xf003f
push ebp
push 0x4145cc
push 0x80000001
mov dword [esp + 0x34], ebp
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
cmp eax, ebp
jne 0x403d7e
mov ebx, dword [esp + 0x20]
mov edi, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
lea ecx, [esp + 0x28]
lea edx, [esp + 0x24]
push ecx
lea eax, [esp + 0x18]
push edx
push eax
push ebp
push 0x4145c0
push ebx
mov dword [esp + 0x70], ebx
mov dword [esp + 0x3c], ebp
mov dword [esp + 0x2c], ebp
mov dword [esp + 0x40], 4
call edi
cmp eax, ebp
jne 0x403d56
cmp dword [esp + 0x24], 1
jne 0x403d56
push 0x414544
call fcn.00402ff0
add esp, 4
test eax, eax
je 0x403d56
lea ecx, [esp + 0x18]
lea edx, [esp + 0x6c]
push ecx
lea eax, [esp + 0x18]
push edx
push eax
push ebp
push 0x4145b8
push ebx
mov dword [esp + 0x30], esi
mov dword [esp + 0x2c], ebp
call edi
cmp eax, ebp
jne 0x403d56
mov cl, byte [esp + 0x13]
push ebp
mov byte [esp + 0x3c], cl
lea ecx, [esp + 0x3c]
call fcn.00401ce0
lea edi, [esp + 0x6c]
or ecx, 0xffffffff
xor eax, eax
lea edx, [esp + 0x6c]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push edx
lea ecx, [esp + 0x40]
call fcn.00404450
lea eax, [esp + 0x170]
mov byte [esp + 0x27c], 1
push eax
call fcn.00403900
add esp, 4
test al, al
je 0x403d32
lea ecx, [esp + 0x170]
push 0x41451c
push ecx
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea ecx, [esp + 0x2c]
call fcn.00404670
lea edx, [esp + 0x170]
lea ecx, [esp + 0x2c]
push edx
mov byte [esp + 0x280], 2
call fcn.004046f0
push 0x4145b0
push 0x4145a0
lea eax, [esp + 0x64]
push 0x414598
push eax
lea ecx, [esp + 0x3c]
call fcn.00404870
mov esi, dword [eax + 4]
mov byte [esp + 0x27c], 3
cmp esi, ebp
jne 0x403c19
mov esi, 0x4111b0
mov cl, byte [esp + 0x13]
push ebp
mov byte [esp + 0x4c], cl
lea ecx, [esp + 0x4c]
call fcn.00401ce0
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push esi
lea ecx, [esp + 0x50]
call fcn.00404450
push 1
lea ecx, [esp + 0x60]
mov byte [esp + 0x280], 5
call fcn.00401ce0
mov eax, dword [esp + 0x3c]
cmp eax, ebp
jne 0x403c62
mov eax, 0x4111b0
mov ecx, dword [esp + 0x4c]
cmp ecx, ebp
jne 0x403c6f
mov ecx, 0x4111b0
push eax
push ecx
call fcn.00403950
add esp, 8
test eax, eax
je 0x403d0e
lea edx, [esp + 0x18]
lea eax, [esp + 0x6c]
push edx
lea ecx, [esp + 0x18]
push eax
push ecx
push ebp
push 0x41458c
push ebx
mov dword [esp + 0x30], 0x104
mov dword [esp + 0x2c], ebp
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
cmp eax, ebp
jne 0x403d0e
lea edx, [esp + 0x6c]
push edx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x403d0e
lea edi, [esp + 0x6c]
or ecx, 0xffffffff
xor eax, eax
mov ebx, dword [esp + 0x284]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push 1
mov ebp, ecx
mov ecx, ebx
push ebp
call fcn.00402070
test al, al
je 0x403d00
mov edi, dword [ebx + 4]
mov ecx, ebp
mov eax, ecx
lea esi, [esp + 0x6c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
push ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, ebx
call fcn.00402050
mov ebx, dword [esp + 0x20]
mov dword [esp + 0x1c], 1
xor ebp, ebp
push 1
lea ecx, [esp + 0x4c]
mov byte [esp + 0x280], 2
call fcn.00401ce0
lea ecx, [esp + 0x2c]
mov byte [esp + 0x27c], 1
call fcn.004046b0
mov ecx, dword [esp + 0x3c]
cmp ecx, ebp
je 0x403d56
mov al, byte [ecx - 1]
test al, al
je 0x403d4c
cmp al, 0xff
je 0x403d4c
dec al
mov byte [ecx - 1], al
jmp 0x403d56
dec ecx
push ecx
call fcn.00405716
add esp, 4
cmp ebx, ebp
je 0x403d61
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x274]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x270
ret
mov eax, edi
jmp 0x403d65