diff --git a/src/bearopgadgetfinder.cpp b/src/bearopgadgetfinder.cpp index 70f7d46..efe01ca 100644 --- a/src/bearopgadgetfinder.cpp +++ b/src/bearopgadgetfinder.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -197,17 +197,17 @@ bool BeaRopGadgetFinder::is_valid_ending_instruction(DISASM* ending_instr_d) { bool isAllowed = false; - /* - Work Around, BeaEngine in x64 mode disassemble "\xDE\xDB" as an instruction without disassembly - Btw, this is not the only case! - */ - if(ending_instr_d->CompleteInstr[0] != 0) - { - if(m_opts & NasmSyntax) - isAllowed = is_valid_ending_instruction_nasm(ending_instr_d); - else - isAllowed = is_valid_ending_instruction_att(ending_instr_d); - } + /* + Work Around, BeaEngine in x64 mode disassemble "\xDE\xDB" as an instruction without disassembly + Btw, this is not the only case! + */ + if(ending_instr_d->CompleteInstr[0] != 0) + { + if(m_opts & NasmSyntax) + isAllowed = is_valid_ending_instruction_nasm(ending_instr_d); + else + isAllowed = is_valid_ending_instruction_att(ending_instr_d); + } return isAllowed; } @@ -217,11 +217,11 @@ bool BeaRopGadgetFinder::is_valid_instruction(DISASM *ending_instr_d) Int32 branch_type = ending_instr_d->Instruction.BranchType; return ( - /* - Work Around, BeaEngine in x64 mode disassemble "\xDE\xDB" as an instruction without disassembly - Btw, this is not the only case! - */ - ending_instr_d->CompleteInstr[0] != 0 && + /* + Work Around, BeaEngine in x64 mode disassemble "\xDE\xDB" as an instruction without disassembly + Btw, this is not the only case! + */ + ending_instr_d->CompleteInstr[0] != 0 && branch_type != RetType && branch_type != JmpType && branch_type != CallType && diff --git a/src/cpu.cpp b/src/cpu.cpp index 9ba1c56..d14e4b2 100644 --- a/src/cpu.cpp +++ b/src/cpu.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/elf.cpp b/src/elf.cpp index d6bf641..6b11aa3 100644 --- a/src/elf.cpp +++ b/src/elf.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -29,7 +29,7 @@ Elf::Elf(void) } Elf::~Elf(void) -{ +{ if(m_ELFLayout != NULL) delete m_ELFLayout; } diff --git a/src/elf_struct.cpp b/src/elf_struct.cpp index b7f53d2..bb3e2c3 100644 --- a/src/elf_struct.cpp +++ b/src/elf_struct.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/executable_format.cpp b/src/executable_format.cpp index a10bb47..6a6d73e 100644 --- a/src/executable_format.cpp +++ b/src/executable_format.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -27,7 +27,7 @@ ExecutableFormat::ExecutableFormat(void) } ExecutableFormat::~ExecutableFormat(void) -{ +{ } ExecutableFormat* ExecutableFormat::GetExecutableFormat(unsigned int magic_dword) diff --git a/src/gadget.cpp b/src/gadget.cpp index 1c44753..c16f944 100644 --- a/src/gadget.cpp +++ b/src/gadget.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/bearopgadgetfinder.hpp b/src/inc/bearopgadgetfinder.hpp index 4622838..e0ee75c 100644 --- a/src/inc/bearopgadgetfinder.hpp +++ b/src/inc/bearopgadgetfinder.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/coloshell.hpp b/src/inc/coloshell.hpp index 9ce89b2..0c2a741 100644 --- a/src/inc/coloshell.hpp +++ b/src/inc/coloshell.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -340,7 +340,7 @@ static void coloshell(const T t, const Colors colo) else \ { \ unsigned int b = hex_val[i]; \ - std::cout << "\\x" << std::setw(2) << std::right << std::setfill('0') << std::hex << b; \ + std::cout << "\\x" << std::setw(2) << std::right << std::setfill('0') << std::hex << b; \ } \ } \ std::cout << std::endl; \ diff --git a/src/inc/cpu.hpp b/src/inc/cpu.hpp index ef657e5..9e1baae 100644 --- a/src/inc/cpu.hpp +++ b/src/inc/cpu.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/elf.hpp b/src/inc/elf.hpp index 15fb510..722274d 100644 --- a/src/inc/elf.hpp +++ b/src/inc/elf.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/elf_struct.hpp b/src/inc/elf_struct.hpp index 79f8990..237fa2e 100644 --- a/src/inc/elf_struct.hpp +++ b/src/inc/elf_struct.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/executable_format.hpp b/src/inc/executable_format.hpp index ebca5a5..10d0df1 100644 --- a/src/inc/executable_format.hpp +++ b/src/inc/executable_format.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/gadget.hpp b/src/inc/gadget.hpp index 8db5a4b..34325cd 100644 --- a/src/inc/gadget.hpp +++ b/src/inc/gadget.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -105,17 +105,17 @@ class Gadget */ Instruction* get_ending_instruction(void); - /*! - * \brief This structure can be used for sorting Gadgets instance - * \return - */ - struct Sort - { - bool operator()(const Gadget *g, const Gadget *d) const - { - return g->get_disassembly() < d->get_disassembly(); - } - }; + /*! + * \brief This structure can be used for sorting Gadgets instance + * \return + */ + struct Sort + { + bool operator()(const Gadget *g, const Gadget *d) const + { + return g->get_disassembly() < d->get_disassembly(); + } + }; private: diff --git a/src/inc/instruction.hpp b/src/inc/instruction.hpp index 38b9b21..3eef4c0 100644 --- a/src/inc/instruction.hpp +++ b/src/inc/instruction.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/macho.hpp b/src/inc/macho.hpp index 5b0e500..fb3c0b6 100644 --- a/src/inc/macho.hpp +++ b/src/inc/macho.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/macho_struct.hpp b/src/inc/macho_struct.hpp index d31512c..d283f36 100644 --- a/src/inc/macho_struct.hpp +++ b/src/inc/macho_struct.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/main.hpp b/src/inc/main.hpp index c7674b4..8032277 100644 --- a/src/inc/main.hpp +++ b/src/inc/main.hpp @@ -1,21 +1,21 @@ /* - This file is part of rp++. + This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> - All rights reserved. + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + All rights reserved. - rp++ is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + rp++ is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - rp++ is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + rp++ is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with rp++. If not, see . + You should have received a copy of the GNU General Public License + along with rp++. If not, see . */ #ifndef MAIN_HPP #define MAIN_HPP @@ -23,7 +23,7 @@ #include "platform.h" /* - If you don't want any colors if your shell, you can disable it in coloshell.hpp -- just comment the #define + If you don't want any colors if your shell, you can disable it in coloshell.hpp -- just comment the #define */ #define MAXIMUM_INSTRUCTION_PER_GADGET 20 // it defines the maximum number of instruction per gadget diff --git a/src/inc/pe.hpp b/src/inc/pe.hpp index 7831545..8db5fcc 100644 --- a/src/inc/pe.hpp +++ b/src/inc/pe.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/pe_struct.hpp b/src/inc/pe_struct.hpp index 4eee495..3b6a785 100644 --- a/src/inc/pe_struct.hpp +++ b/src/inc/pe_struct.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -328,19 +328,19 @@ struct RP_IMAGE_SECTION_HEADER { unsigned short NumberOfLinenumbers; unsigned int Characteristics; - std::string get_name(void) const - { - unsigned char name_null_terminated[RP_IMAGE_SIZEOF_SHORT_NAME + 1] = {0}; - /* Yeah sometimes you don't have null byte after the name -- I try to be clean */ - memcpy(name_null_terminated, Name, RP_IMAGE_SIZEOF_SHORT_NAME * sizeof(unsigned char)); + std::string get_name(void) const + { + unsigned char name_null_terminated[RP_IMAGE_SIZEOF_SHORT_NAME + 1] = {0}; + /* Yeah sometimes you don't have null byte after the name -- I try to be clean */ + memcpy(name_null_terminated, Name, RP_IMAGE_SIZEOF_SHORT_NAME * sizeof(unsigned char)); - return std::string((char*)name_null_terminated); - } + return std::string((char*)name_null_terminated); + } void display(VerbosityLevel lvl = VERBOSE_LEVEL_1) const { w_yel_lf("-> IMAGE_SECTION_HEADER"); - + std::cout << " " << get_name() << std::endl; if(lvl > VERBOSE_LEVEL_1) diff --git a/src/inc/platform.h b/src/inc/platform.h index cde2cc6..c8fdfc6 100644 --- a/src/inc/platform.h +++ b/src/inc/platform.h @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -27,25 +27,25 @@ */ #if defined (__i386__) || defined (_M_IX86) - #define ARCH_X86 + #define ARCH_X86 #elif defined(__amd64__) || defined(_M_X64) - #define ARCH_X64 + #define ARCH_X64 #else - #error Platform not supported. + #error Platform not supported. #endif #if defined (WIN32) || defined (WIN64) || defined (_WIN32) || defined (_WIN64) - #define WINDOWS + #define WINDOWS #define SYSTEM_PLATFORM "Windows" - #if defined ARCH_X86 - #define WINDOWS_X86 - #elif defined ARCH_X64 - #define WINDOWS_X64 - #endif + #if defined ARCH_X86 + #define WINDOWS_X86 + #elif defined ARCH_X64 + #define WINDOWS_X64 + #endif #elif defined (linux) || defined (__linux) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__MACH__) - #define LINUX + #define LINUX #if defined (linux) || defined (__linux) #define SYSTEM_PLATFORM "Linux" @@ -64,11 +64,11 @@ #endif #else - #error Platform not supported. + #error Platform not supported. #endif #ifdef WINDOWS - #undef UNICODE + #undef UNICODE #endif #ifdef LINUX diff --git a/src/inc/program.hpp b/src/inc/program.hpp index c0a9140..381098a 100644 --- a/src/inc/program.hpp +++ b/src/inc/program.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -35,7 +35,7 @@ */ class Program { - public: + public: /*! * \brief Program instanciation requires a path where it can find your binary @@ -43,7 +43,7 @@ class Program * \param program_path: The path of your binary */ explicit Program(const std::string & program_path, CPU::E_CPU arch = CPU::CPU_UNKNOWN); - + ~Program(void); /*! diff --git a/src/inc/raw.hpp b/src/inc/raw.hpp index 173ebf3..6530845 100644 --- a/src/inc/raw.hpp +++ b/src/inc/raw.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/rpexception.hpp b/src/inc/rpexception.hpp index ff7d651..d535109 100644 --- a/src/inc/rpexception.hpp +++ b/src/inc/rpexception.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/safeint.hpp b/src/inc/safeint.hpp index 1ef9229..a213081 100644 --- a/src/inc/safeint.hpp +++ b/src/inc/safeint.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/section.hpp b/src/inc/section.hpp index 7de4f0a..953af6b 100644 --- a/src/inc/section.hpp +++ b/src/inc/section.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/toolbox.hpp b/src/inc/toolbox.hpp index b5e1544..9ef049c 100644 --- a/src/inc/toolbox.hpp +++ b/src/inc/toolbox.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/x64.hpp b/src/inc/x64.hpp index adfec87..e7a7a83 100644 --- a/src/inc/x64.hpp +++ b/src/inc/x64.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/inc/x86.hpp b/src/inc/x86.hpp index 2b377ea..5065635 100644 --- a/src/inc/x86.hpp +++ b/src/inc/x86.hpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/instruction.cpp b/src/instruction.cpp index 3d4e8f6..7e15074 100644 --- a/src/instruction.cpp +++ b/src/instruction.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/macho.cpp b/src/macho.cpp index 763e936..e5d3cdc 100644 --- a/src/macho.cpp +++ b/src/macho.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/main.cpp b/src/main.cpp index b0a8044..ed313dc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -37,7 +37,7 @@ int main(int argc, char* argv[]) struct arg_str *raw = arg_str0(NULL, "raw", "", "find gadgets in a raw file, 'archi' must be in the following list: x86, x64"); struct arg_lit *att = arg_lit0(NULL, "atsyntax", "enable the at&t syntax"); struct arg_lit *unique = arg_lit0(NULL, "unique", "display only unique gadget"); - struct arg_str *shexa = arg_str0(NULL, "search-hexa", "<\\x90A\\x90>", "try to find hex values"); + struct arg_str *shexa = arg_str0(NULL, "search-hexa", "<\\x90A\\x90>", "try to find hex values"); struct arg_str *sint = arg_str0(NULL, "search-int", "", "try to find a pointer on a specific integer value"); struct arg_lit *help = arg_lit0("h", "help", "print this help and exit"); struct arg_lit *version = arg_lit0("v", "version", "print version information and exit"); @@ -131,32 +131,32 @@ int main(int argc, char* argv[]) RAISE_EXCEPTION("You specified a maximum number of instruction too important for the --rop option"); std::cout << std::endl << "Wait a few seconds, rp++ is looking for gadgets.." << std::endl; - std::multiset all_gadgets = p.find_gadgets(rop->ival[0], disass_engine_display_option); - std::cout << "A total of " << all_gadgets.size() << " gadgets found." << std::endl; - if(unique->count > 0) - { - std::map unique_gadgets = only_unique_gadgets(all_gadgets); - - std::cout << "You decided to keep only the unique ones, " << unique_gadgets.size() << " unique gadgets found." << std::endl; - - /* Now we walk the gadgets found and set the VA */ - for(std::map::iterator it = unique_gadgets.begin(); it != unique_gadgets.end(); ++it) - { - display_gadget_lf(it->second->get_first_absolute_address(), it->second); - - /* Avoid mem leaks */ - delete it->second; - } - - unique_gadgets.clear(); - } - else - { - for(std::multiset::iterator it = all_gadgets.begin(); it != all_gadgets.end(); ++it) - { - display_gadget_lf((*it)->get_first_absolute_address(), *it); - } - } + std::multiset all_gadgets = p.find_gadgets(rop->ival[0], disass_engine_display_option); + std::cout << "A total of " << all_gadgets.size() << " gadgets found." << std::endl; + if(unique->count > 0) + { + std::map unique_gadgets = only_unique_gadgets(all_gadgets); + + std::cout << "You decided to keep only the unique ones, " << unique_gadgets.size() << " unique gadgets found." << std::endl; + + /* Now we walk the gadgets found and set the VA */ + for(std::map::iterator it = unique_gadgets.begin(); it != unique_gadgets.end(); ++it) + { + display_gadget_lf(it->second->get_first_absolute_address(), it->second); + + /* Avoid mem leaks */ + delete it->second; + } + + unique_gadgets.clear(); + } + else + { + for(std::multiset::iterator it = all_gadgets.begin(); it != all_gadgets.end(); ++it) + { + display_gadget_lf((*it)->get_first_absolute_address(), *it); + } + } } if(shexa->count > 0) diff --git a/src/pe.cpp b/src/pe.cpp index 1a40e0a..64372f6 100644 --- a/src/pe.cpp +++ b/src/pe.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/program.cpp b/src/program.cpp index 7b90ea5..2764570 100644 --- a/src/program.cpp +++ b/src/program.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -126,7 +126,7 @@ std::multiset Program::find_gadgets(unsigned int depth, u engine_display_option ); - std::cout << gadgets.size() << " found." << std::endl << std::endl; + std::cout << gadgets.size() << " found." << std::endl << std::endl; /* XXX: @@ -136,9 +136,9 @@ std::multiset Program::find_gadgets(unsigned int depth, u It will introduce differences between the number of unique gadgets found! */ - /* Mergin'! */ - for(std::multiset::iterator it_g = gadgets.begin(); it_g != gadgets.end(); ++it_g) - gadgets_found.insert(*it_g); + /* Mergin'! */ + for(std::multiset::iterator it_g = gadgets.begin(); it_g != gadgets.end(); ++it_g) + gadgets_found.insert(*it_g); } return gadgets_found; diff --git a/src/raw.cpp b/src/raw.cpp index ab2f1a1..daa778b 100644 --- a/src/raw.cpp +++ b/src/raw.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/rpexception.cpp b/src/rpexception.cpp index f4cdf19..267a726 100644 --- a/src/rpexception.cpp +++ b/src/rpexception.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/section.cpp b/src/section.cpp index e9b30d8..7eac5d4 100644 --- a/src/section.cpp +++ b/src/section.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/toolbox.cpp b/src/toolbox.cpp index 6352533..81ea56e 100644 --- a/src/toolbox.cpp +++ b/src/toolbox.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify @@ -156,9 +156,9 @@ unsigned char * string_to_hex(const char* hex, unsigned int * size) std::map only_unique_gadgets(std::multiset &list_gadgets) { - std::map ret; + std::map ret; - /* Now we have a list of gadget, cool, but we want to keep only the unique! */ + /* Now we have a list of gadget, cool, but we want to keep only the unique! */ for(std::multiset::const_iterator it_g = list_gadgets.begin(); it_g != list_gadgets.end(); ++it_g) { /* If a gadget, with the same disassembly, has already been found ; just add its offset in the existing one */ @@ -187,5 +187,5 @@ std::map only_unique_gadgets(std::multiset + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify diff --git a/src/x86.cpp b/src/x86.cpp index 1282d3d..46f1b15 100644 --- a/src/x86.cpp +++ b/src/x86.cpp @@ -1,7 +1,7 @@ /* This file is part of rp++. - Copyright (C) 2012, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> + Copyright (C) 2013, Axel "0vercl0k" Souchet <0vercl0k at tuxfamily.org> All rights reserved. rp++ is free software: you can redistribute it and/or modify