Function at 0x51a780
Capabilities:
Check os version
Generate random numbers via rtlgenrandom
Link many functions at runtime
Query environment variable
Query or enumerate registry value
Read file via mapping

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x17c
mov esi, dword [esp + 0x19c]
test esi, esi
je 0x51aab8
mov ebp, dword [0x743524]
test ebp, ebp
je 0x51aef6
mov eax, dword [0x74352c]
test eax, eax
jne 0x51acc9
mov eax, dword [0x743520]
test eax, eax
je 0x51ad13
lea ebp, [esp + 0x34]
mov ecx, dword [0x743534]
test ecx, ecx
je 0x51a800
mov eax, dword [0x743530]
test eax, eax
je 0x51b134
lea ebx, [esp + 0x68]
mov dword [esp + 4], 0x40
mov dword [esp], eax
mov dword [esp + 8], ebx
call dword [0x743540]
sub esp, 0xc
test eax, eax
jne 0x51b079
mov dword [esp + 8], str._M_B_M_5_S_D_
mov dword [esp + 4], 0
mov dword [esp], 4
call dword [sym.imp.KERNEL32.dll_OpenFileMappingA]
sub esp, 0xc
test eax, eax
mov ebx, eax
je 0x51a89b
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 4
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
sub esp, 0x14
test eax, eax
mov esi, eax
je 0x51a88f
mov edx, dword [0x74352c]
test edx, edx
jne 0x51b0ff
mov eax, dword [esp + 0x194]
mov dword [esp + 4], 0x2320
mov dword [esp], esi
mov dword [esp + 8], eax
call dword [esp + 0x190]
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
sub esp, 4
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [0x743568]
test eax, eax
je 0x51a942
mov eax, dword [0x5bf1e4]
mov edx, str.LanmanWorkstation
lea ebx, [esp + 0x68]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 0x10], ebx
mov dword [esp], 0
test eax, eax
mov eax, str.LanmanServer
cmovne eax, edx
mov dword [esp + 4], eax
call dword [0x743564]
sub esp, 0x14
test eax, eax
jne 0x51a942
mov eax, dword [0x74352c]
test eax, eax
jne 0x51b0df
lea eax, [esp + 0x30]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp], eax
call dword [0x743560]
sub esp, 8
mov eax, dword [esp + 0x194]
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x68]
mov dword [esp], eax
call dword [esp + 0x190]
mov eax, dword [esp + 0x68]
mov dword [esp], eax
call dword [0x74355c]
sub esp, 4
xor ebx, ebx
lea edi, [esp + 0x68]
jmp 0x51a992
mov eax, dword [0x74352c]
test eax, eax
jne 0x51aac5
mov eax, dword [esp + 0x194]
mov dword [esp], edi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x30]
mov dword [esp + 4], eax
call dword [esp + 0x190]
add ebx, 1
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
cmp ebx, 0x64
je 0x51aae0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], str..PhysicalDrive_d
mov dword [esp + 4], 0x32
mov dword [esp], ebp
call sym._snprintf.constprop.0_2
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 3
mov dword [esp + 4], 0
mov dword [esp], ebp
call dword [sym.imp.KERNEL32.dll_CreateFileA]
sub esp, 0x1c
cmp eax, 0xffffffff
mov esi, eax
je 0x51aae0
lea eax, [esp + 0x30]
mov dword [esp + 0x30], 0x108
mov dword [esp + 0x1c], 0
mov dword [esp + 0x14], 0x100
mov dword [esp + 0x10], edi
mov dword [esp + 0x18], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0x70020
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_DeviceIoControl]
sub esp, 0x20
test eax, eax
jne 0x51a950
mov dword [esp], str.NOTE:_you_should_run_diskperf__y_to_enable_the_disk_statistics_n
call dbg._gcry_log_info
jmp 0x51a97a
mov dword [esp], esi
call dbg._gcry_free
cmp dword [esp + 0x28], 0xe
jle 0x51aede
mov eax, dword [esp + 0x198]
add eax, 0x1f
and eax, 0xffffffe0
mov dword [esp + 8], eax
mov eax, dword [esp + 0x194]
mov dword [esp + 4], eax
mov eax, dword [esp + 0x190]
mov dword [esp], eax
call dbg._gcry_rndjent_poll
mov ecx, dword [0x74352c]
test ecx, ecx
je 0x51aab8
mov dword [esp + 4], eax
mov dword [esp], str.rndw32gather_random:_jent_contributed_extra__u_bytes_n
call dbg._gcry_log_debug
add esp, 0x17c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], ebx
mov dword [esp], str.rndw32slow_gatherer:_iostat_drive__d_n
call dbg._gcry_log_debug
jmp 0x51a95d
mov eax, dword [0x743558]
test eax, eax
je 0x51aede
mov edi, 1
mov dword [esp], 0x10000
lea ebx, [esp + 0x68]
call dbg._gcry_xmalloc
mov esi, eax
lea eax, [edi - 0x12]
mov dword [esp + 0x28], 0
lea ebp, [edi - 1]
cmp eax, 0x24
ja case.0x51ab20.19
nop
lea esi, [esi]
jmp dword [eax*4 + 0x6482ac]
mov eax, dword [0x743528]
test eax, eax
jne case.0x51ab20.27
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xf800
mov dword [esp + 4], esi
mov dword [esp], 0x11
call dword [0x743554]
sub esp, 0x10
test eax, eax
jne case.0x51ab20.27
mov eax, dword [esp + 0x68]
test eax, eax
je 0x51aba0
lea ecx, [eax - 1]
cmp ecx, 0xf7ff
ja 0x51aba0
mov ecx, dword [0x74352c]
test ecx, ecx
jne 0x51acb0
mov eax, dword [esp + 0x194]
mov dword [esp], esi
mov dword [esp + 8], eax
mov eax, dword [esp + 0x68]
mov dword [esp + 4], eax
call dword [esp + 0x190]
add dword [esp + 0x28], 1
cmp edi, 0x40
je 0x51ac00
add edi, 1
lea eax, [edi - 0x12]
lea ebp, [edi - 1]
cmp eax, 0x24
jbe switch.0x0051ab20
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0xf800
mov dword [esp + 4], esi
mov dword [esp], ebp
call dword [0x743554]
sub esp, 0x10
test eax, eax
jne 0x51aba0
mov eax, dword [esp + 0x68]
test eax, eax
jne 0x51ab65
cmp ebp, 0x17
je 0x51b220
cmp ebp, 0x18
jne 0x51aba0
mov dword [esp + 0x68], 0x14
mov eax, 0x14
jmp 0x51ab70
mov eax, dword [0x74354c]
test eax, eax
je 0x51aa60
mov ebx, 0x6483a4
mov edi, 1
xor ebp, ebp
xor edx, edx
jmp 0x51ac57
mov ecx, dword [esp + 0x194]
mov dword [esp + 4], eax
mov dword [esp], esi
mov dword [esp + 8], ecx
call dword [esp + 0x190]
add dword [esp + 0x28], 1
add ebp, 1
add ebx, 8
cmp edi, 0xffffffff
je 0x51aa60
mov edx, edi
mov eax, dword [0x74354c]
mov edi, dword [ebx + 4]
mov dword [esp + 0x10], 0xf800
mov dword [esp + 0xc], esi
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], edx
call eax
sub esp, 0x14
test eax, eax
jne 0x51ac3e
mov edx, dword [0x74352c]
mov eax, dword [ebx]
test edx, edx
je 0x51ac20
mov dword [esp + 4], eax
mov dword [esp + 8], ebp
mov dword [esp], str.rndw32slow_gatherer:__u_bytes_from_powerinfo__d_n
mov dword [esp + 0x2c], eax
call dbg._gcry_log_debug
mov eax, dword [esp + 0x2c]
jmp 0x51ac20
mov dword [esp + 8], ebp
mov dword [esp + 4], eax
mov dword [esp], str.rndw32slow_gatherer:__lu_bytes_from_sysinfo__ld_n
call dbg._gcry_log_debug
jmp 0x51ab7e
mov eax, dword [esp + 0x198]
mov dword [esp + 0xc], esi
mov dword [esp], str.rndw32gather_random:_ori_d_len_u_lvl_d_n
mov dword [esp + 8], eax
mov eax, dword [esp + 0x194]
mov dword [esp + 4], eax
call dbg._gcry_log_debug
mov ebp, dword [0x743520]
test ebp, ebp
jne 0x51a7c1
mov edi, dword [0x74352c]
test edi, edi
je 0x51ad13
mov dword [esp], str.rndw32slow_gatherer:_init_toolkit_n
call dbg._gcry_log_debug
lea ebp, [esp + 0x34]
mov dword [esp + 0xc], 0x20019
mov dword [esp + 8], 0
mov dword [esp + 4], str.SYSTEMCurrentControlSetControlProductOptions
mov dword [esp], 0x80000002
mov dword [esp + 0x10], ebp
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
sub esp, 0x14
test eax, eax
jne 0x51adad
mov esi, dword [0x74352c]
mov dword [esp + 0x30], 0x20
test esi, esi
jne 0x51b203
lea eax, [esp + 0x30]
lea ebx, [esp + 0x68]
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], str.ProductType
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x34]
mov dword [esp + 0x10], ebx
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
sub esp, 0x18
test eax, eax
je 0x51b1c2
mov eax, dword [esp + 0x34]
mov dword [esp], eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
sub esp, 4
mov dword [esp], str.NETAPI32.DLL
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
sub esp, 4
test eax, eax
mov dword [0x743568], eax
je 0x51ae4b
mov ecx, dword [0x74352c]
test ecx, ecx
jne 0x51b0c9
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 4], str.NetStatisticsGet
mov dword [esp], eax
call ebx
mov dword [0x743564], eax
mov eax, dword [0x743568]
sub esp, 8
mov dword [esp + 4], str.NetApiBufferSize
mov dword [esp], eax
call ebx
mov dword [0x743560], eax
mov eax, dword [0x743568]
sub esp, 8
mov dword [esp + 4], str.NetApiBufferFree
mov dword [esp], eax
call ebx
mov edx, dword [0x743564]
sub esp, 8
mov dword [0x74355c], eax
test edx, edx
je 0x51b167
mov edi, dword [0x743560]
test edi, edi
je 0x51b167
test eax, eax
je 0x51b167
mov dword [esp], str.NTDll.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
sub esp, 4
test eax, eax
mov dword [0x743558], eax
je 0x51aecf
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 4], str.NtQuerySystemInformation
mov dword [esp], eax
call ebx
mov dword [0x743554], eax
mov eax, dword [0x743558]
sub esp, 8
mov dword [esp + 4], str.NtQueryInformationProcess
mov dword [esp], eax
call ebx
mov dword [0x743550], eax
mov eax, dword [0x743558]
sub esp, 8
mov dword [esp + 4], str.NtPowerInformation
mov dword [esp], eax
call ebx
mov esi, dword [0x743554]
sub esp, 8
mov dword [0x74354c], eax
test esi, esi
je 0x51b0f0
mov ebx, dword [0x743550]
test ebx, ebx
je 0x51b0f0
mov dword [0x743520], 1
jmp 0x51a7c5
mov edx, dword [esp + 0x194]
mov eax, dword [esp + 0x190]
call dbg.registry_poll
jmp 0x51aa73
lea ebx, [esp + 0x68]
mov eax, ebp
mov ecx, 0x25
mov edi, ebx
rep stosd dword es:[edi], eax
mov dword [esp], str.GCRYPT_RNDW32_DBG
mov dword [esp + 0x68], 0x94
call sym._getenv
test eax, eax
je 0x51af33
mov dword [esp], eax
call sym._atoi
test eax, eax
jle 0x51af33
mov dword [0x74352c], 1
mov dword [esp], ebx
call dword [sym.imp.KERNEL32.dll_GetVersionExA]
sub esp, 4
cmp dword [esp + 0x78], 2
jne 0x51b214
cmp dword [esp + 0x6c], 5
je 0x51b1b0
mov dword [0x743528], ebp
mov dword [0x743534], 0
mov dword [0x743530], 0
mov dword [esp], str.AdvAPI32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
sub esp, 4
test eax, eax
mov dword [0x743548], eax
je 0x51b05d
mov ebx, dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [esp + 4], 0x647ee8
mov dword [esp], eax
call ebx
mov dword [0x743544], eax
mov eax, dword [0x743548]
sub esp, 8
mov dword [esp + 4], 0x647efd
mov dword [esp], eax
call ebx
mov dword [0x743540], eax
mov eax, dword [0x743548]
sub esp, 8
mov dword [esp + 4], 0x647f0c
mov dword [esp], eax
call ebx
mov dword [0x74353c], eax
mov eax, dword [0x743548]
sub esp, 8
mov dword [esp + 4], str.SystemFunction036
mov dword [esp], eax
call ebx
mov edx, dword [0x743544]
sub esp, 8
mov dword [0x743538], eax
test edx, edx
je 0x51b11d
mov ebx, dword [0x743540]
test ebx, ebx
je 0x51b11d
mov ecx, dword [0x74353c]
test ecx, ecx
je 0x51b11d
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0x16
mov dword [esp + 8], str.Intel_Hardware_Cryptographic_Service_Provider
mov dword [esp + 4], 0
mov dword [esp], 0x743530
call edx
sub esp, 0x14
test eax, eax
je 0x51b118
mov dword [0x743534], 1
mov eax, dword [0x74352c]
mov dword [0x743524], 1
test eax, eax
je 0x51a7b4
jmp 0x51acc9
mov eax, 0x50
mov edx, dword [0x74352c]
test edx, edx
jne 0x51b193
mov eax, dword [esp + 0x194]
mov dword [esp + 4], 0x40
mov dword [esp], ebx
mov dword [esp + 8], eax
call dword [esp + 0x190]
lea eax, [esp + 0xa8]
mov dword [ebx], 0
mov dword [ebx + 4], 0
add ebx, 8
cmp ebx, eax
jne 0x51b0b0
jmp 0x51a800
mov dword [esp], str.rndw32slow_gatherer:_netapi32_loaded_n
call dbg._gcry_log_debug
mov eax, dword [0x743568]
jmp 0x51add8
mov dword [esp], str.rndw32slow_gatherer:_get_netstats_n
call dbg._gcry_log_debug
jmp 0x51a8f9
mov dword [0x743558], 0
jmp 0x51aecf
mov dword [esp + 4], 0x2320
mov dword [esp], str.rndw32read_mbm_data:_got__d_bytes_n
call dbg._gcry_log_debug
jmp 0x51a866
mov eax, dword [0x743538]
test eax, eax
jne 0x51b053
mov dword [0x743548], 0
jmp 0x51b05d
mov eax, dword [0x743538]
test eax, eax
je 0x51a800
lea ebx, [esp + 0x68]
mov dword [esp + 4], 0x40
mov dword [esp], ebx
call eax
sub esp, 8
test eax, eax
je 0x51a800
mov eax, 0x32
jmp 0x51b07e
mov eax, dword [0x743568]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_FreeLibrary]
sub esp, 4
mov dword [0x743568], 0
mov dword [esp], str.rndw32:_No_NETAPI_found_n
call dbg._gcry_log_debug
jmp 0x51ae4b
mov dword [esp + 8], eax
mov dword [esp + 4], 0x40
mov dword [esp], str.rndw32read_system_rng:_got__d_bytes_of_quality__d_n
call dbg._gcry_log_debug
jmp 0x51b08c
mov edi, dword [esp + 0x70]
xor eax, eax
test edi, edi
sete al
mov ebp, eax
jmp 0x51af55
mov dword [esp + 4], str.WinNT
mov dword [esp], ebx
call sym._stricmp
test eax, eax
je 0x51ad9d
mov ebx, dword [0x74352c]
mov dword [0x5bf1e4], 0
test ebx, ebx
je 0x51ad9d
mov dword [esp], str.rndw32:_this_is_a_NT_server_n
call dbg._gcry_log_debug
jmp 0x51ad9d
mov dword [esp], str.rndw32slow_gatherer:_check_product_options_n
call dbg._gcry_log_debug
jmp 0x51ad5d
mov dword [esp], str.can_only_run_on_a_Windows_NT_platform_n
call dbg._gcry_log_fatal
mov dword [esp + 0x68], 0x18
mov eax, 0x18
jmp 0x51ab70