Function at 0x1004ef8
Capabilities:
Generate random numbers via winapi

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0xd0
mov eax, dword [0x100e0a8]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0xb8], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xb0], eax
mov eax, dword [ebp + 0x10]
push ebx
mov dword [ebp - 0xb4], eax
xor eax, eax
push esi
push edi
xor ebx, ebx
mov byte [ebp - 0xd0], bl
lea edi, [ebp - 0xcf]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x1f
mov word [ebp - 0x84], bx
pop ecx
xor eax, eax
lea edi, [ebp - 0x82]
rep stosd dword es:[edi], eax
mov byte [ebp - 0x9d], bl
mov dword [ebp - 0xa8], ebx
mov dword [ebp - 0xac], ebx
mov dword [ebp - 0xa4], ebx
stosw word es:[edi], ax
call dword [sym.imp.USER32.dll_GetProcessWindowStation]
cmp eax, ebx
mov dword [ebp - 0xbc], eax
je 0x1005215
mov esi, dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
lea eax, [ebp - 0xa8]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x220
push 0x20
push 2
lea eax, [ebp - 0x8c]
push eax
mov byte [ebp - 0x8c], bl
mov byte [ebp - 0x8b], bl
mov byte [ebp - 0x8a], bl
mov byte [ebp - 0x89], bl
mov byte [ebp - 0x88], bl
mov byte [ebp - 0x87], 5
call esi
test eax, eax
je 0x1005215
lea eax, [ebp - 0xac]
push eax
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push 0x12
push 1
lea eax, [ebp - 0x8c]
push eax
call esi
test eax, eax
je 0x1005215
push dword [ebp - 0xac]
mov esi, dword [sym.imp.ADVAPI32.dll_GetLengthSid]
call esi
push dword [ebp - 0xa8]
mov edi, eax
call esi
add edi, eax
lea esi, [edi + edi + 0x28]
push esi
call sub.msvcrt.dll_void____cdecl_operator_new_unsigned_int_
cmp eax, ebx
pop ecx
mov dword [ebp - 0xa4], eax
je 0x1005215
push 2
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeAcl]
test eax, eax
je 0x1005215
mov esi, dword [sym.imp.ADVAPI32.dll_AddAccessAllowedAce]
mov dword [ebp - 0x88], ebx
mov edi, 0x10000000
push dword [ebp - 0xa8]
push edi
push 2
push dword [ebp - 0xa4]
call esi
test eax, eax
je 0x1005215
push dword [ebp - 0xac]
push edi
push 2
push dword [ebp - 0xa4]
call esi
test eax, eax
je 0x1005215
inc dword [ebp - 0x88]
cmp dword [ebp - 0x88], 2
jl 0x100504d
xor esi, esi
lea eax, [ebp - 0x88]
push eax
push esi
push dword [ebp - 0xa4]
call dword [sym.imp.ADVAPI32.dll_GetAce]
test eax, eax
je 0x1005215
cmp esi, 2
jge 0x10050b5
xor eax, eax
jmp 0x10050b8
push 8
pop eax
mov ecx, dword [ebp - 0x88]
inc esi
cmp esi, 4
mov byte [ecx + 1], al
jl 0x1005090
push 1
lea eax, [ebp - 0xd0]
push eax
call dword [sym.imp.ADVAPI32.dll_InitializeSecurityDescriptor]
test eax, eax
je 0x1005215
push ebx
push dword [ebp - 0xa4]
lea eax, [ebp - 0xd0]
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_SetSecurityDescriptorDacl]
test eax, eax
je 0x1005215
mov esi, 0x2000000
xor eax, eax
mov dword [ebp - 0x9c], ebx
lea edi, [ebp - 0x98]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0x9c]
push eax
push 0x18
push dword [0x100f4d0]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
je 0x1005215
push dword [ebp - 0x88]
lea eax, [ebp - 0x84]
push dword [ebp - 0x8c]
push dword [ebp - 0x90]
push dword [ebp - 0x94]
push dword [ebp - 0x98]
push dword [ebp - 0x9c]
push 0x10016f0
push 0x3f
push eax
call dword [sym.imp.msvcrt.dll__snwprintf]
add esp, 0x24
push esi
push ebx
lea eax, [ebp - 0x84]
push eax
call dword [sym.imp.USER32.dll_OpenWindowStationW]
cmp eax, ebx
mov ecx, dword [ebp - 0xb0]
mov dword [ecx], eax
je 0x1005193
push eax
call dword [sym.imp.USER32.dll_CloseWindowStation]
jmp 0x1005101
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 5
je 0x1005101
xor eax, eax
lea edi, [ebp - 0x8c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
lea eax, [ebp - 0xd0]
mov dword [ebp - 0x8c], eax
lea eax, [ebp - 0x90]
push eax
push esi
push ebx
lea eax, [ebp - 0x84]
push eax
mov dword [ebp - 0x90], 0xc
call dword [sym.imp.USER32.dll_CreateWindowStationW]
cmp eax, ebx
mov ecx, dword [ebp - 0xb0]
mov dword [ecx], eax
je 0x100522a
mov edi, dword [sym.imp.USER32.dll_SetProcessWindowStation]
push eax
call edi
test eax, eax
je 0x1005215
push ebx
push esi
push ebx
push ebx
push ebx
push 0x10016d8
call dword [sym.imp.USER32.dll_CreateDesktopW]
mov esi, dword [ebp - 0xb4]
push dword [ebp - 0xbc]
mov dword [esi], eax
call edi
cmp dword [esi], ebx
jne 0x1005254
mov esi, dword [ebp - 0xb0]
mov eax, dword [esi]
cmp eax, ebx
je 0x100522a
push eax
call dword [sym.imp.USER32.dll_CloseWindowStation]
mov dword [esi], ebx
mov esi, dword [ebp - 0xb4]
mov eax, dword [esi]
cmp eax, ebx
je 0x100523f
push eax
call dword [sym.imp.USER32.dll_CloseDesktop]
mov dword [esi], ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0xc0001771
push 1
call fcn.0100bb73
jmp 0x1005276
lea eax, [ebp - 0x84]
push eax
push 0x10016bc
push dword [ebp - 0xb8]
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
mov byte [ebp - 0x9d], 1
cmp dword [ebp - 0xa8], ebx
mov esi, dword [sym.imp.ADVAPI32.dll_FreeSid]
je 0x100528c
push dword [ebp - 0xa8]
call esi
cmp dword [ebp - 0xac], ebx
je 0x100529c
push dword [ebp - 0xac]
call esi
cmp dword [ebp - 0xa4], ebx
pop edi
pop esi
pop ebx
je 0x10052b3
push dword [ebp - 0xa4]
call sub.msvcrt.dll_void___cdecl_operator_delete_void__
pop ecx
mov ecx, dword [ebp - 4]
mov al, byte [ebp - 0x9d]
call fcn.0100b28a
leave
ret 0xc