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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x518480
mov eax, dword fs:[0]
push eax
sub esp, 0x58
mov eax, dword [0x54d028]
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.004be0d0
push 5
push str.grail
lea ecx, [ebp - 0x48]
call fcn.00404480
lea ecx, [ebp - 0x48]
push ecx
lea edx, [ebp - 0x2c]
push 0x54f9f8
push edx
mov dword [ebp - 4], 1
call fcn.004126c0
add esp, 0xc
mov byte [ebp - 4], 3
cmp dword [ebp - 0x34], 8
jb 0x41447c
mov eax, dword [ebp - 0x48]
push eax
call fcn.004d62da
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.004bcd20
mov eax, dword [eax]
add esp, 0xc
cmp eax, ebx
je 0x41452d
cmp eax, 1
je 0x41452d
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x4144b8
lea eax, [ebp - 0x2c]
push ebx
push 0x80
push 3
push ebx
push 1
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4144f2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea esi, [ebp - 0x64]
call fcn.004271f0
push 0x53ed78
mov ecx, esi
push ecx
call fcn.004da48a
push ebx
lea edx, [ebp - 0x50]
push edx
push 0x100
push esi
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
setne al
cmp al, bl
je 0x41451a
cmp dword [ebp - 0x50], 0x100
mov byte [ebp - 0x49], 1
je 0x41451d
mov byte [ebp - 0x49], bl
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp byte [ebp - 0x49], bl
jne 0x4145ba
mov eax, dword [ebp + 8]
push esi
push 0x100
push eax
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
test eax, eax
jne 0x41455d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea esi, [ebp - 0x64]
call fcn.004271f0
push 0x53ed78
mov ecx, esi
push ecx
call fcn.004da48a
cmp dword [ebp - 0x18], 8
mov eax, dword [ebp - 0x2c]
jae 0x414569
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 0x4145a5
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea esi, [ebp - 0x64]
call fcn.004271f0
push 0x53ed78
mov edx, esi
push edx
call fcn.004da48a
mov ecx, esi
lea edx, [ebp - 0x50]
mov byte [ebp - 4], 4
call fcn.00414fe0
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 0x4145eb
mov eax, dword [ebp - 0x2c]
push eax
call fcn.004d62da
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.004d62e5
mov esp, ebp
pop ebp
ret