NTSTATUS __fastcall sub_11120(__int64 a1, PHYSICAL_ADDRESS *a2, unsigned int a3, unsigned int a4)
{
PHYSICAL_ADDRESS v7; // rbx
DWORD LowPart; // esi
NTSTATUS result; // eax
BOOLEAN v10; // bl
BOOLEAN v11; // al
DWORD v12; // ecx
NTSTATUS v13; // ebx
void *SectionHandle; // [rsp+50h] [rbp-A8h] BYREF
union _LARGE_INTEGER SectionOffset; // [rsp+58h] [rbp-A0h] BYREF
PHYSICAL_ADDRESS BusAddress; // [rsp+60h] [rbp-98h] BYREF
PVOID BaseAddress; // [rsp+68h] [rbp-90h] BYREF
ULONG v18; // [rsp+70h] [rbp-88h] BYREF
ULONG AddressSpace; // [rsp+74h] [rbp-84h] BYREF
LARGE_INTEGER TranslatedAddress; // [rsp+78h] [rbp-80h] BYREF
ULONG_PTR ViewSize; // [rsp+80h] [rbp-78h] BYREF
PVOID Object; // [rsp+88h] [rbp-70h] BYREF
struct _OBJECT_ATTRIBUTES ObjectAttributes; // [rsp+90h] [rbp-68h] BYREF
struct _UNICODE_STRING DestinationString; // [rsp+C0h] [rbp-38h] BYREF
SectionHandle = 0i64;
Object = 0i64;
if ( !(unsigned __int8)sub_11060(a2->QuadPart, a2[1].LowPart, (char *)&a2[1].QuadPart + 4) )
return -1073741823;
if ( a3 < 0x20 || a4 < 8 )
return -1073741670;
v7 = *a2;
v18 = 0;
AddressSpace = 0;
LowPart = a2[1].LowPart;
RtlInitUnicodeString(&DestinationString, L"\\Device\\PhysicalMemory");
ObjectAttributes.Length = 48;
ObjectAttributes.RootDirectory = 0i64;
ObjectAttributes.Attributes = 576;
ObjectAttributes.ObjectName = &DestinationString;
ObjectAttributes.SecurityDescriptor = 0i64;
ObjectAttributes.SecurityQualityOfService = 0i64;
result = ZwOpenSection(&SectionHandle, 0xF001Fu, &ObjectAttributes);
if ( result >= 0 )
{
result = ObReferenceObjectByHandle(SectionHandle, 0xF001Fu, 0i64, 0, &Object, 0i64);
if ( result >= 0 )
{
BusAddress.QuadPart = v7.QuadPart + LowPart;
v10 = HalTranslateBusAddress(Isa, 0, v7, &AddressSpace, &TranslatedAddress);
v11 = HalTranslateBusAddress(Isa, 0, BusAddress, &v18, &BusAddress);
if ( !v10 )
return -1073741823;
if ( !v11 )
return -1073741823;
v12 = BusAddress.LowPart - TranslatedAddress.LowPart;
SectionOffset.QuadPart = BusAddress.QuadPart - TranslatedAddress.QuadPart;
if ( BusAddress.LowPart == TranslatedAddress.LowPart )
return -1073741823;
SectionOffset = TranslatedAddress;
BaseAddress = 0i64;
ViewSize = v12;
v13 = ZwMapViewOfSection(
SectionHandle,
(HANDLE)0xFFFFFFFFFFFFFFFFi64,
&BaseAddress,
0i64,
v12,
&SectionOffset,
&ViewSize,
ViewShare,
0,
0x204u);
if ( v13 >= 0 )
{
BaseAddress = (char *)BaseAddress + TranslatedAddress.LowPart - (unsigned __int64)SectionOffset.LowPart;
a2->QuadPart = (LONGLONG)BaseAddress;
ZwClose(SectionHandle);
return 0;
}
else
{
ZwClose(SectionHandle);
return v13;
}
}
}
return result;
}
利用任意内存读写漏洞驱动加载恶意代码后,干掉火绒。 |