Function at 0x414d70
Capabilities:
Generate random numbers via winapi
Read file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x575290
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x5bafe0]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
xor ebx, ebx
mov edi, 7
xor eax, eax
mov esi, ecx
mov byte [ebp - 0x49], bl
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x38], ebx
mov word [ebp - 0x48], ax
mov dword [ebp - 4], ebx
call fcn.00513000
push 5
push str.grail
lea ecx, [ebp - 0x48]
call fcn.00406420
lea ecx, [ebp - 0x48]
push ecx
lea edx, [ebp - 0x2c]
push 0x5be2cc
push edx
mov dword [ebp - 4], 1
call fcn.00412940
add esp, 0xc
mov byte [ebp - 4], 3
cmp dword [ebp - 0x34], 8
jb 0x414dfc
mov eax, dword [ebp - 0x48]
push eax
call fcn.0052b74a
add esp, 4
push ebx
lea edx, [ebp - 0x2c]
push edx
lea eax, [ebp - 0x50]
xor ecx, ecx
push eax
mov dword [ebp - 0x34], edi
mov dword [ebp - 0x38], ebx
mov word [ebp - 0x48], cx
call fcn.00511b00
mov eax, dword [eax]
add esp, 0xc
cmp eax, ebx
je 0x414ead
cmp eax, 1
je 0x414ead
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x414e38
lea eax, [ebp - 0x2c]
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocStringLen
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x414e72
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea esi, [ebp - 0x64]
call fcn.00438490
push 0x5a8fa8
mov ecx, esi
push ecx
call fcn.00532abb
push ebx
lea edx, [ebp - 0x50]
push edx
push pe_nt_image_headers32
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
setne al
cmp al, bl
je 0x414e9a
cmp dword [ebp - 0x50], 0x100
mov byte [ebp - 0x49], 1
je 0x414e9d
mov byte [ebp - 0x49], bl
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x49], bl
jne 0x414f3a
mov eax, dword [ebp + 8]
push esi
push pe_nt_image_headers32
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x414edd
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea esi, [ebp - 0x64]
call fcn.00438490
push 0x5a8fa8
mov ecx, esi
push ecx
call fcn.00532abb
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x414ee9
lea eax, [ebp - 0x2c]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
mov dword [ebp - 0x50], edi
cmp edi, 0xffffffff
jne 0x414f25
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea esi, [ebp - 0x64]
call fcn.00438490
push 0x5a8fa8
mov edx, esi
push edx
call fcn.00532abb
mov ecx, esi
lea edx, [ebp - 0x50]
mov byte [ebp - 4], 4
call fcn.00415960
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor byte [esi], 0x5c
xor byte [esi + 1], 0x40
xor byte [esi + 2], 0x3c
xor byte [esi + 3], 0x4f
xor byte [esi + 4], 0xe
xor byte [esi + 5], 0x8e
xor byte [esi + 6], 0x83
xor byte [esi + 7], 0xac
cmp dword [ebp - 0x18], 8
jb 0x414f6b
mov eax, dword [ebp - 0x2c]
push eax
call fcn.0052b74a
add esp, 4
mov al, byte [ebp - 0x49]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0052b755
mov esp, ebp
pop ebp
ret