The random jump importer defines trace events, that indicate all
possible jumps into a specific instruction range. The region where
jumps should start can be defined by a memory map given with
--jump-from. For each instruction declared in that memory range, all
possible jumps to a memory region specified by with --jump-to are
inserted. The target of the jump is saved in the data_address
field. So all database tools work as expected.
for each event E \in region(--jump-from):
foreach Instruction in region(--jump-to):
insert_trace(injection_instr = E.IP(), data_address = Instruction.addr)
Change-Id: Ie163968acae47fc6c946fc77774c47ee07950bab
36 lines
783 B
CMake
36 lines
783 B
CMake
set(SRCS
|
|
Importer.cc
|
|
MemoryImporter.cc
|
|
)
|
|
|
|
if (BUILD_LLVM_DISASSEMBLER)
|
|
set(SRCS ${SRCS}
|
|
InstructionImporter.cc
|
|
RegisterImporter.cc
|
|
RandomJumpImporter.cc
|
|
)
|
|
|
|
include(FindLLVM)
|
|
|
|
# llvm-config does add -fno-exception to the command line. But this
|
|
# breaks some boost libraries.
|
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${LLVM_CXX_FLAGS} -fexceptions")
|
|
endif(BUILD_LLVM_DISASSEMBLER)
|
|
|
|
|
|
|
|
add_executable(import-trace main.cc ${SRCS})
|
|
|
|
target_link_libraries(import-trace
|
|
${PROTOBUF_LIBRARY}
|
|
-lmysqlclient
|
|
fail-util
|
|
fail-comm
|
|
fail-sal)
|
|
|
|
if (BUILD_LLVM_DISASSEMBLER)
|
|
target_link_libraries(import-trace fail-llvmdisassembler fail-sal ${LLVM_LIBS} ${LLVM_LDFLAGS})
|
|
endif (BUILD_LLVM_DISASSEMBLER)
|
|
|
|
install(TARGETS import-trace RUNTIME DESTINATION bin)
|