diff --git a/libs/elf_verifier/elf_verifier.cpp b/libs/elf_verifier/elf_verifier.cpp deleted file mode 100644 index e47fb89833..0000000000 --- a/libs/elf_verifier/elf_verifier.cpp +++ /dev/null @@ -1,50 +0,0 @@ -// Copyright (c) Microsoft Corporation -// SPDX-License-Identifier: MIT - -#include -#include - -#include "elf_verifier.h" - -#define _AMD64_ -#pragma warning(push) -#pragma warning(disable : 4100) -#pragma warning(disable : 4456) -#pragma warning(disable : 4576) -extern "C" -{ -#include "elf.c" -#include "elfwrapper.c" -} -#pragma warning(pop) - -// Name of this function is generated by Everparse. -extern "C" void -ElfEverParseError(const char* StructName, const char* FieldName, const char* Reason) -{ - std::cerr << "ElfEverParseError failed StructName=" << StructName; - std::cerr << " FieldName=" << FieldName; - std::cerr << " Reason=" << Reason; - std::cerr << std::endl; -} - -static std::vector -read_file(const std::filesystem::path& path) -{ - std::ifstream input(path, std::ios::binary); - std::vector data(std::filesystem::file_size(path)); - input.read(data.data(), data.size()); - return data; -} - -std::unique_ptr -load_and_validate_elf(const std::filesystem::path& path) -{ - auto elf_data = read_file(path); - if (!ElfCheckElf( - elf_data.size(), reinterpret_cast(elf_data.data()), static_cast(elf_data.size()))) { - throw std::runtime_error(std::string("ELF file ") + path.string() + " is malformed"); - } - std::string str(elf_data.data(), elf_data.size()); - return std::make_unique(str); -} \ No newline at end of file diff --git a/libs/elf_verifier/elf_verifier.h b/libs/elf_verifier/elf_verifier.h deleted file mode 100644 index e51adb79c7..0000000000 --- a/libs/elf_verifier/elf_verifier.h +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright (c) Microsoft Corporation -// SPDX-License-Identifier: MIT -#pragma once - -#include -#include - -std::unique_ptr -load_and_validate_elf(const std::filesystem::path& path); diff --git a/libs/elf_verifier/elf_verifier.vcxproj b/libs/elf_verifier/elf_verifier.vcxproj deleted file mode 100644 index 09d878e082..0000000000 --- a/libs/elf_verifier/elf_verifier.vcxproj +++ /dev/null @@ -1,173 +0,0 @@ - - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 16.0 - Win32Proj - {ec3b836e-5b2a-42c2-8a7f-1062dbe0cb5e} - elfverifier - 10.0 - - - - $(SolutionDir)external\Analyze.external.ruleset - - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - StaticLibrary - true - v142 - Unicode - - - StaticLibrary - false - v142 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - false - - - true - - - false - - - - Level3 - true - WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions) - true - Use - pch.h - - - - - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions) - true - Use - pch.h - - - - - true - true - true - - - - - Level4 - true - _DEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - true - stdcpp20 - $(SolutionDir)spec\elf;%(AdditionalIncludeDirectories) - - - - - true - - - - - Level3 - true - true - true - NDEBUG;_LIB;%(PreprocessorDefinitions) - true - NotUsing - pch.h - - - - - true - true - true - - - - - - - - - - - - \ No newline at end of file diff --git a/libs/elf_verifier/elf_verifier.vcxproj.filters b/libs/elf_verifier/elf_verifier.vcxproj.filters deleted file mode 100644 index fc48a69fc8..0000000000 --- a/libs/elf_verifier/elf_verifier.vcxproj.filters +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - - - Header Files - - - \ No newline at end of file