Function at 0x40c8d0
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x52c
mov eax, dword [0x4a9bf0]
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 0x40c905
lea eax, [ebp - 0x518]
push 0x5c
push eax
call fcn.0046f111
add esp, 8
test eax, eax
je 0x40c933
mov byte [eax], 0
inc eax
mov dword [ebp - 0x52c], eax
jmp 0x40c940
mov dword [ebp - 0x52c], esi
mov byte [ebp - 0x518], 0
lea esi, [ebp - 0x518]
push 0x5c
push esi
call fcn.0046e733
mov edi, eax
add esp, 8
test edi, edi
jne 0x40c96b
cmp byte [esi], al
je 0x40c9d5
mov ecx, esi
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40c960
sub ecx, edx
jmp 0x40c96f
mov ecx, edi
sub ecx, esi
push ecx
lea eax, [ebp - 0x130]
push esi
push eax
call fcn.00408830
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 0x40ca5d
cmp ebx, dword [ebp - 0x528]
je 0x40c9c0
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ebx, dword [ebp - 0x520]
test edi, edi
je 0x40c9d5
lea esi, [edi + 1]
test esi, esi
jne 0x40c946
test ebx, ebx
je 0x40cba7
mov ecx, dword [ebp + 0x14]
mov edx, dword [ebp + 0x10]
test ecx, ecx
jg case.0x40c9f6.2
lea eax, [edx - 1]
cmp eax, 0xa
ja case.0x40c9f6.2
movzx eax, byte [eax + 0x40cbcc]
jmp dword [eax*4 + 0x40cbbc]
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 0x40ca29
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.0046300c
mov esp, ebp
pop ebp
ret
mov ecx, 8
jmp case.0x40c9f6.2
mov edi, dword [ebp - 0x524]
mov ecx, edi
lea esi, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x40ca51
sub ecx, esi
inc ecx
jmp 0x40ca08
test edi, edi
je 0x40ca6b
lea eax, [ebp - 0x518]
sub edi, eax
jmp 0x40ca7d
lea edi, [ebp - 0x518]
lea ecx, [edi + 1]
mov al, byte [edi]
inc edi
test al, al
jne 0x40ca74
sub edi, ecx
lea esi, [ebp - 0x518]
lea ecx, [esi + 1]
mov al, byte [esi]
inc esi
test al, al
jne 0x40ca86
sub esi, ecx
test edi, edi
jle 0x40ca9a
cmp edi, esi
cmovge edi, esi
mov esi, edi
lea eax, [ebp + esi - 0x519]
lea ecx, [ebp - 0x518]
cmp eax, ecx
jbe 0x40cad1
nop dword [eax + eax]
mov cl, byte [eax]
test cl, cl
je 0x40cac5
cmp cl, 0x20
je 0x40cac5
cmp cl, 0xa0
je 0x40cac5
cmp cl, 9
jne 0x40cad1
dec eax
lea ecx, [ebp - 0x518]
dec esi
cmp eax, ecx
ja 0x40cab0
lea ecx, [ebp - 0x518]
mov edx, ecx
cmp edx, eax
ja 0x40cb01
nop dword [eax]
mov dl, byte [ecx]
cmp dl, 0x20
je 0x40caf1
cmp dl, 0xa0
je 0x40caf1
cmp dl, 9
jne 0x40caf7
inc ecx
dec esi
cmp ecx, eax
jbe 0x40cae0
lea eax, [ebp - 0x130]
cmp eax, ecx
je 0x40cb12
push esi
push ecx
lea eax, [ebp - 0x130]
push eax
call fcn.004643e0
add esp, 0xc
mov byte [ebp + esi - 0x130], 0
call fcn.0041fd60
test eax, eax
je 0x40cb98
call fcn.0041fd60
cmp dword [eax], 0
je 0x40cb98
mov eax, dword [0x4bd720]
test eax, eax
je 0x40cb3e
mov esi, dword [eax + 0x190]
jmp 0x40cb44
mov esi, dword [0x4bd724]
call fcn.0041fd60
test eax, eax
je 0x40cb56
call fcn.0041fd60
mov edi, dword [eax]
jmp 0x40cb58
xor edi, edi
push str.Error_creating_Key:_HKLMSoftware_s:__s
push 0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
call fcn.0040b160
add esp, 8
push eax
lea eax, [ebp - 0x130]
push eax
push str.Error_creating_Key:_HKLMSoftware_s:__s
push dword [0x4bd720]
push esi
push 0
push 0x1234
push str.D:MyProjectsProPilotLibMisc.c
push 0x103
call edi
add esp, 0x28
cmp ebx, dword [ebp - 0x528]
je 0x40cba7
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.0046300c
mov esp, ebp
pop ebp
ret