Skip to content

Commit

Permalink
Previous VC indentation made me so sick I've indented properly the wh…
Browse files Browse the repository at this point in the history
…ole project.
  • Loading branch information
Axel "0vercl0k" Souchet committed Apr 30, 2013
1 parent 8bd0b90 commit f03a8f8
Show file tree
Hide file tree
Showing 39 changed files with 138 additions and 138 deletions.
34 changes: 17 additions & 17 deletions src/bearopgadgetfinder.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}
Expand All @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion src/cpu.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/elf.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -29,7 +29,7 @@ Elf::Elf(void)
}

Elf::~Elf(void)
{
{
if(m_ELFLayout != NULL)
delete m_ELFLayout;
}
Expand Down
2 changes: 1 addition & 1 deletion src/elf_struct.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/executable_format.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -27,7 +27,7 @@ ExecutableFormat::ExecutableFormat(void)
}

ExecutableFormat::~ExecutableFormat(void)
{
{
}

ExecutableFormat* ExecutableFormat::GetExecutableFormat(unsigned int magic_dword)
Expand Down
2 changes: 1 addition & 1 deletion src/gadget.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/bearopgadgetfinder.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/inc/coloshell.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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; \
Expand Down
2 changes: 1 addition & 1 deletion src/inc/cpu.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/elf.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/elf_struct.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/executable_format.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 12 additions & 12 deletions src/inc/gadget.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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:

Expand Down
2 changes: 1 addition & 1 deletion src/inc/instruction.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/macho.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/macho_struct.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
28 changes: 14 additions & 14 deletions src/inc/main.hpp
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
/*
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 <http://www.gnu.org/licenses/>.
You should have received a copy of the GNU General Public License
along with rp++. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef MAIN_HPP
#define MAIN_HPP

#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
Expand Down
2 changes: 1 addition & 1 deletion src/inc/pe.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down
18 changes: 9 additions & 9 deletions src/inc/pe_struct.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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)
Expand Down
26 changes: 13 additions & 13 deletions src/inc/platform.h
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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"
Expand All @@ -64,11 +64,11 @@
#endif

#else
#error Platform not supported.
#error Platform not supported.
#endif

#ifdef WINDOWS
#undef UNICODE
#undef UNICODE
#endif

#ifdef LINUX
Expand Down
Loading

0 comments on commit f03a8f8

Please sign in to comment.