Skip to content

Commit

Permalink
completed parser
Browse files Browse the repository at this point in the history
  • Loading branch information
MrRoy09 committed Jul 25, 2024
0 parents commit 9ffec0f
Show file tree
Hide file tree
Showing 4 changed files with 564 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/build
/.vs
/CMakeSettings.json
14 changes: 14 additions & 0 deletions CMakeLists.txt
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})
36 changes: 36 additions & 0 deletions PE_Parser.cpp
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;
}
Loading

0 comments on commit 9ffec0f

Please sign in to comment.