Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/rp/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,14 @@ int main(int argc, char *argv[]) {
fmt::print("You are currently using the version {} of rp++.\n", VERSION);
}

// It has been confusing for users to run & see no rop gadget displayed..so
// we'll default the gadget length setting for them.
if (g_opts.display == 0 && g_opts.rop == 0) {
fmt::print("No rop gadget length was specified via --rop, so setting "
"it to 5..\n");
g_opts.rop = 5;
}

Program p(g_opts.file, g_opts.raw);
if (g_opts.display >= VERBOSE_LEVEL_1 &&
g_opts.display <= VERBOSE_LEVEL_3) {
Expand Down
5 changes: 2 additions & 3 deletions src/rp/ropsearch_algorithm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,8 @@ void find_rop_gadgets(const std::vector<uint8_t> &section, const uint64_t vaddr,
InstructionInformation ret_instr = disass_engine.disass(
data + offset, size - offset, SafeIntAdd(vaddr, offset), ret);

// OK either this is an unknow opcode & we goto the next one Or the
// instruction encountered is too long & we also goto the next one in that
// case
// OK either this is an unknow opcode or the instruction is too long; in
// either case we goto the next one.
if (ret == UnknownInstruction || ret == OutOfBlock) {
continue;
}
Expand Down