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

Disassembly:
sub esp, 0x324
cmp dword [ebx], 0
push ebp
push esi
push edi
je 0x40a2b2
mov ecx, dword [ebx + 4]
mov edi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
lea eax, [esp + 0xc]
push eax
push 0x20019
xor esi, esi
push esi
push ecx
push 0x80000001
mov dword [esp + 0x24], 0x105
call edi
mov ebp, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x40a14c
lea edx, [esp + 0x10]
push edx
mov edx, dword [ebx + 8]
lea eax, [esp + 0x124]
push eax
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x1c]
push ecx
push esi
push edx
push eax
call ebp
test eax, eax
jne 0x40a139
cmp dword [ebx + 0xc], esi
je 0x40a122
lea ecx, [esp + 0x120]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x40a11d
lea edx, [esp + 0x120]
push edx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryA]
test eax, eax
je 0x40a134
cmp dword [ebx + 0xc], esi
jne 0x40a139
lea eax, [esp + 0x120]
push eax
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryA]
test eax, eax
je 0x40a139
mov esi, 1
mov ecx, dword [esp + 0xc]
push ecx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
jne 0x40a1e7
mov eax, dword [ebx + 4]
lea edx, [esp + 0xc]
push edx
push 0x20019
push 0
push eax
push 0x80000002
call edi
test eax, eax
jne 0x40a3db
lea ecx, [esp + 0x10]
push ecx
mov ecx, dword [ebx + 8]
lea edx, [esp + 0x124]
push edx
mov edx, dword [esp + 0x14]
lea eax, [esp + 0x1c]
push eax
push 0
push ecx
push edx
call ebp
test eax, eax
jne 0x40a1d4
cmp dword [ebx + 0xc], eax
je 0x40a1bd
lea eax, [esp + 0x120]
push eax
call dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
test eax, eax
je 0x40a1b7
lea ecx, [esp + 0x120]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryA]
test eax, eax
je 0x40a1cf
cmp dword [ebx + 0xc], 0
jne 0x40a1d4
lea edx, [esp + 0x120]
push edx
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryA]
test eax, eax
je 0x40a1d4
mov esi, 1
mov eax, dword [esp + 0xc]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
test esi, esi
je 0x40a3db
xor eax, eax
lea esp, [esp]
mov cl, byte [esp + eax + 0x120]
mov byte [esp + eax + 0x228], cl
inc eax
test cl, cl
jne 0x40a1f0
xor eax, eax
jmp 0x40a210
mov cl, byte [esp + eax + 0x120]
mov byte [esp + eax + 0x18], cl
inc eax
test cl, cl
jne 0x40a210
cmp dword [ebx + 0xc], 0
jne 0x40a36b
mov ebp, dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
lea ecx, [esp + 0x228]
push ecx
call ebp
mov eax, dword [ebx + 0x18]
mov esi, eax
nop
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a240
lea edi, [esp + 0x228]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a251
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea edx, [esp + 0x18]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call ebp
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40a292
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a277
lea edi, [esp + 0x18]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a285
jmp 0x40a35b
mov eax, dword [ebx + 0x18]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a297
lea edi, [esp + 0x18]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a2a5
jmp 0x40a35b
mov esi, dword [ebx + 0x10]
lea edx, [esp + 0x228]
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a2c0
lea edx, [esp + 0x18]
mov eax, esi
sub edx, esi
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a2d2
mov ebp, dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
lea eax, [esp + 0x228]
push eax
call ebp
mov eax, dword [ebx + 0x18]
mov esi, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a2f1
lea edi, [esp + 0x228]
sub eax, esi
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a302
mov ecx, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0x18]
push ecx
call ebp
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x40a340
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a328
lea edi, [esp + 0x18]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a336
jmp 0x40a35b
mov eax, dword [ebx + 0x18]
mov edx, eax
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x40a345
lea edi, [esp + 0x18]
sub eax, edx
dec edi
mov cl, byte [edi + 1]
inc edi
test cl, cl
jne 0x40a353
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
lea edx, [esp + 0x18]
push edx
call esi
test eax, eax
je 0x40a3db
lea eax, [esp + 0x228]
push eax
call esi
test eax, eax
je 0x40a3db
mov edx, dword [esp + 0x334]
test edx, edx
je 0x40a3aa
lea eax, [esp + 0x228]
mov ecx, eax
sub edx, ecx
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a3a0
mov edx, dword [esp + 0x338]
test edx, edx
je 0x40a3ca
lea eax, [esp + 0x18]
mov ecx, eax
sub edx, ecx
lea ecx, [ecx]
mov cl, byte [eax]
mov byte [edx + eax], cl
inc eax
test cl, cl
jne 0x40a3c0
pop edi
pop esi
mov eax, 1
pop ebp
add esp, 0x324
ret 8
pop edi
pop esi
xor eax, eax
pop ebp
add esp, 0x324
ret 8