Function at 0x401f50
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov eax, 0x417c
mov ebp, esp
push edi
push esi
push ebx
call fcn.0040b8d0
cld
mov eax, dword [ebp + 0x10]
mov esi, str.SYSTEMCurrentControlSetServices_
mov edx, dword [ebp + 0x14]
lea edi, [ebp - 0x128]
mov ecx, 8
mov dword [ebp - 0x4144], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x4148], edx
mov edx, dword [ebp + 0x28]
mov dword [ebp - 0x414c], eax
mov eax, dword [ebp + 0x2c]
mov dword [ebp - 0x4150], edx
mov edx, dword [ebp + 0x30]
mov dword [ebp - 0x4154], eax
xor eax, eax
mov dword [ebp - 0x412c], eax
xor eax, eax
mov dword [ebp - 0x4158], edx
mov dword [ebp - 0x4138], eax
rep movsd dword es:[edi], dword [esi]
movzx eax, word [0x40e3fc]
lea esi, [ebp - 0x128]
mov word [edi], ax
movzx eax, byte [0x40e3fe]
mov byte [edi + 2], al
mov eax, dword [ebp + 8]
mov dword [esp], esi
mov edi, 0x74656d61
mov dword [esp + 4], eax
call sub.cygwin1.dll_strcat
mov dword [esp], eax
mov ebx, eax
call sub.cygwin1.dll_strlen
mov dword [ebx + eax], 0x7261505c
mov ecx, 0x737265
mov edx, 0x20019
mov dword [ebx + eax + 4], edi
mov dword [ebx + eax + 8], ecx
lea eax, [ebp - 0x412c]
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov edx, dword [ebp + 0xc]
mov dword [esp], edx
call sub.ADVAPI32.DLL_RegOpenKeyExA
sub esp, 0x14
test eax, eax
mov ebx, eax
jne 0x402080
xor eax, eax
lea edi, [ebp - 0x4134]
mov dword [ebp - 0x4130], eax
lea eax, [ebp - 0x4130]
mov dword [esp + 0x14], eax
xor eax, eax
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, str.AppPath
mov dword [esp + 0xc], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
mov ebx, eax
je 0x4020d0
nop
mov edx, dword [ebp - 0x4148]
mov eax, dword [ebp - 0x4144]
mov dword [edx], 0
mov edx, dword [ebp - 0x414c]
mov dword [eax], 0
mov dword [edx], 0
mov eax, dword [ebp - 0x4138]
test eax, eax
jne 0x402555
mov eax, dword [ebp - 0x412c]
test eax, eax
jne 0x402540
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [ebp - 0x4130]
mov ebx, 0xe
mov dword [esp], eax
call sub.cygwin1.dll_malloc
mov edx, dword [ebp - 0x4144]
test eax, eax
mov dword [edx], eax
je 0x402080
lea eax, [ebp - 0x4130]
mov ebx, str.AppPath
mov dword [esp + 0x14], eax
mov eax, dword [edx]
mov dword [esp + 4], ebx
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
mov ebx, eax
jne 0x402080
mov edx, dword [ebp - 0x4148]
mov ecx, str.AppArgs
mov dword [esp + 4], ecx
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call fcn.00401ca0
test eax, eax
mov ebx, eax
jne 0x402080
mov eax, dword [ebp + 0x18]
mov edx, str.WorkingDirectory
mov dword [esp + 4], edx
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call fcn.00401ca0
test eax, eax
mov ebx, eax
jne 0x402080
mov eax, dword [ebp + 0x34]
mov dword [esp + 8], eax
mov eax, str.PidFile
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call fcn.00401ca0
test eax, eax
mov ebx, eax
jne 0x402080
mov eax, 4
mov dword [ebp - 0x4130], eax
lea eax, [ebp - 0x4130]
mov dword [esp + 0x14], eax
mov edx, dword [ebp + 0x20]
xor eax, eax
mov dword [esp + 8], eax
mov eax, str.TermSig
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x4021f5
mov eax, dword [ebp + 0x20]
mov dword [eax], 0xf
mov eax, 4
lea edx, [ebp - 0x4130]
mov ebx, str.ShutSig
mov dword [ebp - 0x4130], eax
mov dword [esp + 0x14], edx
mov eax, dword [ebp + 0x24]
mov dword [esp + 0xc], edi
mov dword [esp + 4], ebx
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x402243
mov edx, dword [ebp + 0x20]
mov eax, dword [edx]
mov edx, dword [ebp + 0x24]
mov dword [edx], eax
mov ecx, 4
lea eax, [ebp - 0x4130]
mov dword [ebp - 0x4130], ecx
mov dword [esp + 0x14], eax
mov edx, dword [ebp + 0x38]
mov eax, str.NeverExits
mov dword [esp + 0xc], edi
mov dword [esp + 4], eax
mov dword [esp + 0x10], edx
xor edx, edx
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x402290
mov eax, dword [ebp + 0x38]
mov dword [eax], 0
mov eax, 4
lea edx, [ebp - 0x4130]
mov dword [ebp - 0x4130], eax
mov dword [esp + 0x14], edx
mov eax, dword [ebp + 0x3c]
mov dword [esp + 0xc], edi
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 8], eax
mov eax, str.Preshutdown
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x4022dd
mov edx, dword [ebp + 0x3c]
mov dword [edx], 0
mov eax, 4
mov ebx, str.Shutdown
mov dword [ebp - 0x4130], eax
lea eax, [ebp - 0x4130]
mov dword [esp + 0x14], eax
mov edx, dword [ebp + 0x40]
xor eax, eax
mov dword [esp + 0xc], edi
mov dword [esp + 8], eax
mov dword [esp + 0x10], edx
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x40232a
mov eax, dword [ebp + 0x40]
mov dword [eax], 0
mov ecx, 4
lea edx, [ebp - 0x4130]
mov dword [ebp - 0x4130], ecx
mov dword [esp + 0x14], edx
mov eax, dword [ebp + 0x44]
xor edx, edx
mov dword [esp + 0xc], edi
mov dword [esp + 8], edx
mov dword [esp + 0x10], eax
mov eax, str.Interactive
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x402377
mov edx, dword [ebp + 0x44]
mov dword [edx], 0
mov eax, 4
mov dword [ebp - 0x4130], eax
lea eax, [ebp - 0x4130]
mov dword [esp + 0x14], eax
mov edx, dword [ebp + 0x48]
xor eax, eax
mov dword [esp + 8], eax
mov eax, str.ShowConsole
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegQueryValueExA
sub esp, 0x18
test eax, eax
je 0x4023c4
mov eax, dword [ebp + 0x48]
mov dword [eax], 0
mov edx, dword [ebp - 0x4150]
mov eax, str.StdIn
mov dword [esp + 4], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call fcn.00401ca0
test eax, eax
mov ebx, eax
jne 0x402080
mov eax, dword [ebp + 8]
mov dword [esp], 0
mov edx, dword [ebp - 0x4150]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
call fcn.00401d80
test eax, eax
jne 0x4020a4
mov eax, dword [ebp - 0x4154]
mov dword [esp + 8], eax
mov eax, str.StdOut
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call fcn.00401ca0
test eax, eax
mov ebx, eax
jne 0x402080
mov edx, dword [ebp + 8]
mov dword [esp], 1
mov eax, dword [ebp - 0x4154]
mov dword [esp + 8], edx
mov dword [esp + 4], eax
call fcn.00401d80
test eax, eax
jne 0x4020a4
mov edx, dword [ebp - 0x4158]
mov edi, str.StdErr
mov dword [esp + 4], edi
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x412c]
mov dword [esp], eax
call fcn.00401ca0
test eax, eax
mov ebx, eax
jne 0x402080
mov eax, dword [ebp + 8]
mov dword [esp], 2
mov edx, dword [ebp - 0x4158]
mov dword [esp + 8], eax
mov dword [esp + 4], edx
call fcn.00401d80
test eax, eax
jne 0x4020a4
mov dword [esp], esi
mov ebx, 0x5c
mov edi, 0x746e65
call sub.cygwin1.dll_strlen
mov word [ebp + eax - 0x128], bx
mov ebx, 0x20019
mov dword [esp], esi
call sub.cygwin1.dll_strlen
mov ecx, 0x69766e45
mov edx, 0x6d6e6f72
mov dword [ebp + eax - 0x128], ecx
xor ecx, ecx
mov dword [esi + eax + 4], edx
mov dword [esi + eax + 8], edi
lea eax, [ebp - 0x4138]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], ebx
mov dword [esp + 8], ecx
mov dword [esp + 4], esi
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegOpenKeyExA
sub esp, 0x14
test eax, eax
je 0x402565
mov edx, dword [ebp - 0x4148]
mov eax, dword [edx]
test eax, eax
je 0x402533
cmp byte [eax], 0
je 0x40272c
xor ebx, ebx
jmp 0x4020a4
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegCloseKey
sub esp, 4
jmp 0x4020b2
mov dword [esp], 0x100
mov edx, 8
mov ebx, 0xe
mov dword [esp + 4], edx
call sub.cygwin1.dll_calloc
mov edx, dword [ebp - 0x414c]
test eax, eax
mov dword [edx], eax
je 0x402080
xor eax, eax
xor edi, edi
mov dword [ebp - 0x415c], eax
jmp 0x4025b6
inc dword [ebp - 0x415c]
cmp dword [ebp - 0x415c], 0x101
jg 0x402703
xor eax, eax
lea edx, [ebp - 0x4140]
mov dword [ebp - 0x413c], eax
lea eax, [ebp - 0x413c]
mov dword [esp + 0x1c], eax
xor eax, eax
mov dword [esp + 0x18], eax
xor eax, eax
mov dword [esp + 0x10], eax
mov eax, 0x4000
mov dword [esp + 0x14], edx
lea edx, [ebp - 0x4128]
mov dword [ebp - 0x4130], eax
lea eax, [ebp - 0x4130]
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x415c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4138]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegEnumValueA
sub esp, 0x20
cmp eax, 0x103
mov ebx, eax
je 0x402703
test eax, eax
setne dl
cmp eax, 0xea
setne al
test al, dl
jne 0x4026ec
cmp dword [ebp - 0x4140], 1
jne 0x4025a0
mov eax, dword [ebp - 0x413c]
mov dword [esp], eax
call sub.cygwin1.dll_malloc
test eax, eax
mov esi, eax
je 0x4026f9
mov dword [esp + 0x18], eax
lea edx, [ebp - 0x413c]
xor eax, eax
mov dword [esp + 0x1c], edx
xor ebx, ebx
mov ecx, 0x4000
mov dword [esp + 0x14], eax
lea edx, [ebp - 0x4128]
lea eax, [ebp - 0x4130]
mov dword [esp + 0x10], ebx
mov dword [ebp - 0x4130], ecx
mov dword [esp + 0xc], eax
mov dword [esp + 8], edx
mov eax, dword [ebp - 0x415c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x4138]
mov dword [esp], eax
call sub.ADVAPI32.DLL_RegEnumValueA
sub esp, 0x20
test eax, eax
mov ebx, eax
jne 0x402080
mov edx, dword [ebp - 0x414c]
lea eax, [ebp - 0x4128]
mov ebx, dword [edx]
mov dword [esp], eax
call sub.cygwin1.dll_strdup
mov dword [ebx + edi*8], eax
test eax, eax
je 0x4026f9
mov edx, dword [ebp - 0x414c]
mov eax, dword [edx]
mov dword [eax + edi*8 + 4], esi
inc edi
jmp 0x4025a0
test ebx, ebx
je 0x4020a4
jmp 0x402080
mov ebx, 0xe
jmp 0x402080
test edi, edi
jne 0x40251e
mov edx, dword [ebp - 0x414c]
mov eax, dword [edx]
mov dword [esp], eax
call sub.cygwin1.dll_free
mov eax, dword [ebp - 0x414c]
mov dword [eax], 0
jmp 0x40251e
mov dword [esp], eax
xor ebx, ebx
call sub.cygwin1.dll_free
mov eax, dword [ebp - 0x4148]
mov dword [eax], 0
jmp 0x4020a4