Exploit databaseDownload repository ZIP
GH-4dc2ea66f5461a87c81c9db9a3ee0c27
wnduddld0513/lenovo-qcom-rpmb-poc
Sources for CVE-2026-24090
1 sourcePreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars.
Repository files22
wnduddld0513/lenovo-qcom-rpmb-pocRevision cb4416050204
- ↑..Parent directory
- AvbImage.cs
- CapabilityChecker.cs
- ConsoleControl.cs
- DependencyManager.cs
- DeviceAssetCatalog.cs
- DiffReview.cs
- Elevation.cs
- Gpt.cs
- Journal.cs
- KnownFields.cs
- Profile.cs
- RecoveryBootRequest.cs
- RecoveryPartition.cs
- RecoverySessionManager.cs
- RegionPatcher.cs
- RuntimeStateLayout.cs
- StateEditorModel.cs
- StateImage.cs
- StorageInventory.cs
- StringScanner.cs
- TestGptFactory.cs
- WorkflowProgress.cs
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
src/LenovoQcomRPMBTool/Core/TestGptFactory.cs
C# · 3,457 bytesusing System.Buffers.Binary;
using System.Text;
namespace LenovoQcomRPMBTool.Core;
public static class TestGptFactory
{
public static byte[] Capture(
bool backup,
string firstPartitionName = "persist",
int sectorSize = 512,
int backupEntryGapSectors = 0)
{
const uint entryCount = 128;
const uint entrySize = 128;
const ulong backupHeaderLba = 100;
int entryBytes = checked((int)(entryCount * entrySize));
int entrySectors = (entryBytes + sectorSize - 1) / sectorSize;
int captureSectors = backup ? entrySectors + 1 : entrySectors + 2;
var buffer = new byte[captureSectors * sectorSize];
int headerOffset = backup ? buffer.Length - sectorSize : sectorSize;
int entriesOffset = backup ? 0 : sectorSize * 2;
Encoding.ASCII.GetBytes("EFI PART").CopyTo(buffer, headerOffset);
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 8, 4), 0x00010000);
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 12, 4), 92);
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(headerOffset + 24, 8), backup ? backupHeaderLba : 1UL);
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(headerOffset + 32, 8), backup ? 1UL : backupHeaderLba);
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(headerOffset + 40, 8), 34);
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(headerOffset + 48, 8), 90);
Guid.NewGuid().TryWriteBytes(buffer.AsSpan(headerOffset + 56, 16));
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(headerOffset + 72, 8),
backup ? backupHeaderLba - (ulong)entrySectors - (ulong)backupEntryGapSectors : 2UL);
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 80, 4), entryCount);
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 84, 4), entrySize);
WriteEntry(buffer, entriesOffset, firstPartitionName, 10, 20);
WriteEntry(buffer, entriesOffset + 128, "metadata", 21, 30);
WriteEntry(buffer, entriesOffset + 256, "boot_a", 31, 40);
uint partCrc = Crc(buffer.AsSpan(entriesOffset, entryBytes));
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 88, 4), partCrc);
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 16, 4), 0);
uint headerCrc = Crc(buffer.AsSpan(headerOffset, Gpt.HeaderSize));
BinaryPrimitives.WriteUInt32LittleEndian(buffer.AsSpan(headerOffset + 16, 4), headerCrc);
return buffer;
}
private static void WriteEntry(byte[] buffer, int offset, string name, ulong first, ulong last)
{
Guid.NewGuid().TryWriteBytes(buffer.AsSpan(offset, 16));
Guid.NewGuid().TryWriteBytes(buffer.AsSpan(offset + 16, 16));
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(offset + 32, 8), first);
BinaryPrimitives.WriteUInt64LittleEndian(buffer.AsSpan(offset + 40, 8), last);
Encoding.Unicode.GetBytes(name).CopyTo(buffer, offset + 56);
}
private static uint Crc(ReadOnlySpan<byte> data)
{
uint crc = 0xFFFFFFFF;
foreach (byte value in data)
{
crc ^= value;
for (int bit = 0; bit < 8; bit++)
crc = (crc & 1) != 0 ? (crc >> 1) ^ 0xEDB88320u : crc >> 1;
}
return crc ^ 0xFFFFFFFF;
}
}