Function at 0x516680
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x4c
mov eax, dword [0x8312b0]
xor eax, esp
mov dword [esp + 0x48], eax
push ebx
push esi
push edi
mov edi, ecx
call fcn.00516250
cmp ax, 0x40
ja 0x51682d
call fcn.005161e0
test al, al
jne 0x51682d
lea eax, [esp + 0x28]
mov dword [esp + 0x14], 0
push str.ntdll.dll
mov dword [esp + 0x30], str.devicephysicalmemory
mov dword [esp + 0x2c], 0x2e002c
mov dword [esp + 0x40], 0x40
mov dword [esp + 0x34], 0x18
mov dword [esp + 0x3c], eax
mov dword [esp + 0x38], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x20], 0
mov dword [esp + 0x4c], 0xf0000
mov dword [esp + 0x50], 0
mov dword [esp + 0x28], 0xffff
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov ebx, eax
test ebx, ebx
je 0x5167c9
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.ZwOpenSection
push ebx
call esi
push str.ZwMapViewOfSection
push ebx
mov dword [esp + 0x20], eax
call esi
push str.ZwUnmapViewOfSection
push ebx
mov dword [esp + 0x14], eax
call esi
push str.ZwClose
push ebx
mov dword [esp + 0x18], eax
call esi
mov ebx, eax
mov eax, dword [esp + 0x18]
test eax, eax
je 0x5167c9
mov esi, dword [esp + 0xc]
test esi, esi
je 0x5167c9
cmp dword [esp + 0x10], 0
je 0x5167c9
test ebx, ebx
je 0x5167c9
lea ecx, [esp + 0x30]
mov dword [esp + 0x20], 0
push ecx
push 4
lea ecx, [esp + 0x28]
push ecx
call eax
test eax, eax
js 0x5167c9
push 2
push 0
push 1
lea eax, [esp + 0x30]
push eax
lea eax, [esp + 0x58]
push eax
push 0xffff
push 0
lea eax, [esp + 0x38]
push eax
push 0xffffffffffffffff
push dword [esp + 0x44]
call esi
test eax, eax
jns 0x5167ea
push dword [esp + 0x20]
call ebx
lea eax, [esp + 0x14]
mov ecx, edi
push eax
call fcn.00516e80
test al, al
je 0x5168dc
push dword [edi + 4]
mov esi, dword [esp + 0x18]
push esi
jmp 0x516914
push dword [esp + 0x24]
call fcn.006f4f6d
mov edx, dword [esp + 0x28]
add esp, 4
mov esi, eax
mov ecx, esi
push edx
push dword [esp + 0x20]
call fcn.004b4b50
mov eax, dword [esp + 0x2c]
add esp, 8
mov dword [edi + 4], eax
push dword [esp + 0x1c]
push dword [esp + 0x24]
call dword [esp + 0x18]
push dword [esp + 0x20]
call ebx
push dword [edi + 4]
push esi
jmp 0x516914
push str.GetSystemFirmwareTable
push str.kernel32.dll
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov ebx, eax
test ebx, ebx
jne 0x51689f
mov dword [esp + 0x1c], eax
mov ecx, edi
lea eax, [esp + 0x1c]
push eax
call fcn.00516e80
test al, al
je 0x51687a
push dword [edi + 4]
mov esi, dword [esp + 0x20]
mov ecx, edi
push esi
call fcn.00516d00
test esi, esi
je 0x516924
jmp 0x51691b
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x5168dc
push eax
call fcn.006f4f76
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.006f4f1e
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 0x52534d42
call ebx
mov dword [esp + 0xc], eax
test eax, eax
je 0x5168dc
push eax
call fcn.006f4f6d
add esp, 4
mov esi, eax
push dword [esp + 0xc]
push esi
push 0
push 0x52534d42
call ebx
mov ecx, eax
test ecx, ecx
jne 0x5168f0
push esi
call fcn.006f4f76
add esp, 4
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x48]
xor ecx, esp
call fcn.006f4f1e
mov esp, ebp
pop ebp
ret
mov al, byte [esi]
mov byte [edi], al
mov al, byte [esi + 1]
mov byte [edi + 1], al
mov al, byte [esi + 2]
mov byte [edi + 2], al
mov al, byte [esi + 3]
mov byte [edi + 3], al
mov eax, dword [esi + 4]
mov dword [edi + 4], eax
lea eax, [ecx - 8]
push eax
lea eax, [esi + 8]
push eax
mov ecx, edi
call fcn.00516d00
push esi
call fcn.006f4f76
add esp, 4
mov ecx, dword [esp + 0x54]
mov al, 1
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.006f4f1e
mov esp, ebp
pop ebp
ret