2016-07-07 13:57:45 +08:00
|
|
|
/* uefidump_main.cpp
|
|
|
|
|
2018-04-30 13:33:19 +08:00
|
|
|
Copyright (c) 2018, LongSoft. All rights reserved.
|
2016-07-07 13:57:45 +08:00
|
|
|
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"
|
|
|
|
|
2016-07-09 14:31:08 +08:00
|
|
|
int main(int argc, char *argv[])
|
2016-07-07 13:57:45 +08:00
|
|
|
{
|
2016-07-16 09:48:21 +08:00
|
|
|
|
|
|
|
if (argc > 1) {
|
2016-07-07 13:57:45 +08:00
|
|
|
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;
|
2016-07-09 14:31:08 +08:00
|
|
|
return (uefidumper.dump(buffer, UString(argv[1])) != U_SUCCESS);
|
2016-07-07 13:57:45 +08:00
|
|
|
}
|
|
|
|
|
2018-04-30 13:33:19 +08:00
|
|
|
std::cout << "UEFIDump 0.1.7" << std::endl << std::endl
|
2016-07-16 09:48:21 +08:00
|
|
|
<< "Usage: UEFIDump imagefile" << std::endl;
|
|
|
|
return 0;
|
2016-07-07 13:57:45 +08:00
|
|
|
}
|