From 1563f3a5635aca224553b9fb07c8ea87c86a690f Mon Sep 17 00:00:00 2001 From: Jonathan Salwan Date: Tue, 18 Oct 2011 11:36:50 +0200 Subject: [PATCH] add -allheader function --- AUTHORS | 2 + COPYING | 342 ++++++++++++++++++++++++++++++++++ INSTALL | 23 ++- Makefile | 24 ++- README.md | 1 + includes/ropgadget.h | 28 ++- src/check_allheader_mode.c | 38 ++++ src/check_arch_supported.c | 23 ++- src/check_asm_mode.c | 23 ++- src/check_bind_mode.c | 23 ++- src/check_d_mode.c | 23 ++- src/check_elf_format.c | 23 ++- src/check_elfheader_mode.c | 56 +++--- src/check_exec_maps.c | 23 ++- src/check_filter_mode.c | 23 ++- src/check_g_mode.c | 24 ++- src/check_importsc_mode.c | 23 ++- src/check_limit_mode.c | 23 ++- src/check_only_mode.c | 23 ++- src/check_opcode_mode.c | 23 ++- src/check_progheader_mode.c | 79 ++++---- src/check_read_maps.c | 23 ++- src/check_sectheader_mode.c | 93 ++++----- src/check_string_mode.c | 23 ++- src/check_syntax_mode.c | 23 ++- src/check_v_mode.c | 23 ++- src/combo_ropmaker1.c | 23 ++- src/combo_ropmaker2.c | 23 ++- src/combo_ropmaker_importsc.c | 23 ++- src/display_data.c | 23 ++- src/gadget_x8632.c | 23 ++- src/get_flags.c | 23 ++- src/get_seg.c | 23 ++- src/how_many_found.c | 23 ++- src/main.c | 23 ++- src/makecode.c | 23 ++- src/makecode_importsc.c | 23 ++- src/no_filtered.c | 23 ++- src/onlymode.c | 23 ++- src/real_string_stringmode.c | 23 ++- src/return_maps_exec.c | 23 ++- src/return_maps_read.c | 23 ++- src/ropmaker.c | 23 ++- src/save_bin_data.c | 23 ++- src/save_octet.c | 23 ++- src/search_gadgets.c | 23 ++- src/search_opcode.c | 23 ++- src/syntax.c | 26 ++- src/varop.c | 23 ++- 49 files changed, 1106 insertions(+), 481 deletions(-) create mode 100644 AUTHORS create mode 100644 COPYING mode change 100755 => 100644 INSTALL mode change 100755 => 100644 Makefile mode change 100755 => 100644 includes/ropgadget.h create mode 100644 src/check_allheader_mode.c mode change 100755 => 100644 src/check_arch_supported.c mode change 100755 => 100644 src/check_asm_mode.c mode change 100755 => 100644 src/check_bind_mode.c mode change 100755 => 100644 src/check_d_mode.c mode change 100755 => 100644 src/check_elf_format.c mode change 100755 => 100644 src/check_elfheader_mode.c mode change 100755 => 100644 src/check_exec_maps.c mode change 100755 => 100644 src/check_filter_mode.c mode change 100755 => 100644 src/check_g_mode.c mode change 100755 => 100644 src/check_importsc_mode.c mode change 100755 => 100644 src/check_limit_mode.c mode change 100755 => 100644 src/check_only_mode.c mode change 100755 => 100644 src/check_opcode_mode.c mode change 100755 => 100644 src/check_progheader_mode.c mode change 100755 => 100644 src/check_read_maps.c mode change 100755 => 100644 src/check_sectheader_mode.c mode change 100755 => 100644 src/check_string_mode.c mode change 100755 => 100644 src/check_syntax_mode.c mode change 100755 => 100644 src/check_v_mode.c mode change 100755 => 100644 src/combo_ropmaker1.c mode change 100755 => 100644 src/combo_ropmaker2.c mode change 100755 => 100644 src/combo_ropmaker_importsc.c mode change 100755 => 100644 src/display_data.c mode change 100755 => 100644 src/gadget_x8632.c mode change 100755 => 100644 src/get_flags.c mode change 100755 => 100644 src/get_seg.c mode change 100755 => 100644 src/how_many_found.c mode change 100755 => 100644 src/main.c mode change 100755 => 100644 src/makecode.c mode change 100755 => 100644 src/makecode_importsc.c mode change 100755 => 100644 src/no_filtered.c mode change 100755 => 100644 src/onlymode.c mode change 100755 => 100644 src/real_string_stringmode.c mode change 100755 => 100644 src/return_maps_exec.c mode change 100755 => 100644 src/return_maps_read.c mode change 100755 => 100644 src/ropmaker.c mode change 100755 => 100644 src/save_bin_data.c mode change 100755 => 100644 src/save_octet.c mode change 100755 => 100644 src/search_gadgets.c mode change 100755 => 100644 src/search_opcode.c mode change 100755 => 100644 src/syntax.c mode change 100755 => 100644 src/varop.c diff --git a/AUTHORS b/AUTHORS new file mode 100644 index 0000000..1360c2c --- /dev/null +++ b/AUTHORS @@ -0,0 +1,2 @@ +Authors: +* Jonathan Salwan diff --git a/COPYING b/COPYING new file mode 100644 index 0000000..aa77660 --- /dev/null +++ b/COPYING @@ -0,0 +1,342 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc. + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Library General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program 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 2 of the License, or + (at your option) any later version. + + This program 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 this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General +Public License instead of this License. + + diff --git a/INSTALL b/INSTALL old mode 100755 new mode 100644 index 34d078f..408bcd0 --- a/INSTALL +++ b/INSTALL @@ -2,16 +2,21 @@ ## RopGadget - Dev v3.3 ## Jonathan Salwan - http://twitter.com/JonathanSalwan ## http://shell-storm.org -## 2011-10-16 +## 2011-10-18 ## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. +## This program 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 2 of the License, or +## (at your option) any later version. +## +## This program 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 this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## diff --git a/Makefile b/Makefile old mode 100755 new mode 100644 index 1968d2b..292e697 --- a/Makefile +++ b/Makefile @@ -2,16 +2,21 @@ ## RopGadget - Dev v3.3 ## Jonathan Salwan - http://twitter.com/JonathanSalwan ## http://shell-storm.org -## 2011-10-16 +## 2011-10-18 ## -## Redistribution and use in source and binary forms, with or without -## modification, are permitted provided that the following conditions -## are met: -## 1. Redistributions of source code must retain the above copyright -## notice, this list of conditions and the following disclaimer. -## 2. Redistributions in binary form must reproduce the above copyright -## notice, this list of conditions and the following disclaimer in the -## documentation and/or other materials provided with the distribution. +## This program 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 2 of the License, or +## (at your option) any later version. +## +## This program 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 this program; if not, write to the Free Software +## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ## DEBUG = no @@ -65,6 +70,7 @@ SRC = $(SRC_DIR)/main.c \ $(SRC_DIR)/check_elfheader_mode.c \ $(SRC_DIR)/check_progheader_mode.c \ $(SRC_DIR)/check_sectheader_mode.c \ + $(SRC_DIR)/check_allheader_mode.c \ $(SRC_DIR)/check_syntax_mode.c \ $(SRC_DIR)/check_limit_mode.c \ $(SRC_DIR)/no_filtered.c \ diff --git a/README.md b/README.md index e9c51bc..15ab6f4 100644 --- a/README.md +++ b/README.md @@ -47,6 +47,7 @@ Usage -elfheader Display ELF Header before searching gadgets -progheader Display Program Header before searching gadgets -sectheader Display Section Header before searching gadgets +-allheader Display Section/Program/ELF Header before searching gadgets diff --git a/includes/ropgadget.h b/includes/ropgadget.h old mode 100755 new mode 100644 index 7e82cfb..ca96b3a --- a/includes/ropgadget.h +++ b/includes/ropgadget.h @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #ifndef ROPgadget_H @@ -226,7 +231,9 @@ void no_elf_format(void); void no_arch_supported(void); int check_exec_maps(t_maps_exec *, Elf32_Addr); void free_add_maps_exec(t_maps_exec *); -void display_info_header(void); +void display_program_header(void); +void display_section_header(void); +void display_elf_header(void); t_maps_exec *return_maps_exec(void); t_maps_read *return_maps_read(void); char *real_string_stringmode(char *, unsigned char *); @@ -245,6 +252,7 @@ void check_importsc_mode(char **); void check_elfheader_mode(char **); void check_progheader_mode(char **); void check_sectheader_mode(char **); +void check_allheader_mode(char **); void check_syntax_mode(char **); void check_limit_mode(char **); void how_many_found(void); diff --git a/src/check_allheader_mode.c b/src/check_allheader_mode.c new file mode 100644 index 0000000..0adda2f --- /dev/null +++ b/src/check_allheader_mode.c @@ -0,0 +1,38 @@ +/* +** RopGadget - Dev v3.3 +** Jonathan Salwan - http://twitter.com/JonathanSalwan +** http://shell-storm.org +** 2011-10-18 +** +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +*/ + +#include "ropgadget.h" + +void check_allheader_mode(char **argv) +{ + int i = 0; + + while (argv[i] != NULL) + { + if (!strcmp(argv[i], "-allheader") && flag_progheader == 0) + { + display_elf_header(); + display_program_header(); + display_section_header(); + } + i++; + } +} diff --git a/src/check_arch_supported.c b/src/check_arch_supported.c old mode 100755 new mode 100644 index 8f86285..fc6057c --- a/src/check_arch_supported.c +++ b/src/check_arch_supported.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/src/check_asm_mode.c b/src/check_asm_mode.c old mode 100755 new mode 100644 index 888ecb8..8fe2d08 --- a/src/check_asm_mode.c +++ b/src/check_asm_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_bind_mode.c b/src/check_bind_mode.c old mode 100755 new mode 100644 index 25a1ee5..367f00d --- a/src/check_bind_mode.c +++ b/src/check_bind_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_d_mode.c b/src/check_d_mode.c old mode 100755 new mode 100644 index 234147e..e4b7606 --- a/src/check_d_mode.c +++ b/src/check_d_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_elf_format.c b/src/check_elf_format.c old mode 100755 new mode 100644 index ff88612..7e8d97c --- a/src/check_elf_format.c +++ b/src/check_elf_format.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include diff --git a/src/check_elfheader_mode.c b/src/check_elfheader_mode.c old mode 100755 new mode 100644 index 5d69c6f..a80b474 --- a/src/check_elfheader_mode.c +++ b/src/check_elfheader_mode.c @@ -2,20 +2,42 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" +void display_elf_header(void) +{ + fprintf(stdout, "%sELF Header\n", YELLOW); + fprintf(stdout, "============================================================%s\n\n", ENDC); + fprintf(stdout, "entry %s0x%.8x%s\n", RED, pElf_Header->e_entry, ENDC); + fprintf(stdout, "phoff %s0x%.8x%s\n", RED, pElf_Header->e_phoff, ENDC); + fprintf(stdout, "shoff %s0x%.8x%s\n", RED, pElf_Header->e_shoff, ENDC); + fprintf(stdout, "flags %s0x%.8x%s\n", RED, pElf_Header->e_flags, ENDC); + fprintf(stdout, "ehsize %s0x%.8x (%d)%s\n", RED, pElf_Header->e_ehsize, pElf_Header->e_ehsize, ENDC); + fprintf(stdout, "phentsize %s0x%.8x (%d)%s\n", RED, pElf_Header->e_phentsize, pElf_Header->e_phentsize, ENDC); + fprintf(stdout, "phnum %s0x%.8x (%d)%s\n", RED, pElf_Header->e_phnum, pElf_Header->e_phnum,ENDC); + fprintf(stdout, "shentsize %s0x%.8x (%d)%s\n", RED, pElf_Header->e_shentsize, pElf_Header->e_shentsize, ENDC); + fprintf(stdout, "shnum %s0x%.8x (%d)%s\n", RED, pElf_Header->e_shnum, pElf_Header->e_shnum,ENDC); + fprintf(stdout, "shstrndx %s0x%.8x (%d)%s\n\n\n", RED, pElf_Header->e_shstrndx, pElf_Header->e_shstrndx,ENDC); + flag_elfheader = 1; +} + void check_elfheader_mode(char **argv) { int i = 0; @@ -23,21 +45,7 @@ void check_elfheader_mode(char **argv) while (argv[i] != NULL) { if (!strcmp(argv[i], "-elfheader") && flag_elfheader == 0) - { - fprintf(stdout, "%sELF Header\n", YELLOW); - fprintf(stdout, "============================================================%s\n\n", ENDC); - fprintf(stdout, "entry %s0x%.8x%s\n", RED, pElf_Header->e_entry, ENDC); - fprintf(stdout, "phoff %s0x%.8x%s\n", RED, pElf_Header->e_phoff, ENDC); - fprintf(stdout, "shoff %s0x%.8x%s\n", RED, pElf_Header->e_shoff, ENDC); - fprintf(stdout, "flags %s0x%.8x%s\n", RED, pElf_Header->e_flags, ENDC); - fprintf(stdout, "ehsize %s0x%.8x (%d)%s\n", RED, pElf_Header->e_ehsize, pElf_Header->e_ehsize, ENDC); - fprintf(stdout, "phentsize %s0x%.8x (%d)%s\n", RED, pElf_Header->e_phentsize, pElf_Header->e_phentsize, ENDC); - fprintf(stdout, "phnum %s0x%.8x (%d)%s\n", RED, pElf_Header->e_phnum, pElf_Header->e_phnum,ENDC); - fprintf(stdout, "shentsize %s0x%.8x (%d)%s\n", RED, pElf_Header->e_shentsize, pElf_Header->e_shentsize, ENDC); - fprintf(stdout, "shnum %s0x%.8x (%d)%s\n", RED, pElf_Header->e_shnum, pElf_Header->e_shnum,ENDC); - fprintf(stdout, "shstrndx %s0x%.8x (%d)%s\n\n\n", RED, pElf_Header->e_shstrndx, pElf_Header->e_shstrndx,ENDC); - flag_elfheader = 1; - } + display_elf_header(); i++; } } diff --git a/src/check_exec_maps.c b/src/check_exec_maps.c old mode 100755 new mode 100644 index be3117e..efa268b --- a/src/check_exec_maps.c +++ b/src/check_exec_maps.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_filter_mode.c b/src/check_filter_mode.c old mode 100755 new mode 100644 index 419f580..3ca3918 --- a/src/check_filter_mode.c +++ b/src/check_filter_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_g_mode.c b/src/check_g_mode.c old mode 100755 new mode 100644 index e1f9567..c221efe --- a/src/check_g_mode.c +++ b/src/check_g_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" @@ -69,6 +74,7 @@ static void set_all_flag(void) static void check_all_flag(char **argv) { + check_allheader_mode(argv); check_elfheader_mode(argv); check_progheader_mode(argv); check_sectheader_mode(argv); diff --git a/src/check_importsc_mode.c b/src/check_importsc_mode.c old mode 100755 new mode 100644 index ccb9680..52606c3 --- a/src/check_importsc_mode.c +++ b/src/check_importsc_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_limit_mode.c b/src/check_limit_mode.c old mode 100755 new mode 100644 index 5494900..9d77dfd --- a/src/check_limit_mode.c +++ b/src/check_limit_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_only_mode.c b/src/check_only_mode.c old mode 100755 new mode 100644 index 8f69bed..85ee3b6 --- a/src/check_only_mode.c +++ b/src/check_only_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_opcode_mode.c b/src/check_opcode_mode.c old mode 100755 new mode 100644 index 3e36ffd..c1e6eca --- a/src/check_opcode_mode.c +++ b/src/check_opcode_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_progheader_mode.c b/src/check_progheader_mode.c old mode 100755 new mode 100644 index 37ad277..0e3adef --- a/src/check_progheader_mode.c +++ b/src/check_progheader_mode.c @@ -2,53 +2,62 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" +void display_program_header() +{ + int x = 0; + + fprintf(stdout, "%sProgram Header\n", YELLOW); + fprintf(stdout, "============================================================%s\n\n", ENDC); + while (x != pElf_Header->e_phnum) + { + fprintf(stdout, "%s%s%s\n", YELLOW, get_seg(pElf32_Phdr->p_type), ENDC); + fprintf(stdout, "\toffset "); + fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_offset, ENDC); + fprintf(stdout, "vaddr "); + fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_vaddr, ENDC); + fprintf(stdout, "paddr "); + fprintf(stdout, "%s0x%.8x%s\n", RED, pElf32_Phdr->p_paddr, ENDC); + fprintf(stdout, "\tfilesz "); + fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_filesz, ENDC); + fprintf(stdout, "memsz "); + fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_memsz, ENDC); + fprintf(stdout, "flags "); + fprintf(stdout, "%s%s%s\n", RED, get_flags(pElf32_Phdr->p_flags), ENDC); + x++; + pElf32_Phdr++; + } + pElf32_Phdr -= x; + flag_progheader = 1; + fprintf(stdout, "\n\n"); +} + void check_progheader_mode(char **argv) { int i = 0; - int x = 0; while (argv[i] != NULL) { if (!strcmp(argv[i], "-progheader") && flag_progheader == 0) - { - fprintf(stdout, "%sProgram Header\n", YELLOW); - fprintf(stdout, "============================================================%s\n\n", ENDC); - while (x != pElf_Header->e_phnum) - { - fprintf(stdout, "%s%s%s\n", YELLOW, get_seg(pElf32_Phdr->p_type), ENDC); - fprintf(stdout, "\toffset "); - fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_offset, ENDC); - fprintf(stdout, "vaddr "); - fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_vaddr, ENDC); - fprintf(stdout, "paddr "); - fprintf(stdout, "%s0x%.8x%s\n", RED, pElf32_Phdr->p_paddr, ENDC); - fprintf(stdout, "\tfilesz "); - fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_filesz, ENDC); - fprintf(stdout, "memsz "); - fprintf(stdout, "%s0x%.8x%s ", RED, pElf32_Phdr->p_memsz, ENDC); - fprintf(stdout, "flags "); - fprintf(stdout, "%s%s%s\n", RED, get_flags(pElf32_Phdr->p_flags), ENDC); - x++; - pElf32_Phdr++; - } - pElf32_Phdr -= x; - flag_progheader = 1; - fprintf(stdout, "\n\n"); - } + display_program_header(); i++; } } diff --git a/src/check_read_maps.c b/src/check_read_maps.c old mode 100755 new mode 100644 index 3c41acd..75de9d8 --- a/src/check_read_maps.c +++ b/src/check_read_maps.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_sectheader_mode.c b/src/check_sectheader_mode.c old mode 100755 new mode 100644 index d72aeea..e785b3f --- a/src/check_sectheader_mode.c +++ b/src/check_sectheader_mode.c @@ -2,59 +2,68 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" -void check_sectheader_mode(char **argv) +void display_section_header(void) { char *ptrNameSection; - int i = 0; int x = 0; - + + while(x != pElf_Header->e_shnum) + { + if (pElf32_Shdr->sh_type == SHT_STRTAB && pElf32_Shdr->sh_addr == 0) + { + ptrNameSection = (char *)pMapElf + pElf32_Shdr->sh_offset; + break; + } + x++; + pElf32_Shdr++; + } + pElf32_Shdr -= x; + x = 0; + + fprintf(stdout, "%sSection Header\n", YELLOW); + fprintf(stdout, "============================================================%s\n\n", ENDC); + fprintf(stdout, "%sidx\taddr\t\tsize\t\tsection%s\n", GREEN, ENDC); + while (x != pElf_Header->e_shnum) + { + fprintf(stdout, "%s%.2d%s\t", GREEN, x, ENDC); + fprintf(stdout, "%s0x%.8x\t", RED, pElf32_Shdr->sh_addr); + fprintf(stdout, "0x%.8x\t%s", pElf32_Shdr->sh_size, ENDC); + fprintf(stdout, "%s\n", (char *)(ptrNameSection + pElf32_Shdr->sh_name)); + x++; + pElf32_Shdr++; + } + pElf32_Shdr -= x; + flag_sectheader = 1; + fprintf(stdout, "\n\n"); +} + +void check_sectheader_mode(char **argv) +{ + int i = 0; + while (argv[i] != NULL) { if (!strcmp(argv[i], "-sectheader") && flag_sectheader == 0) - { - while(x != pElf_Header->e_shnum) - { - if (pElf32_Shdr->sh_type == SHT_STRTAB && pElf32_Shdr->sh_addr == 0) - { - ptrNameSection = (char *)pMapElf + pElf32_Shdr->sh_offset; - break; - } - x++; - pElf32_Shdr++; - } - pElf32_Shdr -= x; - x = 0; - - fprintf(stdout, "%sSection Header\n", YELLOW); - fprintf(stdout, "============================================================%s\n\n", ENDC); - fprintf(stdout, "%sidx\taddr\t\tsize\t\tsection%s\n", GREEN, ENDC); - while (x != pElf_Header->e_shnum) - { - fprintf(stdout, "%s%.2d%s\t", GREEN, x, ENDC); - fprintf(stdout, "%s0x%.8x\t", RED, pElf32_Shdr->sh_addr); - fprintf(stdout, "0x%.8x\t%s", pElf32_Shdr->sh_size, ENDC); - fprintf(stdout, "%s\n", (char *)(ptrNameSection + pElf32_Shdr->sh_name)); - x++; - pElf32_Shdr++; - } - pElf32_Shdr -= x; - flag_sectheader = 1; - fprintf(stdout, "\n\n"); - } + display_section_header(); i++; } } diff --git a/src/check_string_mode.c b/src/check_string_mode.c old mode 100755 new mode 100644 index 257257b..373544a --- a/src/check_string_mode.c +++ b/src/check_string_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_syntax_mode.c b/src/check_syntax_mode.c old mode 100755 new mode 100644 index e5075d7..1de533a --- a/src/check_syntax_mode.c +++ b/src/check_syntax_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/check_v_mode.c b/src/check_v_mode.c old mode 100755 new mode 100644 index 509c3b7..e4c961f --- a/src/check_v_mode.c +++ b/src/check_v_mode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/combo_ropmaker1.c b/src/combo_ropmaker1.c old mode 100755 new mode 100644 index 46707aa..2f8a577 --- a/src/combo_ropmaker1.c +++ b/src/combo_ropmaker1.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/combo_ropmaker2.c b/src/combo_ropmaker2.c old mode 100755 new mode 100644 index 4edf4df..89624a9 --- a/src/combo_ropmaker2.c +++ b/src/combo_ropmaker2.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/combo_ropmaker_importsc.c b/src/combo_ropmaker_importsc.c old mode 100755 new mode 100644 index 013fae3..7f3e8d1 --- a/src/combo_ropmaker_importsc.c +++ b/src/combo_ropmaker_importsc.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/display_data.c b/src/display_data.c old mode 100755 new mode 100644 index 588918e..d6b78cd --- a/src/display_data.c +++ b/src/display_data.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/gadget_x8632.c b/src/gadget_x8632.c old mode 100755 new mode 100644 index 9522ee1..2a0efaf --- a/src/gadget_x8632.c +++ b/src/gadget_x8632.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/get_flags.c b/src/get_flags.c old mode 100755 new mode 100644 index 2e7d92b..add7a2b --- a/src/get_flags.c +++ b/src/get_flags.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/get_seg.c b/src/get_seg.c old mode 100755 new mode 100644 index aaf3718..f4fa696 --- a/src/get_seg.c +++ b/src/get_seg.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/how_many_found.c b/src/how_many_found.c old mode 100755 new mode 100644 index f5a6c45..2238a34 --- a/src/how_many_found.c +++ b/src/how_many_found.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/main.c b/src/main.c old mode 100755 new mode 100644 index a1cbc69..cef18c7 --- a/src/main.c +++ b/src/main.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/makecode.c b/src/makecode.c old mode 100755 new mode 100644 index fda8f2d..4e18a91 --- a/src/makecode.c +++ b/src/makecode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ /* diff --git a/src/makecode_importsc.c b/src/makecode_importsc.c old mode 100755 new mode 100644 index d3271f6..8ba1ea1 --- a/src/makecode_importsc.c +++ b/src/makecode_importsc.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/no_filtered.c b/src/no_filtered.c old mode 100755 new mode 100644 index 4d080e2..a7d8840 --- a/src/no_filtered.c +++ b/src/no_filtered.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/onlymode.c b/src/onlymode.c old mode 100755 new mode 100644 index 08d90a7..bd88237 --- a/src/onlymode.c +++ b/src/onlymode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/real_string_stringmode.c b/src/real_string_stringmode.c old mode 100755 new mode 100644 index 3d86e45..0a47f74 --- a/src/real_string_stringmode.c +++ b/src/real_string_stringmode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/return_maps_exec.c b/src/return_maps_exec.c old mode 100755 new mode 100644 index 30175f7..e6a4243 --- a/src/return_maps_exec.c +++ b/src/return_maps_exec.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/return_maps_read.c b/src/return_maps_read.c old mode 100755 new mode 100644 index 4b2747c..2ca72b9 --- a/src/return_maps_read.c +++ b/src/return_maps_read.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/ropmaker.c b/src/ropmaker.c old mode 100755 new mode 100644 index e604360..59b55a0 --- a/src/ropmaker.c +++ b/src/ropmaker.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/save_bin_data.c b/src/save_bin_data.c old mode 100755 new mode 100644 index f6b172b..655caac --- a/src/save_bin_data.c +++ b/src/save_bin_data.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/save_octet.c b/src/save_octet.c old mode 100755 new mode 100644 index 247887c..772df17 --- a/src/save_octet.c +++ b/src/save_octet.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/search_gadgets.c b/src/search_gadgets.c old mode 100755 new mode 100644 index 46fb6c7..15d22cf --- a/src/search_gadgets.c +++ b/src/search_gadgets.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/search_opcode.c b/src/search_opcode.c old mode 100755 new mode 100644 index 90f202f..ebdcd1c --- a/src/search_opcode.c +++ b/src/search_opcode.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" diff --git a/src/syntax.c b/src/syntax.c old mode 100755 new mode 100644 index 88dab54..75cf323 --- a/src/syntax.c +++ b/src/syntax.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h" @@ -35,7 +40,8 @@ void syntax(char *str) fprintf(stderr, " -limit Limit the display of gadgets\n"); fprintf(stderr, " -elfheader Display ELF Header before searching gadgets\n"); fprintf(stderr, " -progheader Display Program Header before searching gadgets\n"); - fprintf(stderr, " -sectheader Display Section Header before searching gadgets\n\n"); + fprintf(stderr, " -sectheader Display Section Header before searching gadgets\n"); + fprintf(stderr, " -allheader Display Section/Program/ELF Header before searching gadgets\n\n"); fprintf(stderr, "Ex: %s -g ./smashme.bin -bind -port 8080\n", str); fprintf(stderr, " %s -g ./smashme.bin -importsc \"\\x6a\\x0b\\x58\\x99\\x52\\x68\\x2f\\x2f\\x73\\x68\\x68\\x2f\\x62\\x69\\x6e\\x89\\xe3\\x31\\xc9\\xcd\\x80\"\n", str); diff --git a/src/varop.c b/src/varop.c old mode 100755 new mode 100644 index fe3baa2..302b288 --- a/src/varop.c +++ b/src/varop.c @@ -2,16 +2,21 @@ ** RopGadget - Dev v3.3 ** Jonathan Salwan - http://twitter.com/JonathanSalwan ** http://shell-storm.org -** 2011-10-16 +** 2011-10-18 ** -** Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions -** are met: -** 1. Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in the -** documentation and/or other materials provided with the distribution. +** This program 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 2 of the License, or +** (at your option) any later version. +** +** This program 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 this program; if not, write to the Free Software +** Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ #include "ropgadget.h"