mirror of
https://github.com/LongSoft/UEFITool.git
synced 2025-05-23 03:27:10 -04:00
Merge Qt/non-Qt codebase
- added UEFIDump tool, which is now Windows-only UEFIExtract with some limitations, made as PoC for non-Qt engine usage - ensured that Qt classes will be used, if available - checked build of UT and UE - porting of UEFIFind to non-Qt engine TBD
This commit is contained in:
parent
12029c768c
commit
9045fc6cc0
22 changed files with 612 additions and 250 deletions
43
UEFIDump/uefidump_main.cpp
Normal file
43
UEFIDump/uefidump_main.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
/* uefidump_main.cpp
|
||||
|
||||
Copyright (c) 2016, Nikolaj Schlej. All rights reserved.
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
http://opensource.org/licenses/bsd-license.php
|
||||
|
||||
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
||||
|
||||
*/
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
#include "uefidump.h"
|
||||
|
||||
int wmain(int argc, wchar_t *argv[])
|
||||
{
|
||||
if (argc > 32) {
|
||||
std::cout << "Too many arguments" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (argc > 1) {
|
||||
std::ifstream inputFile;
|
||||
inputFile.open(argv[1], std::ios::in | std::ios::binary);
|
||||
std::vector<char> buffer(std::istreambuf_iterator<char>(inputFile),
|
||||
(std::istreambuf_iterator<char>()));
|
||||
inputFile.close();
|
||||
|
||||
UEFIDumper uefidumper;
|
||||
return (uefidumper.dump(buffer, std::wstring(argv[1])) != U_SUCCESS);
|
||||
}
|
||||
else {
|
||||
std::cout << "UEFIDump 0.1.0" << std::endl << std::endl
|
||||
<< "Usage: UEFIExtract imagefile " << std::endl
|
||||
<< "Return value is a bit mask where 0 at position N means that file with GUID_N was found and unpacked, 1 otherwise" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue