-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 9ffec0f
Showing
4 changed files
with
564 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/build | ||
/.vs | ||
/CMakeSettings.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(PE_Parser LANGUAGES CXX) | ||
|
||
if(NOT CMAKE_BUILD_TYPE) | ||
set(CMAKE_BUILD_TYPE Release) | ||
endif() | ||
|
||
set(CMAKE_CXX_FLAGS_RELEASE "-O3") | ||
set(CMAKE_CXX_STANDARD 20) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
include_directories(include) | ||
file(GLOB SOURCES "*.cpp") | ||
add_executable(PE_Parser ${SOURCES}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
#include <iostream> | ||
#include <fstream> | ||
#include <vector> | ||
#include <memory> | ||
#include "pe_parser.h" | ||
|
||
void printUsage() | ||
{ | ||
std::cout << "Usage: " << "PE_Parser.exe" << " <Path to PE file>\n"; | ||
} | ||
|
||
int main(int argv, char *argc[]) | ||
{ | ||
std::unique_ptr<PE_PARSER> P_PE_PARSER; | ||
std::string pe_path; | ||
bool isElf = 1; | ||
if (argv != 2) | ||
{ | ||
printUsage(); | ||
return 1; | ||
} | ||
|
||
else | ||
{ | ||
pe_path = argc[1]; | ||
P_PE_PARSER = std::make_unique<PE_PARSER>(pe_path, &isElf); | ||
if (!isElf) | ||
{ | ||
std::cout << "PE magic bytes not Found" << "\n"; | ||
return 1; | ||
} | ||
P_PE_PARSER->Display_All_Information(); | ||
} | ||
|
||
return 0; | ||
} |
Oops, something went wrong.