Commit 7aef115e authored by Chu's avatar Chu

function addr

parent 828e9f8f
add_executable(inject main.cpp process.cpp process.h elf.cpp elf.h)
set_target_properties(inject PROPERTIES LINK_FLAGS_RELEASE "-static -s")
set_target_properties(inject PROPERTIES LINK_FLAGS_RELEASE "-static")
......@@ -7,6 +7,8 @@
#include "elf.h"
#include "process.h"
extern "C" void func();
int main(int argc, char *argv[])
{
if (argc != 3)
......@@ -71,6 +73,7 @@ int main(int argc, char *argv[])
std::cout << "[+] entry: 0x" << entry << std::endl;
// copy shellcode to process' entry
std::cout << reinterpret_cast<void *>(&func) << std::endl;
// call shellcode
......@@ -78,3 +81,8 @@ int main(int argc, char *argv[])
return 0;
}
void func()
{
std::cout << "func\n";
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment