private static string[] smethod_2(BiosFirmwareTableProvider biosFirmwareTableProvider_0) { string[] strArray = new string[0]; try { int cb = Class1.EnumSystemFirmwareTables(biosFirmwareTableProvider_0, IntPtr.Zero, 0); if (cb <= 0) { return(strArray); } byte[] destination = new byte[cb]; IntPtr ptr = Marshal.AllocHGlobal(cb); Class1.EnumSystemFirmwareTables(biosFirmwareTableProvider_0, ptr, cb); if (Marshal.GetLastWin32Error() == 0) { strArray = new string[cb / 4]; Marshal.Copy(ptr, destination, 0, cb); for (int i = 0; i < strArray.Length; i++) { strArray[i] = Encoding.ASCII.GetString(destination, 4 * i, 4); } } Marshal.FreeHGlobal(ptr); } catch { } return(strArray); }
private static string[] EnumerateTables(BiosFirmwareTableProvider provider) { string[] Result = new string[0]; try { int sizeNeeded = Native.EnumSystemFirmwareTables(provider, IntPtr.Zero, 0); if (sizeNeeded > 0) { byte[] buffer = new byte[sizeNeeded]; IntPtr bufferPtr = Marshal.AllocHGlobal(sizeNeeded); Native.EnumSystemFirmwareTables(provider, bufferPtr, sizeNeeded); if (Marshal.GetLastWin32Error() == 0) { Result = new string[sizeNeeded / 4]; Marshal.Copy(bufferPtr, buffer, 0, sizeNeeded); for (int i = 0; i < Result.Length; i++) { Result[i] = Encoding.ASCII.GetString(buffer, 4 * i, 4); } } Marshal.FreeHGlobal(bufferPtr); } } catch { } return(Result); }
private static byte[] GetTable(BiosFirmwareTableProvider provider, int table) { Byte[] Result = new Byte[0]; try { int sizeNeeded = Native.GetSystemFirmwareTable(provider, table, IntPtr.Zero, 0); if (sizeNeeded > 0) { IntPtr bufferPtr = Marshal.AllocHGlobal(sizeNeeded); Native.GetSystemFirmwareTable(provider, table, bufferPtr, sizeNeeded); if (Marshal.GetLastWin32Error() == 0) { Result = new Byte[sizeNeeded]; Marshal.Copy(bufferPtr, Result, 0, sizeNeeded); } Marshal.FreeHGlobal(bufferPtr); } } catch { } return(Result); }
private static byte[] smethod_1(BiosFirmwareTableProvider biosFirmwareTableProvider_0, int int_0) { byte[] destination = new byte[0]; try { int cb = Class1.GetSystemFirmwareTable(biosFirmwareTableProvider_0, int_0, IntPtr.Zero, 0); if (cb <= 0) { return(destination); } IntPtr ptr = Marshal.AllocHGlobal(cb); Class1.GetSystemFirmwareTable(biosFirmwareTableProvider_0, int_0, ptr, cb); if (Marshal.GetLastWin32Error() == 0) { destination = new byte[cb]; Marshal.Copy(ptr, destination, 0, cb); } Marshal.FreeHGlobal(ptr); } catch { } return(destination); }
private static byte[] smethod_0(BiosFirmwareTableProvider biosFirmwareTableProvider_0, string string_1) { int num = (((string_1[3] << 0x18) | (string_1[2] << 0x10)) | (string_1[1] << 8)) | string_1[0]; return(smethod_1(biosFirmwareTableProvider_0, num)); }
public static extern int GetSystemFirmwareTable(BiosFirmwareTableProvider providerSignature, int dwFirmwareTableID, IntPtr lpTableBuffer, int dwBufferSize);
public static extern int EnumSystemFirmwareTables(BiosFirmwareTableProvider providerSignature, IntPtr firmwareTableBuffer, int bufferSize);
private static byte[] GetTable(BiosFirmwareTableProvider provider, string table) { int id = table[3] << 24 | table[2] << 16 | table[1] << 8 | table[0]; return(GetTable(provider, id)); }