Function at 0x40a160
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x52c
mov eax, dword [0x479bf0]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x18]
lea edx, [ebp - 0x518]
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0xc]
mov ecx, esi
push edi
mov dword [ebp - 0x528], ebx
sub edx, esi
mov dword [ebp - 0x524], eax
mov al, byte [ecx]
lea ecx, [ecx + 1]
mov byte [edx + ecx - 1], al
test al, al
jne 0x40a195
lea eax, [ebp - 0x518]
push 0x5c
push eax
call fcn.00444792
add esp, 8
test eax, eax
je 0x40a1c3
mov byte [eax], 0
inc eax
mov dword [ebp - 0x52c], eax
jmp 0x40a1d0
mov dword [ebp - 0x52c], esi
mov byte [ebp - 0x518], 0
lea esi, [ebp - 0x518]
push 0x5c
push esi
call fcn.0044417b
mov edi, eax
add esp, 8
test edi, edi
jne 0x40a1fb
cmp byte [esi], al
je 0x40a265
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a1f0
sub ecx, edx
jmp 0x40a1ff
mov ecx, edi
sub ecx, esi
push ecx
lea eax, [ebp - 0x130]
push esi
push eax
call fcn.00406540
add esp, 0xc
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x520]
push eax
push 0
push 0x20006
push 0
push 0
push 0
lea eax, [ebp - 0x130]
push eax
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExA]
test eax, eax
jne 0x40a2ed
cmp ebx, dword [ebp - 0x528]
je 0x40a250
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [ebp - 0x520]
test edi, edi
je 0x40a265
lea esi, [edi + 1]
test esi, esi
jne 0x40a1d6
test ebx, ebx
je 0x40a437
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
test ecx, ecx
jg case.0x40a286.2
lea eax, [edx - 1]
cmp eax, 0xa
ja case.0x40a286.2
movzx eax, byte [eax + 0x40a45c]
jmp dword [eax*4 + 0x40a44c]
mov ecx, 4
mov edi, dword [ebp - 0x524]
push ecx
push edi
push edx
push 0
push dword [ebp - 0x52c]
push ebx
call dword [sym.imp.ADVAPI32.dll_RegSetValueExA]
cmp ebx, dword [ebp - 0x528]
je 0x40a2b9
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
pop esi
mov eax, 1
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004380f8
mov esp, ebp
pop ebp
ret
mov ecx, 8
jmp case.0x40a286.2
mov edi, dword [ebp - 0x524]
mov ecx, edi
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40a2e1
sub ecx, esi
inc ecx
jmp 0x40a298
test edi, edi
je 0x40a2fb
lea eax, [ebp - 0x518]
sub edi, eax
jmp 0x40a30d
lea edi, [ebp - 0x518]
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x40a304
sub edi, ecx
lea esi, [ebp - 0x518]
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x40a316
sub esi, ecx
test edi, edi
jle 0x40a32a
cmp edi, esi
cmovge edi, esi
mov esi, edi
lea eax, [ebp + esi - 0x519]
lea ecx, [ebp - 0x518]
cmp eax, ecx
jbe 0x40a361
nop dword [eax + eax]
mov cl, byte [eax]
test cl, cl
je 0x40a355
cmp cl, 0x20
je 0x40a355
cmp cl, 0xa0
je 0x40a355
cmp cl, 9
jne 0x40a361
dec eax
lea ecx, [ebp - 0x518]
dec esi
cmp eax, ecx
ja 0x40a340
lea ecx, [ebp - 0x518]
mov edx, ecx
cmp edx, eax
ja 0x40a391
nop dword [eax]
mov dl, byte [ecx]
cmp dl, 0x20
je 0x40a381
cmp dl, 0xa0
je 0x40a381
cmp dl, 9
jne 0x40a387
inc ecx
dec esi
cmp ecx, eax
jbe 0x40a370
lea eax, [ebp - 0x130]
cmp eax, ecx
je 0x40a3a2
push esi
push ecx
lea eax, [ebp - 0x130]
push eax
call fcn.004394d0
add esp, 0xc
mov byte [ebp + esi - 0x130], 0
call fcn.00415230
test eax, eax
je 0x40a428
call fcn.00415230
cmp dword [eax], 0
je 0x40a428
mov eax, dword [0x48d5e0]
test eax, eax
je 0x40a3ce
mov esi, dword [eax + 0x190]
jmp 0x40a3d4
mov esi, dword [0x48d5e4]
call fcn.00415230
test eax, eax
je 0x40a3e6
call fcn.00415230
mov edi, dword [eax]
jmp 0x40a3e8
xor edi, edi
push str.Error_creating_Key:_HKLMSoftware_s:__s
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.00408c60
add esp, 8
push eax
lea eax, [ebp - 0x130]
push eax
push str.Error_creating_Key:_HKLMSoftware_s:__s
push dword [0x48d5e0]
push esi
push 0
push 0x1234
push str.D:MyProjectsProPilotLibMisc.c
push 0x103
call edi
add esp, 0x28
cmp ebx, dword [ebp - 0x528]
je 0x40a437
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004380f8
mov esp, ebp
pop ebp
ret