### Manual Lifting and Optimization Example Source: https://github.com/0xnobody/vmpattack/blob/master/README.md Demonstrates how to initialize the vmpattack instance, analyze an entry stub, lift a routine, apply optimizations, and save the resulting VTIL file. ```C++ std::vector buffer = read_file( file_path ); vmpattack instance( buffer ); if ( auto result = instance.analyze_entry_stub( my_rva ) ) { if ( auto routine = instance.lift( result->job ) ) { vtil::optimizer::apply_all_profiled( *routine ); vtil::save_routine( *routine, "C:\\my_routine.vtil" ); } } ``` -------------------------------- ### Configure threading and link libraries Source: https://github.com/0xnobody/vmpattack/blob/master/VMPAttack/CMakeLists.txt Enables pthread flags, finds the required Threads package, and links the VTIL and Threads libraries to the VMPAttack target. This is necessary for the build to succeed. ```cmake set(THREADS_PREFER_PTHREAD_FLAG ON) find_package(Threads REQUIRED) target_link_libraries(VMPAttack PRIVATE VTIL Threads::Threads) ``` -------------------------------- ### CMake configuration for VMPAttach with VTIL-Core dependency Source: https://github.com/0xnobody/vmpattack/blob/master/CMakeLists.txt This CMakeLists.txt configures the VMPAttach project. It requires CMake 3.15 or higher, declares the project, and fetches the VTIL-Core dependency from GitHub using FetchContent with shallow cloning. Finally, it adds the VMPAttack subdirectory to the build. ```cmake cmake_minimum_required(VERSION 3.15) project(VMPAttach) include(FetchContent) FetchContent_Declare( VTIL-Core GIT_REPOSITORY https://github.com/vtil-project/VTIL-Core GIT_SHALLOW true ) FetchContent_MakeAvailable(VTIL-Core) add_subdirectory(VMPAttack) ``` -------------------------------- ### Define VMPAttack executable with source files Source: https://github.com/0xnobody/vmpattack/blob/master/VMPAttack/CMakeLists.txt Declares the VMPAttack executable target and lists all its source and header files. This is the main build target for the project. ```cmake add_executable(VMPAttack analysis_context.cpp analysis_context.hpp arithmetic_expression.cpp arithmetic_expression.hpp arithmetic_operation.cpp arithmetic_operation_desc.hpp arithmetic_operation.hpp arithmetic_operations.hpp arithmetic_utilities.hpp disassembler.cpp disassembler.hpp flags.hpp instruction.cpp instruction.hpp instruction_stream.cpp instruction_stream.hpp instruction_utilities.hpp main.cpp vm_analysis_context.hpp vm_bridge.cpp vm_bridge.hpp vm_context.hpp vmentry.hpp vm_handler.cpp vm_handler.hpp vm_instance.cpp vm_instance.hpp vm_instruction.cpp vm_instruction_desc.hpp vm_instruction.hpp vm_instruction_info.hpp vm_instruction_set.hpp vmpattack.cpp vmpattack.hpp vm_state.hpp ) ```