pax_global_header00006660000000000000000000000064114141771750014522gustar00rootroot0000000000000052 comment=fe27f8d2cc6933817b0e5ad6d01b630cffcfe69e radare-1.5.2/000077500000000000000000000000001141417717500127655ustar00rootroot00000000000000radare-1.5.2/.hgignore000066400000000000000000000000241141417717500145640ustar00rootroot00000000000000syntax: glob *~ *.o radare-1.5.2/.hgtags000066400000000000000000000001331141417717500142400ustar00rootroot00000000000000ea4711f84f160da7409f330755775eb52273176a v094 93efad3495a1f58ee9f5746bbd194dce24d8d72a 1.5 radare-1.5.2/AUTHORS000066400000000000000000000003371141417717500140400ustar00rootroot00000000000000AUTHORS ======= Author and main developer: - pancake Contribs: - nibble <.ds\gmail.com> - xscript - esteve - ora8 / th0rpe - gerardo (killabyte) - elektranox - graz radare-1.5.2/COPYING000066400000000000000000000431051141417717500140230ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin St, 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 St, 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. radare-1.5.2/ChangeLog000066400000000000000000024202301141417717500145420ustar00rootroot00000000000000=== 1.5.2 === 2010-05-21 changeset: 1279:b18e2c480bfa tag: tip user: pancake date: Wed May 19 12:25:55 2010 +0200 files: doc/radare.but description: * Documentate how to redirect stdio of debugged process changeset: 1278:6e17735ccfaa user: pancake date: Wed May 12 23:35:53 2010 +0200 files: src/config.c src/dbg/ptrace.c src/dbg/unix/debug.c src/radare.h description: * Implement 'dbg.procpidmem' eval variable > e dbg.procpidmem=true # to test - as false by default - Uses /proc/${pid}/mem instead of ptrace() to read memory - it's 25% faster. Thanks erg0t and mobi changeset: 1277:97791ca60311 user: pancake date: Mon May 03 21:28:24 2010 +0200 files: src/dbg/unix/debug.c description: * Fix kill(-1) Thanks astralia for reporting! changeset: 1276:a0e68135e78b parent: 1274:94d3d9398035 parent: 1275:3f5940a514e5 user: pancake date: Wed Apr 14 15:57:57 2010 +0200 description: * merge changeset: 1275:3f5940a514e5 parent: 1273:2507b4862e5e user: pancake@localhost.localdomain date: Wed Mar 10 11:46:40 2010 -0500 files: src/dbg/darwin/debug.c description: * Fix darwin build issue noticed by NIX hydra build farm changeset: 1274:94d3d9398035 user: pancake date: Wed Apr 14 15:57:36 2010 +0200 files: src/cons.c src/dbg/arch/powerpc-darwin.h src/dbg/win32/debug.c src/rsc/pool/adict description: * Add rsc adict documentation from x86ref * Minor fixes for w32 changeset: 1273:2507b4862e5e user: pancake date: Fri Feb 19 01:27:55 2010 +0100 files: src/cmds.c src/code.c src/print.c src/section.c description: * Fix 'pd' - show N rows, not N bytes * Add 'Sa' command to display only the current section - Sa @ 0x0848040 * Fix dwarf-addrs system() call changeset: 1272:e524fa3280c1 user: pancake@flubox2 date: Tue Feb 09 17:23:36 2010 +0100 files: src/config.h description: * config.interrupted is not volatile sig_atomic_t - The C standard says that all variables accessed from a signal must be volatile and sig_atomic_t. changeset: 1271:71a9306847d6 user: pancake date: Fri Feb 05 11:28:25 2010 +0100 files: src/cmds.c description: * Fix help message in cx and cf commands changeset: 1270:97fb046977c8 user: pancake date: Tue Feb 02 11:04:02 2010 +0100 files: src/cmds.c description: * Remove useless '%' in at? help message changeset: 1269:93c8b9e9638c user: pancake date: Sat Jan 30 16:40:38 2010 +0100 files: src/analyze.c src/cons.c src/flags.c src/main.c src/radare.c description: * Fix segmentation fault related to analyze + flags - Do not use console flood protection when code analyzing - Clean up some warnings in analyze.c changeset: 1268:364a8d142d77 user: pancake@flubox date: Mon Jan 25 18:51:36 2010 +0100 files: INSTALL description: * Remove message about 'waf will replace acr'.. - And thats not going to happen :) changeset: 1267:435051e24c17 user: nibble date: Mon Jan 25 17:46:07 2010 +0100 files: src/rabin/dietpe.c description: * Fix imports resolution in dietpe changeset: 1266:d2075439747a user: pancake date: Sun Jan 24 23:53:32 2010 +0100 files: src/rsc/pool/fds description: * Apply patch from Stefan Kuttler fixing 'rsc fds' in FreeBSD changeset: 1265:6a9392655828 user: pancake@flubox date: Tue Jan 19 19:59:04 2010 +0100 files: src/cmds.c description: * Added 'won' operation to negate all bits of current block (same as wox ff) changeset: 1264:ae036154891a parent: 1263:1d3af4b8d3cc parent: 1262:288c834186b7 user: nibble date: Tue Jan 19 16:19:02 2010 +0100 description: * Merge changeset: 1263:1d3af4b8d3cc parent: 1261:85b931489723 user: nibble date: Tue Jan 19 16:18:05 2010 +0100 files: src/dbg/debug.c description: * Remove wrong flag "entry" changeset: 1262:288c834186b7 user: pancake date: Mon Jan 18 22:18:24 2010 +0100 files: src/arch/8051/code.c description: * Apply skurz0's patch fixing relative branches in 8051 CPU changeset: 1261:85b931489723 user: pancake date: Wed Jan 06 13:54:32 2010 +0100 files: TODO src/plug/io/winedbg.c description: * Fix winedbg plugin - Revert last patch - Accept !regs* and not only !reg* - Disable file analysis on open - Raw commands are sent via != instead of !! changeset: 1260:2df7bc044768 user: nibble date: Wed Jan 06 13:31:24 2010 +0100 files: src/print.c description: * Fix segfault in Visual mode changeset: 1259:a7833ac43c68 user: pancake@flubox date: Mon Dec 21 19:18:23 2009 +0100 files: src/rabin/rabin.c description: * Only dm_map_file in mach0 changeset: 1258:9d7dd3a0bf47 user: pancake date: Thu Dec 17 11:57:00 2009 +0100 files: src/plug/io/windbg-api.c src/plug/io/windbg-api.h description: * Initial import of the windbg api - Does not yet compiles or works, but it's just a draft :) changeset: 1257:bc8fdcbf271f user: pancake date: Thu Dec 17 10:16:52 2009 +0100 files: TODO src/plug/hack/Makefile description: * use python25 instead of python as plugin name for 2.5 changeset: 1256:688e46c1fb6e user: pancake date: Thu Dec 17 10:15:56 2009 +0100 files: TODO src/plug/io/winedbg.c description: * Apply skurz0's patch enhacing winedbg until-prompt reads changeset: 1255:1679d86c4e31 user: nibble date: Tue Dec 15 19:11:36 2009 +0100 files: .hgtags description: Added tag 1.5 for changeset 93efad3495a1 changeset: 1254:93efad3495a1 tag: 1.5 user: pancake date: Sun Dec 13 19:11:52 2009 +0100 files: ChangeLog configure configure.acr wscript description: * Release 1.5 - Sync changelog - Sync version in wscript === 1.5 === 2009-12-13 changeset: 1253:536e163ca733 tag: tip user: pancake date: Sun Dec 13 17:33:47 2009 +0100 files: gui/grsc/Debugger/AttachOrLoad gui/grsc/Debugger/Breakpoint gui/grsc/Flags/seek gui/grsc/Flags/set gui/grsc/Movement/SeekTo gui/grsc/Search/hex-pairs gui/grsc/Search/string description: * Shebang all grsc scripts as lintian says changeset: 1252:59fa18b1068f user: pancake date: Fri Dec 11 18:47:03 2009 +0100 files: src/arch/8051/pass1.c src/arch/8051/pass2.c src/arch/arm/code.c src/arch/ppc/gnudisppc.c src/arch/ppc/ppc_disasm.c src/arch/sparc/gnudisparc.c src/arch/x86/ollyasm/disasm.c src/binparse.c src/cmds.c src/code.h src/config.c src/config.h src/cons.c src/cons.h src/dbg/unix/debug.c src/dietline.c src/flags.c src/flags.h src/macros.c src/objects.mk src/pas.c src/plug/io/windbg.c src/plugin.c src/radare.c src/radare.h src/ranges.c src/rdb.c src/rtr.c src/search.c src/section.c src/utils.c src/utils.h src/vars.c src/visual.c description: * Some more random code cleanup with -Wall changeset: 1251:87579f8c5087 user: pancake date: Thu Dec 10 11:06:39 2009 +0100 files: TODO src/Makefile.acr src/cmds.c src/config.c src/pas.c src/plug/hack/ruby.c src/plug/hack/scriptedit.c src/ranges.c src/undo.c src/utils.c src/utils.h src/visual.c description: * Fix '? eip > a' bug (drop spaces in flag checks) * Some code cleanup (-100LOC) * Fixes in scriptedit and ruby plugins * FIx declaration of UXX_MAX * Added VE command to edit notes on current binary changeset: 1250:8dbdd2cb5c7a user: pancake date: Wed Dec 09 23:35:05 2009 +0100 files: src/config.c src/cons.c src/flags.c description: * Add re/avpage to Ve menu - Fix scrolling to bottom and display of disasm * Fix scrolling boundaries in Vt * Random code cleanup changeset: 1249:cfcd8cd6de22 user: a@localhost date: Thu Dec 10 01:33:14 2009 -0500 files: gui/main.c src/dbg/arch/mips64.c src/dbg/dosdebug.c src/dbg/system.c description: * Fix warnings on linux/mips64 * Fix build for 'old' vte changeset: 1248:a0d418ac7a65 user: pancake@flubox date: Wed Dec 09 18:35:35 2009 +0100 files: INSTALL src/javasm/Makefile src/javasm/main.c src/rabin/javasm.c src/search.c description: * Reset hit_idx counter when launching new searchs (V[nN] working again) * Fix instructions for install in solaris * Fix parsing of CLASS files (long & double skip 2 items of the cp_idx) * Fix overflow for strings of 0xffff length changeset: 1247:70eb669e5cb3 user: pancake date: Wed Dec 09 02:53:27 2009 +0100 files: src/cmds.c src/print.c description: * Oops. bring back the visual debugger (nullcmd) changeset: 1246:edac1d0d7cd6 user: pancake@aiserver date: Tue Dec 08 17:38:17 2009 -0800 files: INSTALL src/arch/m68k/m68k_disasm.h src/config.c src/dbg/regs.h src/dbg/unix/debug.c src/radare.h src/rsc/pool/maps src/stripstr.c description: * Fix warnings from OpenSolaris - Build instructions in INSTALL file * rsc maps does not uses 'column' if no such program exist * setup asm.os on sunos changeset: 1245:563178270848 user: pancake date: Wed Dec 09 01:27:56 2009 +0100 files: libusbsniff/libfdsniff.c src/arch/arm/disarm.c src/arch/ppc/ppc_disasm.h src/cons.c src/dbg/arch/i386.c src/dietline.c src/plug/io/gdb.c src/plug/io/gdb.h src/plug/io/libgdbwrap/include/revm.h src/plugin.c src/rabin/javasm.c src/utils.c description: * Dewarnification for mingw32 changeset: 1244:02105248d557 user: pancake date: Wed Dec 09 01:00:15 2009 +0100 files: autogen.sh configure configure.acr src/Makefile.acr src/grava.c description: * Upgrade to acr 0.8 * Bump revision to 1.5-hg * Fix a warning in grava.c changeset: 1243:49d4168729b6 user: pancake@localhost.localdomain date: Tue Dec 08 17:47:00 2009 -0500 files: autogen.sh config.mk.acr configure configure.acr libusbsniff/libusbsniff.c src/Makefile.acr src/analyze.c src/arch/m68k/m68k_disasm.c src/arch/mips/code.c src/arch/mips/gnudismips.c src/arch/ppc/gnudisppc.c src/arch/sparc/gnudisparc.c src/code.c src/config.c src/config.h src/data.c src/dbg/arch/x86_64.c src/dbg/debug.c src/dbg/dump.c src/dbg/system.c src/environ.c src/flags.c src/io.c src/plug/hack/Makefile src/plug/hack/perl.c src/plug/io/gdbwrap.c src/plug/io/mmap.c src/plug/io/shm.c src/plugin.c src/print.c src/rabin/dietelf.c src/radare.c src/search.c src/stripstr.c src/utils.c src/utils.h src/visual.c vala/grava/Makefile description: * Huge dewarnification on x86-64 archlinux * Build lua only when lua.h and liblua is found changeset: 1242:b55faadb4a4a user: pancake date: Tue Dec 08 20:22:45 2009 +0100 files: config.mk.acr configure configure.acr global.h.acr gui/main.c gui/main.h gui/menubar.c gui/prefs.c src/Makefile.acr src/analyze.c src/arch/8051/code.c src/arch/arm/code.c src/arch/arm/gnu/arm-dis.c src/arch/arm/gnudisarm.c src/arch/csr/code.c src/arch/csr/dis.c src/arch/csr/dis.h src/arch/mips/code.c src/arch/mips/gnudismips.c src/arch/ppc/gnudisppc.c src/arch/ppc/ppc_disasm.h src/arch/x86/ollyasm/assembl.c src/arch/x86/ollyasm/disasm.c src/binparse.c src/cmds.c src/code.c src/code.h src/config.c src/cons.c src/dbg/arch/i386.c src/dbg/darwin/signal.c src/dbg/debug.c src/dbg/dump.c src/dbg/open.c src/dbg/os.h src/dbg/parser.c src/dbg/regs.c src/dbg/signal.c src/dbg/signals.h src/dbg/unix/signal.c src/dbg/unix/syscall.c src/dbg/win32/signal.c src/dietline.c src/environ.c src/flags.c src/flags.h src/grava.c src/hack.c src/pas.c src/plug/hack/Makefile src/plug/hack/gtk-hello.c src/plug/hack/gtk-prefs.c src/plug/hack/gtk-topbar.c src/plug/hack/lua.c src/plug/hack/perl.c src/plug/hack/python.c src/plug/hack/ruby.c src/plug/hack/scriptedit.c src/plug/io/gdb.c src/plug/io/gdb.h src/plug/io/gdbwrap.c src/plug/io/gdbx.c src/plugin.h src/print.c src/print.h src/project.c src/rabin/javasm.c src/radare.c src/radare.h src/ranges.c src/ranges.h src/rasm/rsc.c src/rsc/Makefile src/rtr.c src/search.c src/socket.c src/socket.h src/utils.c src/utils.h src/vars.c src/visual.c src/vm.c src/vm.h description: * Huge dewarnification.. some segfaults fixed changeset: 1241:68611cb47b3d user: pancake@flubox date: Fri Dec 04 17:10:04 2009 +0100 files: src/search.c description: * Fix /n and /n- commands (Nn keys in visual) Thanks jep! changeset: 1240:d762bacb4031 user: pancake@flubox date: Thu Dec 03 13:39:06 2009 +0100 files: src/rabin/dietelf.c src/rabin/dietmach0.c src/rabin/rabin.c description: * Use awk instead of sed -r (do not use GNU extensions) * Clean up some warnings in rabin changeset: 1239:b6559ceac7df user: nibble date: Sat Nov 28 19:29:29 2009 +0100 files: src/radare.c src/rio.c src/section.c description: * Fix debugger * S= prints section name changeset: 1238:3d7e614016b1 user: nibble date: Sat Nov 28 16:07:10 2009 +0100 files: src/cmds.c src/rabin/rabin.c src/rio.c description: * More work fixing rva&offset support * replace get_offset with get_math in S* (cmds.c) * Minor fixups in rabin changeset: 1237:389156a5bcc1 user: nibble date: Fri Nov 27 19:42:01 2009 +0100 files: src/cmds.c src/rabin.c src/rabin/rabin.c src/section.c description: * pe rva is almost working * fixed flags to work with the rva patch * rabin - same behaviour for symbols and sections with -@ - output S cmds with -Sr changeset: 1236:e15dc1942930 user: nibble date: Thu Nov 26 18:41:29 2009 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - Added -e 'scr.floodprot=false' - Removed some false positives from output (comparing opcodes instead of asm) changeset: 1235:6ade8932924b user: pancake@localhost.localdomain date: Thu Nov 26 17:12:13 2009 +0100 files: TODO src/analyze.c src/arch/x86/code.c src/cmds.c src/config.c src/radare.c src/socket.c description: * Some new code analysis algorithms - Analysis options moved to the 'anal.' eval namespace - anal.depth instead of cfg.analdepth - Depth is now limitted to '3' (analysis/performance) - anal.push is used to analyze PUSH opcodes referencing code (depends on S command to have the correct information) - This needs to be implemented in rabin and debugger backend - anal.funhdr will search for function preludes (5589e5 on x86) - and start analyzing code at every search match - It's implemented inside the 'ap' command (analyze preludes) - All those options are disabled by default. Feel free to setup your ~/.radarerc changeset: 1234:662ebde48a59 user: nibble date: Wed Nov 25 20:08:35 2009 +0100 files: src/rabin/rabin.c description: * Fixed bug related to padding in pe files changeset: 1233:8c91d8ac0ae0 user: nibble date: Wed Nov 25 19:25:33 2009 +0100 files: src/rabin/aux.c src/rabin/aux.h src/rabin/dietelf.c src/rabin/dietelf_static.h src/rabin/dietelf_types.h src/rabin/dietpe.c src/rabin/dietpe_static.h src/rabin/dietpe_types.h src/rabin/rabin.c description: * Added -@ to rabin Use rabin -{S,i,s}@ to get the {section, import, symbol} at the specified offset * Added section field to rabin -z changeset: 1232:f2059002541e parent: 1231:c5a39071fbc8 parent: 1229:892efeb57e2a user: pancake@flubox date: Tue Nov 24 19:02:25 2009 +0100 description: * Ugly merge changeset: 1231:c5a39071fbc8 user: pancake@flubox date: Tue Nov 24 19:01:42 2009 +0100 files: src/code.c description: * Honour asm.flags. rasm -d is now happy changeset: 1230:43fdcdef927c parent: 1228:e3d44b8033d0 user: pancake@flubox date: Tue Nov 24 18:54:22 2009 +0100 files: doc/xtra/c64cpu src/arch/z80/Makefile src/arch/z80/README src/arch/z80/code.c src/arch/z80/portab.h src/arch/z80/z80_disassembler.c src/cmds.c src/code.c src/code.h src/objects.mk description: * Added support for z80 disassembler changeset: 1229:892efeb57e2a user: pancake@flubox date: Tue Nov 24 17:08:37 2009 +0100 files: src/rabin/dietpe.c description: * Apply Nibble patch fixing PE issues reported by matalaz changeset: 1228:e3d44b8033d0 user: pancake@flubox date: Tue Nov 24 16:14:20 2009 +0100 files: src/rabin/dietelf.c src/rabin/dietpe.c description: * Apply Nibble patch adding support for rabin -z on w32 - No mmap limitations changeset: 1227:005d99f8724e user: pancake@flubox date: Tue Nov 24 14:34:03 2009 +0100 files: src/rax.c description: * Fix invalid hexpair strings in rax changeset: 1226:f05f3bae3e36 user: pancake@flubox date: Tue Nov 24 14:22:25 2009 +0100 files: src/binparse.c src/cmds.c src/search.c src/utils.c description: * Fix division by zero bug in w32 * Do not allow 1 nibble hexpair strings changeset: 1225:3edadf916c9a user: pancake@flubox date: Tue Nov 24 12:27:48 2009 +0100 files: src/dbg/bp.c src/dbg/debug.c description: * Cleaner output for some debugger command output * Fix build changeset: 1224:d3ed7de2a5db user: pancake@localhost.localdomain date: Tue Nov 24 11:22:30 2009 +0100 files: src/analyze.c src/arch/arm/disarm.c src/cmds.c src/code.c src/cons.c src/data.c src/dbg/arch/i386.c src/flags.c src/flags.h src/grava.c src/pas.c src/print.c src/rdb.c src/section.c src/vars.c src/visual.c vala/grava/edge.vala vala/grava/renderer.vala vala/grava/widget.vala vala/widget.c description: * Make string_flag_offset be grep-friendly - fd section gives the name of the flag matching 'section' before the current seek * Use keys '[' and ']' to rotate in graphs changeset: 1223:d75d6cd8ace7 user: pancake@localhost.localdomain date: Tue Nov 24 00:03:56 2009 +0100 files: src/arch/8051/code.c src/cmds.c src/dbg/debug.h src/dbg/procs.c src/dbg/system.c src/dbg/unix/debug.c src/dbg/unix/procs.c src/dbg/unix/procs.h src/visual.c description: * Fix 8051 disassembly when an instruction is invalid * Correctly define the block size for the 'p' command - Now the disassembly lines are ok for pd 20 @ $$:1024 * Add !pid* and !pid? debugger commands - Show pids as a single line. useful for: (backtrace !pid $$&&!bt) .(backtrace $$) @@= `!pid*` * Remove unnecessary procs.h * Disable '`' pipes in visual mode changeset: 1222:d716916026a7 user: pancake@localhost.localdomain date: Mon Nov 23 22:44:21 2009 +0100 files: src/arch/8051/Makefile src/arch/8051/main.c src/visual.c src/wscript_build description: * Fix 8051 build for waf * Do not allow to use pipes (>|) in visual mode - Fixes interface deadlock changeset: 1221:061145d2fadb user: pancake@localhost.localdomain date: Mon Nov 23 22:31:06 2009 +0100 files: Makefile.acr gui/grsc/Debugger/SetRegister gui/topbar.c man/bindiff.1 man/rabin.1 man/radiff.1 man/rsc-bindiff.1 man/rsc.1 src/dbg/unix/debug.c src/rabin/rabin.c src/rsc/Makefile src/rsc/gtk/SetRegister.c src/rsc/gtk/SetRegister.gtkaml src/visual.c description: * Fix SetRegister grsc script and program * Update various manpages (radiff, rabin ...) * Add rsc-bindiff manpage * Add 8051 as supported arch in gradare changeset: 1220:ea6bd537678b user: pancake@flubox date: Mon Nov 23 18:59:57 2009 +0100 files: src/binparse.c description: * Fix segfault of search in w32 changeset: 1219:218d8882070b user: pancake@flubox date: Mon Nov 23 14:54:24 2009 +0100 files: src/radare.c src/rsc/pool/monitor description: * Fix 'rsc monitor' from core * Show MONITORSESSION in rsc monitor help changeset: 1218:6d9812271a77 user: pancake@flubox date: Mon Nov 23 14:25:21 2009 +0100 files: src/arch/8051/code.c src/arch/8051/global.c src/code.c description: * Fix the 8051 disassembler - length of instruction is now ok - do not emit newlines on some opcodes changeset: 1217:b7094806d690 user: pancake@localhost.localdomain date: Mon Nov 23 14:00:16 2009 +0100 files: src/arch/8051/Makefile src/arch/8051/README src/arch/8051/code.c src/arch/8051/distypes.h src/arch/8051/global.c src/arch/8051/global.h src/arch/8051/main.c src/arch/8051/pass1.c src/arch/8051/pass2.c src/arch/java/code.c src/code.c src/code.h src/objects.mk src/types.h description: * Initial import of the 8051 code analyzer and disassembler changeset: 1216:b574a5b53fec user: nibble date: Tue Nov 17 13:50:43 2009 +0100 files: src/search.c description: * Fixed bug related to search flag names changeset: 1215:baae58cbd722 user: nibble date: Mon Nov 16 14:08:16 2009 +0100 files: src/rabin/dietpe.c description: * Fixed bug resolving imports with PE bins changeset: 1214:0290ff471134 user: pancake@localhost.localdomain date: Tue Nov 10 11:26:31 2009 +0100 files: Makefile.acr description: * Fix upload URIs changeset: 1213:0d303baf09d4 user: pancake@localhost.localdomain date: Tue Nov 10 11:23:17 2009 +0100 files: gui/execute.c gui/main.c gui/menubar.c gui/topbar.c description: * Use PREFIX instead of harcoded /usr/bin/rsc path in gui/main - Various syntax fixes in gui/ - Add menu entries to change font size - Automatically setup the arch combobox depending on host arch - Always run in Visual mode (not only debugger) - Start the view in disassembly mode. changeset: 1212:4dab8dc644ad user: pancake@localhost.localdomain date: Fri Nov 06 19:30:46 2009 +0100 files: TODO src/socket.c description: * Fix socket_printf () changeset: 1211:b7c28c3b162c user: pancake@flubox date: Thu Nov 05 13:10:01 2009 +0100 files: src/rsc/gtk/EntryDialog.c src/rsc/gtk/EntryDialog.gtkaml description: * Oops. Missing whitepsaces changeset: 1210:24a1412f8b5d user: pancake@flubox date: Thu Nov 05 12:36:21 2009 +0100 files: src/rsc/gtk/EntryDialog.c src/rsc/gtk/EntryDialog.gtkaml description: * Apply a fix in EntryDialog from sre changeset: 1209:8acf25c8b155 user: pancake@localhost.localdomain date: Thu Oct 08 21:49:59 2009 +0200 files: libusbsniff/Makefile libusbsniff/libioctlsniff.c libusbsniff/libusbsniff.c description: * Embed the libusb necessary structs to build libusbsniff without libusb. Fixes warnings on some libusb variants (debian?) * Added libioctlsniff .. actually only to capture raw cgc cdrom packets on linux changeset: 1208:7bf0afb01231 user: pancake@localhost.localdomain date: Tue Sep 29 11:51:06 2009 +0200 files: src/arch/x86/code.c description: * More on 0xff byte code analysis for x86 changeset: 1207:ba57664a7990 user: pancake@localhost.localdomain date: Tue Sep 29 10:21:51 2009 +0200 files: src/plug/hack/Makefile src/plug/hack/mkruby.rb src/plug/hack/ruby.c description: * Fix build of ruby lang plugin on ruby 1.9.x * Do not build gtk+ plugins when HAVE_GUI=0 changeset: 1206:ffe1ca5d78fd user: pancake@localhost.localdomain date: Tue Sep 29 02:44:12 2009 -0400 files: src/rio.c src/section.h description: * Fix sign bit expansion in section_align because of a missing signature which was problematic for 64bit seeks changeset: 1205:565d8525269c user: pancake@localhost.localdomain date: Mon Sep 28 17:45:11 2009 -0400 files: src/utils.c description: * Fix segfault on initialization changeset: 1204:b09f40e912d7 user: pancake@localhost.localdomain date: Mon Sep 28 21:55:31 2009 +0200 files: configure configure.acr gui/grsc/Debugger/AttachOrLoad gui/grsc/Debugger/Breakpoint gui/grsc/Debugger/SetRegister gui/grsc/Flags/seek gui/grsc/Flags/set gui/grsc/Movement/SeekTo gui/grsc/Search/hex-pairs gui/grsc/Search/string src/analyze.c src/dbg/darwin/debug.c src/ira/ira-decompile.pl src/rsc/Makefile src/rsc/gtk/Display.c src/rsc/gtk/Display.gtkaml src/rsc/gtk/EntryDialog.c src/rsc/gtk/EntryDialog.gtkaml src/rsc/gtk/Makefile src/rsc/gtk/SeekTo.c src/rsc/gtk/SeekTo.gtkaml src/rsc/gtk/SetRegister.c src/rsc/gtk/SetRegister.gtkaml src/rsc/pool/Display description: * Initial import of the Sebastian Reichel (sre) reimplementation of the gtkdialog dependency in gtkaml for rsc and grsc -- Thanks! - Do not check for gtkdialog in configure * Needs some testing. gradare seems a broken * Add missing ira-decompile.pl changeset: 1203:3febf01ccf76 user: pancake@flubox date: Mon Sep 28 13:43:48 2009 +0200 files: src/binparse.c src/cmds.c src/radare.h src/rasm/main.c src/search.c description: * Implement case insensitive search with /i command - Thanks sha0 for the idea :) * Fix rasm build O:) changeset: 1202:b154f1719ebf user: pancake@flubox date: Mon Sep 28 13:28:59 2009 +0200 files: src/dbg/darwin/debug.c src/rasm/main.c src/rasm/rasm.c description: * Fix page mapping lists on osx-32 bits - Test(1) to fix the write err in arm-osx * Use 'olly' on rasm-w32 by default - Added RASM_ARCH environment to rasm to choose default arch changeset: 1201:f605a3a8796c user: pancake@flubox date: Mon Sep 28 13:16:06 2009 +0200 files: src/config.c src/dietline.c src/plug/io/libgdbwrap/include/revm.h src/plug/io/windbg.c src/readline.c src/utils.c src/visual.c description: * Fix w32 build changeset: 1200:c42069730bd4 user: pancake@flubox date: Tue Sep 22 17:11:43 2009 +0200 files: src/plug/io/wscript_build description: * Fix waf build changeset: 1199:2d7da03f340a user: pancake@localhost.localdomain date: Wed Sep 16 00:44:46 2009 +0200 files: src/objects.mk src/plug/io/windbg.c src/plug/io/winedbg.c src/plugin.c src/plugin.h description: * Initial draft implementation of windbg:// IO plugin - Windbg kernel serial debugger changeset: 1198:c2053c21f152 user: pancake@localhost.localdomain date: Tue Sep 15 21:32:15 2009 +0200 files: TODO src/plug/io/socket.c src/rsc/pool/mmx2ls2f.pl src/utils.c description: * Added mmx2ls2f rsc script to convert MMX code into Loongson2F one * Use stat in r_file_exists() instead of buggy open (portability problems?) * Added support for unix socket files to io/socket.c plugin - radare socket://./socket.file changeset: 1197:c35dd1cf9b93 user: pancake@localhost.localdomain date: Wed Sep 02 08:56:09 2009 +0000 files: src/config.c src/cons.c src/cons.h src/radiff/main.c description: * Rename scr.interactive into scr.floodprot - Show proper warning when screen is being flooded * Added radiff -x using ired + gnu diff for diffing changeset: 1196:77b8d9817351 user: pancake@localhost.localdomain date: Tue Sep 01 23:48:54 2009 +0000 files: src/rabin/rabin.c description: * Add -vv in the help message of rabin * Nice output by default (-v is a bit verboser -vv is the nice for parsing) - The order has been shifted to be cleaner changeset: 1195:67d495567575 user: pancake@localhost.localdomain date: Tue Sep 01 10:01:44 2009 +0000 files: TODO src/cmds.c src/rsc/pool/bindiff src/vars.c description: * Added aC and aCf commands to list calls using code analysis * Some fixups and add warning for size in the bindiff (gnudiff) changeset: 1194:d64806dd5a53 user: pancake@localhost.localdomain date: Mon Aug 31 23:33:23 2009 +0000 files: TODO src/cmds.c src/config.c src/data.c src/data.h src/dbg/system.c src/dbg/unix/debug.c src/flags.c src/vars.c src/visual.c description: * Valid command: 'f-flag' (previously a space was mandatory) * Added 'dbg.framereg' to specify the arch-specific stack frame register (EBP on x86) * Visual command (V) now accepts extra chars to be executed as input keys - Vv is the visual mode for code analysis - Implements a very basic interface for managing functions, xrefs, variables - Under development, ideas are welcome - Very ugly and spaguetti code :) * Documentate !regio and get better help for !reg command * Fix the function boundary identification, used to identify the owner function for a variable registration * Show variable value also in hexadecimal (not only dec) changeset: 1193:a132b62ef254 parent: 1192:e7c613d9509a parent: 1191:0aaadd42bff7 user: pancake <@youterm.com> date: Thu Aug 20 12:35:49 2009 +0200 description: * Oops merge changeset: 1192:e7c613d9509a parent: 1187:c24150ccc941 user: pancake <@youterm.com> date: Thu Aug 20 12:34:59 2009 +0200 files: src/print.c src/rsc/pool/move description: * Apply graz's patch for negative olen in data_print() * Fix bug reported by hex in 'rsc move' - Now its working on filenames with spaces changeset: 1191:0aaadd42bff7 user: pancake@localhost.localdomain date: Sat Aug 01 20:59:17 2009 +0000 files: TODO src/dbg/debug.c src/rsc/pool/adict src/rsc/pool/bindiff src/utils.c description: * Fix build of clearenv() on BSD systems * Documentate 'movzx' into rsc adict * Fail rsc bindiff if cannot read any of the target files changeset: 1190:8a6831c3ae0c user: pancake@localhost.localdomain date: Wed Jul 29 12:14:07 2009 +0000 files: src/arch/x86/udis86/syn-att.c src/arch/x86/udis86/syn-intel.c src/arch/x86/udis86/syn-pseudo.c description: * Quick and dirty hack to fix >32bit jimm addresses on 32 bit x86 disasm - Needs a better fix for udis86 to not extend the sign bit changeset: 1189:570e083d8821 user: pancake@localhost.localdomain date: Wed Jul 29 11:58:06 2009 +0000 files: src/code.c description: * Display code xrefs in disassembly as well - asm.xrefsto is not handled (regression?) it needs a review changeset: 1188:83768dd5a020 user: pancake@localhost.localdomain date: Tue Jul 28 19:23:55 2009 +0000 files: configure configure.acr src/plug/hack/perl.c wscript description: * Bump revision number to 1.4.3-hg * Fix waf install (ruby, lua, perl, python APIs has been moved) * Avoid perl plugin exits when failing - Display human friendly error message when typing wrong perl expressions changeset: 1187:c24150ccc941 user: pancake <@youterm.com> date: Fri Jul 24 15:59:37 2009 +0200 files: ChangeLog configure configure.acr description: * Release 1.4.2 - Update changelog and bump revision === 1.4.2 === 2009-07-24 changeset: 1186:e1e2c70177f2 tag: tip user: pancake <@youterm.com> date: Wed Jul 22 17:52:16 2009 +0200 files: src/dbg/debug.c description: * Apply sre patch (with few minor modifications) fixing an issue on '_' changeset: 1185:9b7c3a7149f9 user: pancake <@youterm.com> date: Wed Jul 22 17:17:41 2009 +0200 files: src/dbg/debug.c description: * Oops, inverse conditional O:) changeset: 1184:4699ddfe4551 user: pancake <@youterm.com> date: Wed Jul 22 16:42:14 2009 +0200 files: doc/radare.but src/dbg/debug.c description: * Added documentation for file.dbg_env and file.dbg_arg in the book * Some fixups in the dbg_env code (thanks sre! :D) changeset: 1183:05d4cee22982 user: pancake@localhost.localdomain date: Wed Jul 22 11:14:11 2009 +0000 files: doc/radare.but description: * Add documentation for rasm -s - Rename 'R' command to 'g' in documentation - Documentation about hw/sw breakpoints changeset: 1182:101eac538654 user: pancake@localhost.localdomain date: Wed Jul 22 09:48:04 2009 +0000 files: scripts/args.txt src/config.c src/dbg/darwin/debug.c src/dbg/io.c src/dbg/open.c src/dbg/unix/debug.c description: * Initial implementation of 'file.dbg_arg' eval variable - Allows to manually configure the arguments of the program to be debugged using a file * Construct debug environment also on Darwin (OSX) * Minor random code cleanup changeset: 1181:fbe6f239e3d8 user: pancake@localhost.localdomain date: Tue Jul 21 23:08:22 2009 +0000 files: TODO src/dbg/debug.c src/utils.c description: * Allow to load the environment var contents slurping files changeset: 1180:7c5725f1621c user: pancake@localhost.localdomain date: Tue Jul 21 22:54:45 2009 +0000 files: TODO src/config.c src/dbg/debug.c description: * Added new eval variables: dbg.env_ldso : setup or not the ld.so environment (false by default) file.dbg_env : file to define the environment for the child process changeset: 1179:cffaf082eefd user: pancake@localhost.localdomain date: Tue Jul 21 19:44:01 2009 +0000 files: vala/Makefile description: * Do not update C files from Vala by default - Only for maintainance (faster build) changeset: 1178:03464ce31398 user: pancake <@youterm.com> date: Mon Jul 20 16:56:54 2009 +0200 files: vala/grava/graph.vala description: * Fix build of vala code changeset: 1177:11c1fc2cde2c user: pancake <@youterm.com> date: Mon Jul 20 16:31:27 2009 +0200 files: src/dbg/events.c description: * Fix no-sense segfault related to x86-64 with gcc -O2 changeset: 1176:70a9d0f54322 user: pancake <@youterm.com> date: Fri Jul 17 16:50:52 2009 +0200 files: Makefile.acr config.mk.acr description: * Do not strip binaries on install - New 'install-strip' target to strip binaries after install - Fixes gentoo bug (thanks ioanis) changeset: 1175:002974a68fec user: pancake <@youterm.com> date: Fri Jul 17 11:36:13 2009 +0200 files: src/cmds.c src/rio.c src/search.c src/utils.c src/utils.h description: * Fix search progressbar percentatge - the % is properly calculated now - The number of hits are displayed at the right - Current search offset is also displayed * Fix seek/relseek for >32bit offsets changeset: 1174:14e7fa471bd4 user: pancake <@youterm.com> date: Thu Jul 16 11:05:20 2009 +0200 files: Makefile.acr api/Makefile description: * Apply DESTDIR fixes patch from 'sre'. Thanks! changeset: 1173:448e7628ec23 user: pancake <@youterm.com> date: Wed Jul 15 18:55:54 2009 +0200 files: src/flags.c src/main.c src/rasm/main.c src/utils.c description: * Use 'x86' arch as default one for 'rasm' (rsc is broken?) * Some warnings cleaned up changeset: 1172:6edffc21605d user: pancake <@youterm.com> date: Wed Jul 15 17:23:32 2009 +0200 files: src/flags.c description: * Fix segfault on null pointer in flag_space_set (thanks graz) changeset: 1171:10f5d242dce9 user: nibble date: Fri Jul 10 17:54:51 2009 +0200 files: src/rabin/javasm.c src/rabin/rabin.c description: * Fix class files autodetection changeset: 1170:6a610e36284b user: nibble date: Fri Jul 10 17:04:34 2009 +0200 files: src/rabin/javasm.c description: * Minor fixup in javasm changeset: 1169:f7cccecf5ded user: nibble date: Fri Jul 10 16:56:02 2009 +0200 files: src/rabin/javasm.c src/rabin/rabin.c description: * Fix 'rabin -zr' for class files changeset: 1168:4a06611a6e70 user: pancake@localhost.localdomain date: Fri Jul 10 13:01:16 2009 +0000 files: api/python/radare/remote.py api/ruby/radare/remote.rb libusbsniff/libfdsniff.c description: * Some minor random fixups in the python and ruby RAP APIs changeset: 1167:d1f03a639ba4 user: pancake <@youterm.com> date: Thu Jul 09 11:03:07 2009 +0200 files: src/rfile.acr description: * Fix bashism changeset: 1166:b1df8cd002b8 user: pancake <@youterm.com> date: Wed Jul 08 17:43:17 2009 +0200 files: src/analyze.c src/arch/arm/code.c src/arch/arm/gnudisarm.c src/arch/bf/code.c src/arch/csr/code.c src/arch/csr/dis.c src/arch/csr/dis.h src/arch/dalvik/code.c src/arch/java/code.c src/arch/m68k/code.c src/arch/mips/code.c src/arch/mips/gnudismips.c src/arch/mips/vm.c src/arch/msil/code.c src/arch/msil/demsil.c src/arch/msil/demsil.h src/arch/ppc/code.c src/arch/ppc/gnudisppc.c src/arch/sparc/code.c src/arch/sparc/gnudisparc.c src/arch/x86/code.c src/arch/x86/dislen.c src/arch/x86/vm.c src/binparse.c src/binparse.h src/bytepat.c src/cmds.c src/code.c src/code.h src/code/syscall.c src/config.c src/config.h src/data.c src/data.h src/dbg/arch/arch.h src/dbg/arch/arm-bp.c src/dbg/arch/arm.c src/dbg/arch/i386-bp.c src/dbg/arch/i386.c src/dbg/arch/mips64-bp.c src/dbg/arch/mips64.c src/dbg/arch/powerpc-bp.c src/dbg/arch/powerpc.c src/dbg/arch/x86_64-bp.c src/dbg/arch/x86_64.c src/dbg/arch/x86_64.h src/dbg/bp.c src/dbg/darwin/debug.c src/dbg/darwin/fd.c src/dbg/debug.c src/dbg/debug.h src/dbg/dump.c src/dbg/fd.c src/dbg/io.c src/dbg/lib.c src/dbg/libps2fd.h src/dbg/mem.c src/dbg/mem.h src/dbg/os.h src/dbg/parser.h src/dbg/regs.c src/dbg/signal.c src/dbg/thread.h src/dbg/unix/debug.c src/dbg/unix/fd.c src/dbg/unix/syscall.c src/dbg/win32/debug.c src/dbg/win32/fd.c src/environ.c src/flags.c src/flags.h src/grava.c src/include/bfd.h src/io.c src/macros.c src/macros.h src/main.c src/pas.c src/plug/io/bfdbg.c src/plug/io/debug.c src/plug/io/ewf.c src/plug/io/gdb.c src/plug/io/gdbwrap.c src/plug/io/gdbx.c src/plug/io/gxemul.c src/plug/io/haret.c src/plug/io/malloc.c src/plug/io/mmap.c src/plug/io/pcap.c src/plug/io/posix.c src/plug/io/remote.c src/plug/io/serial.c src/plug/io/shm.c src/plug/io/socket.c src/plug/io/trk.c src/plug/io/w32.c src/plug/io/winedbg.c src/plugin.h src/print.c src/print.h src/project.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf_static.h src/rabin/dietelf_types.h src/rabin/dietmach0.c src/rabin/dietmach0.h src/rabin/dietmach0_utils.c src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/dietpe_static.h src/rabin/dietpe_types.h src/rabin/javasm.c src/rabin/pe.h src/rabin/rabin.c src/radare.c src/radare.h src/radiff/bytediff.c src/radiff/main.c src/radiff/radiff.h src/rahash/crc16.c src/rahash/crc32.c src/rahash/entropy.c src/rahash/hamdist.c src/rahash/hash.c src/rahash/hash.h src/rahash/md4.c src/rahash/rahash.c src/rahash/sha2.h src/ranges.c src/ranges.h src/rasm/arm.c src/rasm/java.c src/rasm/main.c src/rasm/nasm.c src/rasm/olly.c src/rasm/ppc.c src/rasm/rasm.c src/rasm/rasm.h src/rasm/rsc.c src/rasm/x86.c src/rdb.c src/rdb.h src/rio.c src/rio.h src/search.c src/section.c src/section.h src/stripstr.c src/trace.c src/types.h src/undo.c src/undo.h src/utils.c src/utils.h src/vars.c src/visual.c src/vm.c src/vm.h src/xrefs.c description: * Major basic type renaming - u16->ut16, u32->ut32, u64->ut64 - Avoid some build problems on powerpc-OSX changeset: 1165:dbd25ff5d942 user: root@iPod-touch date: Tue Jul 07 12:08:34 2009 +0200 files: src/rabin/rabin.c src/utils.c description: * Disable rabin -z strings on osx * Do not use 'fstat' to avoid problems on broken iphone SDK changeset: 1164:cefbc5e33b01 user: pancake@localhost.localdomain date: Thu Jul 02 23:10:49 2009 +0000 files: src/print.c src/socket.c description: * Fix octal dump 'po' command changeset: 1163:98edc54e5788 user: nibble date: Sun Jun 28 12:45:02 2009 +0200 files: src/dbg/arch/i386-linux64.h src/dbg/arch/x86_64.c description: * Fixed !reg for x86_64 changeset: 1162:3a05081e0546 user: pancake@localhost.localdomain date: Fri Jun 26 11:08:24 2009 +0000 files: src/dbg/arch/arm.c src/dbg/arch/i386-linux64.h src/dbg/arch/i386.c src/dbg/arch/mips64.c src/dbg/arch/powerpc.c src/dbg/arch/x86_64.c src/dbg/system.c description: * Added support to change the r8-r15 regs in x86-64 * Added new !reg= command to get a list of registers - Implement it on every debugger backend changeset: 1161:848269cd432e user: pancake@localhost.localdomain date: Fri Jun 26 00:36:45 2009 +0000 files: TODO src/print.c src/radare.c description: * Fix segfault in @@= iterator - Do not stop when offset of flag is 0 * Fix format string bug in pR command changeset: 1160:7fd40e0c28c4 user: pancake@localhost.localdomain date: Thu Jun 18 10:54:20 2009 +0000 files: TODO api/ruby/radare/api.rb src/rax.c src/utils.c description: * Fix rax bin2hex conversion * Reorganization of the TODO points * Add support for floating values in get_offset ? 33.4f is the same as ?f 33.4 changeset: 1159:a825abc80930 user: pancake@localhost.localdomain date: Wed Jun 17 19:03:57 2009 +0000 files: api/ruby/radare/remote.rb description: * Some fixups in the remote ruby api for cmd and system changeset: 1158:273d24bca572 user: pancake@localhost date: Wed Jun 17 10:25:44 2009 -0700 files: src/visual.c description: * Fix segfault related to the solaris libc's printf in visual changeset: 1157:356ec74753d1 user: pancake@localhost.localdomain date: Wed Jun 17 01:23:46 2009 +0000 files: TODO api/ruby/radare/remote.rb src/rasc/rasc.c description: * rasc -x doesnt shows spaces * Implement RAP_WRITE in rap server for ruby api changeset: 1156:7b2b7b965aaf parent: 1155:a8945592538e parent: 1154:2401fedf09b2 user: pancake@localhost.localdomain date: Wed Jun 17 00:53:36 2009 +0000 description: * Merge heads changeset: 1155:a8945592538e parent: 1152:9717a7c8d630 user: pancake@localhost.localdomain date: Wed Jun 17 00:53:11 2009 +0000 files: TODO api/ruby/radare/remote.rb src/plug/io/remote.c src/print.c description: * Minor fixups in the ruby remote api * Return -1 directly when cannot connect on rap:// listen in core * Redefine 'am' format strings instead of appending them * Add support for following pointers for following nested structures - am stack zx shell hex - pm x[*stack] @ esp # note the 'asterisk' :) changeset: 1154:2401fedf09b2 parent: 1153:3f6fe24baebf parent: 1152:9717a7c8d630 user: nibble date: Wed Jun 17 01:30:05 2009 +0200 description: * Merge changeset: 1153:3f6fe24baebf parent: 1151:16e5be3ba863 user: nibble date: Wed Jun 17 01:24:01 2009 +0200 files: src/radare.c src/rsc/pool/dwarf-addr src/rsc/pool/dwarf-addrs description: * Fix bug regarding config.realfile * Fix dwarf rsc scripts changeset: 1152:9717a7c8d630 user: pancake@localhost.localdomain date: Tue Jun 16 23:56:28 2009 +0000 files: api/Makefile api/python/client.py api/python/example.py api/python/radare/remote.py api/ruby/client.rb api/ruby/radare/api.rb api/ruby/radare/remote.rb api/ruby/server.rb src/plug/hack/Makefile src/plug/hack/lua.c src/plug/hack/ruby.c src/plug/io/gdb.c src/plug/io/remote.c src/print.c description: * Fix install of new ruby api * Initial working implementation of the ruby remote api - For server and client - Added examples * Fix cmd and system for python remote bindings * Properly close the connections and start listening again on the ruby and python bindings for the remote server * Drop '2>/dev/null' when building python and perl plugins * Fix 'pz' command when block doesnt ends with '\0' (only happens when block > filesize. Current implementation is slower but more secure changeset: 1151:16e5be3ba863 user: pancake <@youterm.com> date: Tue Jun 16 17:18:42 2009 +0200 files: api/lua/anal.lua api/lua/fuzzer-loop.lua api/lua/fuzzer-target.c api/lua/opcleaner.lua api/lua/posix/Makefile api/lua/posix/modemuncher.c api/lua/posix/posix.c api/lua/pushpop.lua api/lua/search-demo.lua api/lua/vozme.lua api/perl/rscript.pl api/python/bochs.py api/python/client.py api/python/example.py api/python/standalone.py scripts/anal.lua scripts/example.py scripts/example.rb scripts/fuzzer-loop.lua scripts/fuzzer-target.c scripts/lua/posix/Makefile scripts/lua/posix/modemuncher.c scripts/lua/posix/posix.c scripts/opcleaner.lua scripts/pushpop.lua scripts/radapy-example.py scripts/radapy.py scripts/radapy_bochs.py scripts/radapy_client.py scripts/rscript.pl scripts/search-demo.lua scripts/shell.ra scripts/standalone.py scripts/vozme.lua description: * Some more scripting examples reorganization changeset: 1150:e2b27646947b user: pancake <@youterm.com> date: Tue Jun 16 16:48:04 2009 +0200 files: Makefile.acr TODO api/Makefile api/README api/TODO api/lua/radare/api.lua api/perl/Radare/Remote.pm api/perl/test.pl api/python/anal.py api/python/radare/__init__.py api/python/radare/analysis.py api/python/radare/api.py api/python/radare/remote.py api/python/server.py api/ruby/Makefile api/ruby/client.rb api/ruby/radare/api.rb api/ruby/radare/remote.rb api/ruby/server.rb scripts/radapy-example.py scripts/radapy.py src/cmds.c src/plug/hack/analysis/Makefile src/plug/hack/analysis/h.c src/plug/hack/analysis/ranal.py src/plug/hack/analysis/test.py src/plug/hack/perl/Radare/Remote.pm src/plug/hack/perl/test.pl src/plug/hack/radare.lua src/plug/hack/radare.py src/plug/hack/radare.rb src/plug/hack/ruby/Makefile src/plug/hack/ruby/radare/api.rb src/plug/hack/ruby/radare/remote.rb src/plug/hack/ruby/test.rb src/print.c description: * Added api/ directory as the root entrypoint for language binding APIs (python/ruby/perl/...) * Update TODO file changeset: 1149:8b52a7244060 user: nibble date: Tue Jun 16 13:27:10 2009 +0200 files: src/arch/ppc/code.c description: * Fix bug in ppc code analysis changeset: 1148:db22f44f4fb6 user: pancake@localhost.localdomain date: Tue Jun 16 12:28:04 2009 +0000 files: scripts/radapy.py src/plug/hack/ruby/radare/remote.rb src/plug/hack/ruby/test.rb description: * Some more random work for the ruby remote api changeset: 1147:5c3403d523cb user: pancake@localhost.localdomain date: Mon Jun 15 23:09:53 2009 +0000 files: configure configure.acr src/dbg/arch/powerpc.c src/plug/hack/ruby/Makefile src/plug/hack/ruby/radare/api.rb src/plug/hack/ruby/radare/remote.rb src/plug/hack/ruby/test.rb description: * Initial import of the ruby remote api - Added semi-working version of RapServer - RapClient is still to be implemented - Includes a simple test program * Bump version to 1.4.2b * Fix dbg/arch/powerpc.c build on javi's osx-ppc :? changeset: 1146:700fb4cb81ca user: pancake <@youterm.com> date: Mon Jun 15 18:17:17 2009 +0200 files: src/data.c description: * Fix segfault only appearing when compiling with -O2 changeset: 1145:cc737f36b162 user: pancake@localhost.localdomain date: Sun Jun 14 12:42:52 2009 +0000 files: HISTORY TODO src/btree.c src/btree.h src/cons.c src/flags.c src/flags.h src/main.h src/objects.mk src/plug/hack/radare.rb src/rabin/dietmach0.c description: * Fix endian bug in yesno() function * Complete the HISTORY file until 1.4.1 * Added some stuff in the TODO * Initial import of btree.c - USE_BTREE (=0) - Some integration into flags.c (disabled atm) * Fix ruby's bin2hex and hex2bin * Fix load of mach0-ppc bins (endian+paddr) changeset: 1144:262fe74eb556 user: pancake@ date: Sun Jun 14 04:44:11 2009 +0000 files: src/dbg/unix/debug.c src/rabin/dietmach0.h description: * Fix freebsd build changeset: 1143:184968db9c8d user: nibble date: Fri Jun 12 19:53:45 2009 +0200 files: src/rasm/Makefile src/rasm/rasm.h src/rasm/wscript_build src/wscript_build description: * Applied dsoftware patch, thanks! :) changeset: 1142:e3a85684680f user: pancake <@youterm.com> date: Fri Jun 12 19:31:29 2009 +0200 files: ChangeLog src/cmds.c description: * Release 1.4.1 * Drop unnecessary code in ?f === 1.4.1 === 2009-06-12 changeset: 1141:69a748463390 tag: tip user: nibble date: Fri Jun 12 18:17:04 2009 +0200 files: src/arch/arm/aasm/Makefile src/rabin/rabin.c description: * Remove last ${Q} (i hope) * Fixed dietpe segfault with .Net PE changeset: 1140:c13bf7cb6eba user: pancake <@youterm.com> date: Fri Jun 12 17:42:32 2009 +0200 files: TODO src/print.c description: * Fix 64b issues on the null pointer gmtime - Fixes segfaults on pt, pT and pF (Thanks nion for reporting!) changeset: 1139:c670d25801a0 user: pancake <@youterm.com> date: Fri Jun 12 13:18:40 2009 +0200 files: java/Makefile src/dbg/Makefile description: * Remove more stupid ${E} and ${Q} changeset: 1138:ffeac92adb6c user: nibble date: Fri Jun 12 13:10:20 2009 +0200 files: src/print.c description: * Fixed bug in print.c changeset: 1137:93b9448a1876 user: pancake@localhost.localdomain date: Fri Jun 12 11:46:31 2009 +0000 files: TODO src/cmds.c src/config.c src/config.h src/plug/hack/perl/Radare/Remote.pm src/plug/hack/perl/test.pl src/print.c src/print.h src/radare.c src/utils.c description: * Reorder TODO a bit moar * Added 'pw' command to print 32bit words (like x/x in gdb) * Show a end comma in ?f if reverse translation of float value is not the same as the direct conversion * Added config.realfile fixing rabin calls to unexistent files errors * Added initial perl stub code for remote api changeset: 1136:9ab6035fb18a user: nibble date: Thu Jun 11 22:04:12 2009 +0200 files: src/config.c src/config.h src/print.c src/radare.c src/visual.c description: * Fixed zoom in Visual mode changeset: 1135:11e9fac8a057 user: pancake@localhost.localdomain date: Thu Jun 11 20:53:49 2009 +0000 files: TODO src/cmds.c src/config.c src/dbg/arch/i386.c src/radare.c src/radare.h description: * Fix output of !fpregs (Fixed support for MMX, XMM and FPU) * Some indentation fixes in config.c * Added todo for 1.4.1 release (tomorrow?) * Added ?f command to convert from float to u32 hex value and reverse changeset: 1134:00c0bcc86d4f user: pancake <@youterm.com> date: Thu Jun 11 18:30:25 2009 +0200 files: libusbsniff/Makefile description: * Fix libusbsniff build (drop $Q and $E) changeset: 1133:ceb51e267b71 user: nibble date: Thu Jun 11 18:27:25 2009 +0200 files: TODO src/print.c description: * Fixed zoom segfault changeset: 1132:ec8eb2459233 user: nibble date: Thu Jun 11 15:59:48 2009 +0200 files: src/print.c src/rabin/dietelf.c src/radiff/radiff.h description: * Fixed bug in r_bin_elf resolving imports * Added missing file radiff.h changeset: 1131:900ecd94e868 user: pancake@localhost.localdomain date: Thu Jun 11 12:00:48 2009 +0000 files: src/rabin/rabin.c src/radare.c src/radiff/bytediff.c src/radiff/main.c src/utils.c src/utils.h description: * Fix unksize/limit issue when opening static bins * '>' can now be used from radare_cmd_str (python, perl, ..) * Radiff now handles 64bit values on hex and dec bases for -f and -t * Fix signature of str_cpy function changeset: 1130:2c48f5f60f04 user: pancake <@youterm.com> date: Wed Jun 10 19:58:10 2009 +0200 files: src/analyze.c src/rasc/Makefile description: * Fix a build issue (related to ${E} ${Q} droppage) * Fix a stupid type notified by lintian changeset: 1129:d909777a7c4e user: pancake@localhost date: Wed Jun 10 05:24:18 2009 -0700 files: Makefile.acr config.mk.acr configure.acr configure.hook gui/Makefile src/Makefile.acr src/config.c src/cons.c src/flags.c src/plug/hack/Makefile src/utils.c src/utils.h src/vm.c description: * Fix build for opensolaris-x86 - Added in the whitelist list of supported debugger platforms - Rename strbcpy and strccpy with some underlines (they are solaris macros) * Drop ${E} and ${Q} from makefiles * make install INSTALL=/usr/bin/ginstall required .. configure script needs re-acr-ization changeset: 1128:56d7f6cc0fa9 user: nibble date: Wed Jun 10 01:59:12 2009 +0200 files: src/dbg/open.c src/radare.c description: * Fixed filename bug with uri's * Enable config.debug with dbg:// changeset: 1127:73f4fa3c5dfb user: nibble date: Tue Jun 09 23:46:16 2009 +0200 files: TODO src/io.c src/objects.mk src/rasm/Makefile src/rasm/main.c src/rasm/nasm.c src/rasm/rasm.c src/rtr.c src/utils.c src/utils.h src/visual.c description: * Fixed open (with size) * Fixed wa * Added assembly support for x86_64 using nasm * Added missing headers * Sync TODO changeset: 1126:d9a0f7908acb user: pancake@localhost.localdomain date: Tue Jun 09 15:21:34 2009 +0000 files: TODO src/radare.c src/radiff/bytediff.c src/radiff/main.c description: * Added incomplete -f and -t support for radiff - Allows to specify ranges of offets to bindiff - Needs rewriting to support 64b and the rest of algorithms (not only -b) changeset: 1125:d7fdcc482bc2 user: pancake@localhost.localdomain date: Tue Jun 09 01:41:32 2009 +0000 files: TODO src/cmds.c src/environ.c src/io.c src/plug/hack/analysis/Makefile src/rabin/rabin.c src/radare.c src/rasc/shellcodes.c description: * Do not load io mapped files from rabin when radare runs in debugger mode * Prepare environment in radare_go() * Export segment. flags in the 'segments' flagspace * Some visual fixes for the output of rabin -H * Change ppc.osx.binsh shellcode (smaller one, and tested) changeset: 1124:a80d6db423bf user: pancake@localhost.localdomain date: Sun Jun 07 02:36:48 2009 +0000 files: src/radare.c description: * Add 'radare -' virtual file that loads a writable malloc:// - radare shell :) changeset: 1123:1189e0b5f3fe user: pancake@localhost.localdomain date: Sun Jun 07 02:28:36 2009 +0000 files: TODO src/cmds.c src/io.c src/rabin/dietelf.c src/rabin/dietelf_types.h src/rabin/rabin.c src/rio.h description: * Added 3rd arg to the 'o' command (specify size) * Rabin exports size of segments changeset: 1122:2c54c6315f60 user: pancake@localhost.localdomain date: Sun Jun 07 02:09:18 2009 +0000 files: src/cmds.c src/config.c src/io.c src/rabin/Makefile src/rabin/dietelf.c src/rabin/dietelf_types.h src/rabin/rabin.c src/radare.c src/rio.h src/section.c src/visual.c description: * Added support for delta argument for 'o' command - Show delta in io_list - Allows to map sections of files in random addresses - Fix sort order of io_maps * Store flags and type in ph sections of elf - if type is PT_LOAD (2) opens an iomap on virtual address * New cfg.unksize toggles cfg.limit=-1 and file.size=-1 * 's' in visual on static analysis executes the code in the virtual machine - Just a PoC . it doesnt works at all changeset: 1121:84c3a586c612 user: pancake@localhost.localdomain date: Sat Jun 06 23:46:14 2009 +0000 files: src/cmds.c src/grava.c src/radare.c src/readline.c description: * Oops. Fix radare_cmd_str on !w32 - regression! * Make ?x 0x... return a hexpair string ruled by asm.bit and cfg.bigendian > ?x 0x44 -> 44 00 00 00 > e asm.bits=64 && e.cfg.bigendian=false * changeset: 1120:313b9c57d71d user: asdfsafd@localhost date: Sat Jun 06 23:07:24 2009 +0200 files: Makefile.acr configure.hook src/dbg/arch/powerpc.c src/dbg/darwin/debug.c src/dbg/libps2fd.h src/dbg/objects.mk description: * Fix build on powerpc-darwin changeset: 1119:5407523f4a13 user: pancake@localhost.localdomain date: Sat Jun 06 21:14:02 2009 +0000 files: README TODO man/radare.1 src/cmds.c src/radare.c src/wscript_build description: * Do not analyze code when file.type == "unk" * Fix build with waf * Minor random changes changeset: 1118:8fea2dae62b5 user: pancake <@youterm.com> date: Fri Jun 05 20:47:37 2009 +0200 files: TODO configure configure.acr doc/xtra/fpu description: * Bump revision to 1.4.1 * Add some more documentation for the FPU registers changeset: 1117:953ebabdfb48 user: nibble date: Fri Jun 05 18:17:45 2009 +0200 files: src/main.c src/rabin.c src/rabin/dietelf.c src/rabin/dietelf_types.h src/rabin/rabin.c src/utils.c description: * Fixed resolve_path * Some work on fixing .data flags debugging ELF changeset: 1116:998a6f6adf15 user: pancake <@youterm.com> date: Wed Jun 03 20:20:27 2009 +0200 files: ChangeLog Makefile.acr description: * Sync Changelog for 1.4 release * Add some more makefile targets in the PHONY list === 1.4 === 2009-06-03 changeset: 1115:674f30c175d6 tag: tip user: pancake <@youterm.com> date: Wed Jun 03 19:06:44 2009 +0200 files: configure configure.acr configure.hook src/radare.c description: * Added 'armv5tejl' to the whitelist of supported debuggers * Upgrade version to 1.4 (release time!) * Fix build for --without-debugger changeset: 1114:1d932c483c28 user: pancake <@youterm.com> date: Wed Jun 03 17:29:54 2009 +0200 files: TODO configure.hook doc/radare.but src/dbg/arch/arm.c src/radare.xml description: * Fix register handling for arm-darwin (debugger finally working!) * Added radare.xml (ldid -Sradare.xml radare) required to run * Added amd64-openbsd into the whitelist of supported debugger platforms * Add documentation in the book for the '=' command and for 'agd' graphs changeset: 1113:07f4ca82e294 user: pancake <@youterm.com> date: Wed Jun 03 14:30:38 2009 +0200 files: doc/radare.but src/plug/io/remote.c description: * Fix rap:// O:) * Added more documentation for radapy and ranal in the book changeset: 1112:f91f0ee71f63 user: nibble date: Wed Jun 03 13:18:00 2009 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h description: * Fixed Elf64_Xword/Elf32_word bug in dietelf changeset: 1111:272d55041b5d user: pancake@localhost.localdomain date: Wed Jun 03 11:31:47 2009 +0000 files: TODO doc/radare.but src/dbg/darwin/debug.c src/plug/io/remote.c description: * Implement rap:// URI handling in remote IO plugin * Added python documentation for radapy in the book * Fix argv access for darwin debugger changeset: 1110:d72ef39bdf45 user: pancake@localhost.localdomain date: Wed Jun 03 09:20:46 2009 +0000 files: TODO src/arch/x86/udis86/syn-att.c src/arch/x86/udis86/syn-intel.c src/arch/x86/udis86/syn-pseudo.c src/cons.c src/dbg/win32/debug.c src/flags.c src/rabin/javasm.c src/rabin/rabin.c description: * Fix negative indexed operands disassembly with udis86 - Fixes intel, att and pseudo backends * Fix random segfault in w32 debugger - The problem was in !maps code * Make .class files be recognized by rabin again - javasm -> rsc javasm - Fix flag names (match sym. and cp.) changeset: 1109:9b4d6b5acd4f user: pancake@localhost.localdomain date: Mon Jun 01 20:00:54 2009 +0000 files: TODO configure.hook doc/radare.but src/code.c src/config.c src/cons.c src/dbg/debug.c src/dbg/win32/debug.c src/dbg/win32/utils.c src/print.c src/radare.c src/visual.c description: * Fix console issues and radare_cmd_str for w32 - Not very tested, but debugger is working again * Fix a segfault with a printf (uninitialized variable??) * Use more cons_strcat instead of cons_printf changeset: 1108:7eb182c831ae user: nibble date: Mon Jun 01 10:04:25 2009 +0200 files: src/plug/io/remote.c description: * More work in rap:// changeset: 1107:b8a4913e9c52 user: nibble date: Sun May 31 23:37:53 2009 +0200 files: src/plug/io/remote.c description: * Fixed rap:// segfault executing commands with no output changeset: 1106:38dd7c585612 parent: 1105:62ea4d3c3b1b parent: 1104:659a1163152b user: pancake@localhost.localdomain date: Sun May 31 22:19:04 2009 +0000 files: src/plug/io/remote.c description: * Merge heads O:) changeset: 1105:62ea4d3c3b1b parent: 1103:f945021c25e7 user: pancake@localhost.localdomain date: Sun May 31 22:18:39 2009 +0000 files: Makefile.acr scripts/radapy-example.py scripts/radapy.py scripts/standalone.py src/plug/hack/analysis/ranal.py src/plug/hack/analysis/test.py src/plug/hack/radare.py src/plug/io/remote.c description: * Install radapy API - It's a bit hacky, but scripts/standalone shows a way to wrap the use of radare API from the shell connecting to a remote radare. - Added _eof handler in RapServer() - Fix in RAP_CMD command changeset: 1104:659a1163152b user: nibble date: Sun May 31 21:01:30 2009 +0200 files: src/plug/io/remote.c src/rtr.c description: * Minor fixups in rtr and rap changeset: 1103:f945021c25e7 user: pancake@localhost.localdomain date: Sun May 31 20:01:59 2009 +0000 files: scripts/client.py scripts/radapy-example.py scripts/radapy.py scripts/radapy_bochs.py scripts/radapy_client.py description: * Refactor server api of radare python - Adapt bochs and test examples changeset: 1102:72cc714f819f user: pancake@localhost.localdomain date: Sun May 31 19:51:16 2009 +0000 files: scripts/client.py scripts/radapy.py src/plug/io/remote.c src/rtr.c src/socket.h description: * Implement remote write command * Initial working implementation of the remote protocol python api - Added test program - r_cmd returns 4 byte int instead of 8 changeset: 1101:98f615ff9626 user: nibble date: Sun May 31 19:46:59 2009 +0200 files: src/rtr.c src/socket.c src/socket.h description: * Added udp:// support to '=' changeset: 1100:8ae811b3a63f user: nibble date: Sun May 31 19:28:47 2009 +0200 files: src/rtr.c src/rtr.h description: * More work on '=' - Added tcp:// support - Minor fixups in =< changeset: 1099:5461580c0623 user: pancake@localhost.localdomain date: Sun May 31 17:44:29 2009 +0000 files: src/cmds.c src/rtr.c description: * Added '=<' command - Simplify =? message changeset: 1098:a9cafb4305eb user: nibble date: Sun May 31 12:44:51 2009 +0200 files: src/rtr.c description: * '=+' now uses rap:// by default changeset: 1097:159ea7093f6e user: nibble date: Sat May 30 23:59:11 2009 +0200 files: src/cmds.c src/rtr.c description: * Command '=' - Added ==[fd] for getting "remote prompt" - More verbose errors - Minor fixups changeset: 1096:8142ee02d507 user: nibble date: Sat May 30 22:15:05 2009 +0200 files: src/cmds.c src/cmds.h src/objects.mk src/plug/io/remote.c src/rtr.c src/rtr.h description: * Added cmd '=' to send cmd to remote radares - Init a radare server executing 'radare listen://:port' - Add hosts with '=+ rap://host:port/file/' - Use '=[fd] cmd' to send a cmd to the specified host changeset: 1095:a3c53de86e5d user: pancake@localhost.localdomain date: Sat May 30 16:07:50 2009 +0000 files: src/dbg/mem.c src/rabin/dietmach0_utils.c description: * Apply patches reported by Frank Wille to fix build on NetBSD changeset: 1094:468374db8d5b user: nibble date: Fri May 29 17:13:04 2009 +0200 files: src/plug/io/remote.c description: * Fixed remote plugin changeset: 1093:d8f40620a3dc user: pancake@localhost.localdomain date: Fri May 29 12:31:39 2009 +0000 files: Makefile.acr TODO doc/radare.but scripts/standalone.py src/data.c src/data.h src/plug/hack/radare.py vala/Makefile vala/api/inout.vala vala/api/io.vala vala/inout.c vala/inout.h vala/io.c vala/io.h description: * vala/io -> vala/inout to avoid problems with windows io.h * Added scp cmd in w32dist make target * Add documentation for w32 build in the book * Initial test for hijacking python calls to r.cmd() - Will be used to connect to remote radares on standalone python scripts * Added read() disasm() and disasm_ops() funcs in python api * Fix function signature in data.c changeset: 1092:c98beaa28cca user: pancake@localhost.localdomain date: Thu May 28 23:07:03 2009 +0000 files: src/config.c description: * Change plugins directory for w32 changeset: 1091:0e3b0de2783d user: pancake@localhost.localdomain date: Thu May 28 22:59:24 2009 +0000 files: TODO src/arch/x86/dislen.c src/config.c src/config.h src/cons.c src/dbg/arch/i386.c src/dbg/debug.c src/dbg/mem.c src/dbg/objects.mk src/dbg/procs.c src/io.h src/main.h src/plug/io/libgdbwrap/gdbwrapper.c src/plug/io/libgdbwrap/include/gdbwrapper.h src/plug/io/libgdbwrap/interface.c src/plug/io/wii/grecko.c src/rabin/dietmach0_utils.c src/rabin/javasm.c src/radare.c src/radare.h src/rio.h src/types.h src/utils.c src/w32utils.c description: * Fix build for mingw32 - Various random dirty fixes to make w32 port work again - Debugger is actually segfaulting under wine changeset: 1090:9e90a436b0c6 user: nibble date: Thu May 28 15:32:58 2009 +0200 files: src/dbg/debug.c description: * Another fixup in !inject (I hope it's the last one :) changeset: 1089:fb20691255b8 user: nibble date: Thu May 28 15:13:00 2009 +0200 files: src/dbg/debug.c description: * Minor fix in !inject O:) changeset: 1088:c4a5f914a847 user: nibble date: Thu May 28 14:57:27 2009 +0200 files: src/dbg/arch/i386-hack.c src/dbg/arch/x86_64-hack.c src/dbg/debug.c src/dbg/debug.h src/dbg/system.c description: * Remove '!hack 9 ' * Add '!inject ' and generalize code for 32 and 64 bits changeset: 1087:caa8f6d114cf user: nibble date: Thu May 28 13:43:27 2009 +0200 files: src/data.c src/dbg/arch/i386-hack.c src/dbg/arch/x86_64-hack.c src/dbg/arch/x86_64.c src/dbg/debug.c src/rsc/pool/syms-dump description: * Added dbg hack to inject shellcode from file - Usage: !hack 9 * Fixed rsc syms-dump * Fixed Vd changeset: 1086:6f78212aef27 user: pancake@localhost.localdomain date: Thu May 28 10:52:53 2009 +0000 files: TODO configure src/dbg/darwin/debug.c description: * Cleanup TODO * Sync configure with last acr commits (should work fine on netbsd now) * Check if inferior pid is -1 in darwin debugger changeset: 1085:3cf353fa3a24 user: nibble date: Wed May 27 20:35:08 2009 +0200 files: src/arch/ppc/gnudisppc.c src/arch/ppc/ppc-dis.c src/arch/ppc/ppc-opc.c src/code.c src/dbg/arch/x86_64.c src/include/bfd.h src/include/opcode/ppc.h src/objects.mk description: * Fixed syscall related stuff for x86_64 * Added gnu ppc disassembler - It is used when './configure --without-nonfree' changeset: 1084:4ada113b1e98 user: pancake@localhost.localdomain date: Wed May 27 11:35:40 2009 +0000 files: doc/radare.but src/analyze.c src/arch/x86/code.c src/config.c src/io.c src/print.c src/rio.c description: * Added cfg.tzdelta to configure the timezone delta - Used from unix timestamp and windows filetime print formats * Fix an issue related to locked (slow) code analysis progressbar * Added documentation for the internal grep - Also documentate tmp bsize and so changeset: 1083:2786a4950324 user: nibble date: Wed May 27 03:36:47 2009 +0200 files: TODO src/dbg/arch/i386.c src/dbg/arch/x86_64.c src/dbg/mem.c description: * Fixed !mmap (mmap shellcode injection) changeset: 1082:8609bdaf0140 user: nibble date: Wed May 27 02:05:43 2009 +0200 files: libusbsniff/Makefile src/dbg/arch/x86_64.c src/dbg/arch/x86_64.h src/plug/io/mmap.c description: * Fixed mprotect shellcode injection in x86_64 * Fixed libusbsniff build * Fixed mmap:// io plugin changeset: 1081:af482048e72d user: pancake@localhost.localdomain date: Tue May 26 23:56:41 2009 +0000 files: src/config.c src/environ.c src/radare.c src/rsc/pool/monitor description: * Added cfg.session for rsc monitor - Sync rsc monitor script with new filename settings - export MONITOR_SESSION environvar as cfg.session changeset: 1080:cee6c6cc8126 user: pancake@localhost.localdomain date: Tue May 26 23:44:18 2009 +0000 files: src/radare.c src/rsc/pool/monitor description: * Fix rsc monitor - Implement rsc monitor -e to edit scripts - Now are multiline scripts - Fixes related to the cons_flush - Slurp was stripping too many chars - mkdir ~/.radare/monitor at runtime changeset: 1079:fd7c9dad7643 user: pancake@localhost.localdomain date: Tue May 26 23:16:12 2009 +0000 files: Makefile.acr src/radare.c description: * Install ranal API * Warn about the use of '>' and '`' in cmd_str changeset: 1078:9551e95ece5d user: pancake@localhost.localdomain date: Tue May 26 23:05:22 2009 +0000 files: TODO src/cons.c src/grava.c src/main.c src/plug/hack/analysis/ranal.py src/plug/hack/analysis/test.py src/radare.c description: * Keep cons_buffer contents in radare_cmd_str - agd is now working from language bindings - no way to use pipes or escaped commands from lang binds * Fix ranal make_png() changeset: 1077:dfb9c8d37359 user: pancake <@youterm.com> date: Tue May 26 20:26:39 2009 +0200 files: libusbsniff/libusbsniff.c src/arch/ppc/ppc_disasm.c src/arch/ppc/ppc_disasm.h src/code.c description: * Keep ppc disasm code without the endian argument * Fix build of libusbsniff on ubuntu (:?) changeset: 1076:5669c9a95f98 user: pancake@localhost.localdomain date: Mon May 25 22:28:08 2009 +0000 files: src/dbg/objects.mk description: * mips->mips64 changeset: 1075:6098ed50398b user: pancake@localhost.localdomain date: Mon May 25 22:27:25 2009 +0000 files: src/cons.c description: * Fix FreeBSD build (thanks debian farm!) changeset: 1074:9fdec49d88a6 user: a@localhost date: Mon May 25 22:38:05 2009 -0400 files: src/dbg/objects.mk description: * Fix mipsel arch translation for debugger objects changeset: 1073:7fb0d4ac6f91 user: pancake <@youterm.com> date: Mon May 25 20:08:08 2009 +0200 files: configure configure.hook description: * Update acr fixing configure.hook order issue --without-debugger flag was ignored changeset: 1072:0992ef40f50c user: pancake <@youterm.com> date: Mon May 25 19:48:35 2009 +0200 files: configure.hook description: * Added armelv5tel-linux archos pair in the whitelist for debugger support changeset: 1071:7f7541d17ce0 user: pancake <@youterm.com> date: Mon May 25 11:46:26 2009 +0200 files: doc/radare.but description: * Documentate the /P command in the book changeset: 1070:b2962ab59b35 user: pancake@localhost.localdomain date: Mon May 25 10:45:49 2009 +0000 files: TODO doc/radare.but src/config.c src/grava.c src/rsc/pool/idc2rdb src/trace.c description: * Some more random words for the book - Update some commands and help msgs (p, pm..) * Added graph.traces to colorize traced nodes in graphviz - Used also for grava graphs (gtk ones) changeset: 1069:7d13ff2f2422 user: pancake@localhost.localdomain date: Sun May 24 23:18:09 2009 +0000 files: src/arch/ppc/ppc_disasm.c src/arch/ppc/ppc_disasm.h src/plug/hack/analysis/ranal.py description: * Upgrade to vdappc 1.5 (Thanks Frank Wille!) - Changelog: Modified license for DSFG compliance changeset: 1068:1c5ea38a1e8b user: pancake@localhost.localdomain date: Sun May 24 23:04:06 2009 +0000 files: TODO src/cmds.c src/cons.c src/grava.c src/plug/hack/analysis/ranal.py src/plug/hack/analysis/test.py src/radare.c src/rsc/pool/Display src/rsc/pool/asm src/rsc/pool/core src/rsc/pool/dasm src/rsc/pool/move src/rsc/pool/rfile src/rsc/pool/syms src/rsc/pool/xtrace src/vm.c wscript description: * agd and agdv now accepts filename argument (instead of using pipe) - maybe unnecessary :? * graphviz fontsize=8 * More enhacements for the python code analysis api - Added Opcode and Graph classes * Fix Debian bug #530178 (unbashism) - http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=530178 * waf install for python2.6 api changeset: 1067:60cc298fd950 user: pancake@localhost.localdomain date: Sun May 24 18:51:48 2009 +0000 files: src/cmds.c src/flags.c src/plug/hack/analysis/Makefile src/plug/hack/analysis/h.c src/plug/hack/analysis/ranal.py src/plug/hack/analysis/test.py src/plug/hack/radare.py src/print.c src/print.h src/radare.c src/rsc/pool/idc2rdb description: * Fix vaddr issue in code xrefs * Fix output of flag list * Lot of new stuff for the analysis python api - Functions, BasicBlocks, Comments, CodeXrefs, DataXrefs, Sections - analyze code and add/remove comments - import IDC file with idc_import() method - uses 'rsc idc2rdb' * pX is now a new print format (FMT_HEXPAIRS) - show hexpair string with no spaces and no colors - nice for parsing changeset: 1066:4bb64591e065 user: pancake@localhost.localdomain date: Sun May 24 14:00:52 2009 +0000 files: Makefile.acr src/cmds.c src/cons.c src/plug/hack/analysis/Makefile src/plug/hack/analysis/ranal.py src/plug/hack/analysis/test.py src/plug/hack/python.c src/plug/hack/radare.py src/radare.c src/radare.h description: * Install radare api properly for python 2.6 * 'q' command accepts a numeric argument (exit value) - Sync python api quit() accepts a number - Backport from r2 * Fix a radare_cmd_str() problem related to cons_grep - Implement grepcolumns in cons_grepbuf() when grepline is enabled * Initial import of the 'ranal' api - Simple, but powerful code analysis API for python - Easy to parse. will be used as a template to generate bindings for perl, lua, ruby, ... and other dynamic languages - Comes with a makefile and a test.py as an example of use - r.cmd() now chops the last \n changeset: 1065:4dc32ef1ad54 user: nibble date: Sat May 23 20:24:48 2009 +0200 files: src/analyze.c description: * Another minor fix in analysis O:-) changeset: 1064:ce1fb726c7d3 user: nibble date: Sat May 23 19:26:21 2009 +0200 files: src/analyze.c src/cmds.c src/grava.c src/rdb.c description: * Minor fixup in agd changeset: 1063:64cbd70888b0 user: nibble date: Sat May 23 15:00:10 2009 +0200 files: src/arch/x86/code.c src/grava.c description: * Fixed graph plotting for graph.depth > 20 changeset: 1062:2b4a03af52a3 user: nibble date: Fri May 22 18:19:55 2009 +0200 files: src/analyze.c src/cmds.c src/grava.c src/rdb.c description: * More work on 'graph.split = true' changeset: 1061:617f09f94c0a user: pancake <@youterm.com> date: Fri May 22 14:35:23 2009 +0200 files: src/cmds.c src/radare.c src/radare.h description: * Added 'cX' command to compare like 'cc' does but using two side hexdiff dump format * Added help for /P command changeset: 1060:bec160844033 user: nibble date: Fri May 22 14:04:11 2009 +0200 files: TODO src/print.c description: * Specify pointer & data size in pm with % - eg: pm %2x for 16 bits hex changeset: 1059:f6250c932444 user: pancake <@youterm.com> date: Fri May 22 12:57:18 2009 +0200 files: src/cmds.c src/config.c src/grava.c description: * Fix build O:) * Add graph.weight (false by default) changeset: 1058:ab7347540e78 user: pancake@localhost.localdomain date: Fri May 22 10:32:33 2009 +0000 files: TODO src/cmds.c src/rdb.c src/readline.c src/search.c description: * Fix 'c' command (missing radare_read(0)) * Added /P search command that searchs for proximity in bytelevel distance - Will search a block of blocksize bytes matching at least 'arg' bytes against the current seek * Added more 'ag' and 'gu' commands to readline autocompletion. changeset: 1057:103708800675 user: pancake@localhost.localdomain date: Thu May 21 23:21:39 2009 +0000 files: TODO src/analyze.c src/code.c src/config.c src/data.c src/data.h src/dbg/arch/i386.c src/dbg/bp.c src/dbg/mem.c src/grava.c src/radare.c src/utils.c src/utils.h description: * Set font size for graphviz graphs to 10pt * Implement the temporally block size for @@ iterator * Added 'asm.linescall' option to draw or not lines on call instructions - It's visually cleaner - asm.linesout = true by default now * A bit of investigation on !mmap makes me think that we have to inject a mmap2 syscall * Fix the lost of flags when unsetting breakpoints * Added file_size() helper changeset: 1056:2e6dfff0a57c user: pancake <@youterm.com> date: Thu May 21 20:25:57 2009 +0200 files: src/dbg/events.c description: * Fix build of debugger for non-linux systems changeset: 1055:ba695bb2e0e3 user: nibble date: Thu May 21 19:57:58 2009 +0200 files: src/analyze.c description: * Fixed code analysis at startup changeset: 1054:a6bda99514a4 user: nibble date: Thu May 21 19:44:00 2009 +0200 files: src/analyze.c src/arch/x86/code.c src/cmds.c src/rdb.c description: * More work in graphs (graph.split = true) * Fixups in x86 code analysis changeset: 1053:5c4874e5be74 user: pancake@localhost.localdomain date: Thu May 21 15:38:58 2009 +0000 files: configure description: * Sync with acr-0.7.2-hg (fix acrhook issue on BSD) changeset: 1052:623c9c989484 user: nibble date: Thu May 21 13:27:50 2009 +0200 files: src/analyze.c src/arch/x86/code.c src/cmds.c description: * Fixed basic block detection * agvd uses asm.profile = simple changeset: 1051:f66213dbd390 user: pancake <@youterm.com> date: Thu May 21 11:39:12 2009 +0200 files: src/cmds.c src/config.c src/grava.c src/radare.c src/utils.h description: * Remove .file.png and .file.dot in adgv and gudv commands - Added graph.bgcolor (only for graphviz commands: adgv and gudv) * Added 'weight' edge property (for testing with graphviz) - Add bounding parentessis around ABS() macro * Move cons_flush() inside radare_cmd_str() changeset: 1050:f40aa263a5c0 user: pancake@localhost.localdomain date: Thu May 21 10:15:43 2009 +0000 files: src/rsc/pool/view description: * Missing 'rsc view' Oops changeset: 1049:96a2fba4c474 user: pancake@localhost.localdomain date: Thu May 21 10:10:46 2009 +0000 files: TODO configure configure.acr configure.hook src/cmds.c src/grava.c description: * Added acr hook (configure.hook) helper to autodetect if the current os/arch pair supports native debugger. - This will be helpful for the Debian build farm - We need more testing and register more pairs * Added agdv and gudv commands to display and view a dot graph - Launches dot and rsc view to display the picture with gqview, eog, ... * Colorize true/false node edges in the graphviz output for agd changeset: 1048:1db8d544909e user: pancake@localhost.localdomain date: Thu May 21 00:06:21 2009 +0000 files: TODO scripts/dotgraph scripts/gun-demo src/cmds.c src/grava.c src/utils.h description: * Added dotgraph example script $ radare -d ls < scripts/dotgraph * Added rsc view to open an image view program * New command agd* (like old ag.) - agd fills the nodes with the disassembly - Properly generate the graph in dot format - Same work for 'gud' command * pX is an alias for p1 * Added ABS() macro in utils.h changeset: 1047:09c795474aea user: pancake@localhost.localdomain date: Wed May 20 10:10:57 2009 +0000 files: TODO src/data.c src/macros.c src/utils.c tests/chk/armasm.sh description: * data_prev now works with >= and <= * Fix set0word helper and the call from macro (again(R)) * Added a testcase for the arm assembler changeset: 1046:3daf8d21c094 user: pancake@localhost.localdomain date: Tue May 19 23:05:22 2009 +0000 files: src/cons.c src/radare.c description: * Hacky fix for a segfault in cons - Reproduced while scrolling with 'Veljjjjjjjjj' changeset: 1045:ed3ba99d8537 user: pancake@localhost.localdomain date: Tue May 19 22:44:20 2009 +0000 files: TODO src/b64.c src/config.c src/grava.c src/objects.mk src/print.c src/print.h src/wscript_build description: * Added base 64 print formats (p6 = encode , p9 = decode) * Fix build of ugraph for --without-gui - Thanks sre! * Some changes in 'pm' - e = little endian, E = big endian - 1,2,4,8 - change pointer size (not yet implemented, but parsed) - Added D for double changeset: 1044:f00bdd18bde4 user: pancake <@youterm.com> date: Tue May 19 19:41:34 2009 +0200 files: src/code.c src/print.c description: * Refactoring of the p1,p2,p4,p8 print commands - p8 is now p1!!! * Use NONFREE in code.c changeset: 1043:5ee0ab64b30c user: pancake <@youterm.com> date: Tue May 19 13:37:13 2009 +0200 files: src/cmds.c src/config.c description: * Added ?s sequence command to generate seqences of numbers: ?s 0 10 2 -> 0 2 4 6 8 10 * Added asm.bits with hacky sync with asm.arch for intel and arm - Hacky backport from r2 changeset: 1042:853812a2b207 user: pancake@localhost.localdomain date: Tue May 19 11:40:20 2009 +0000 files: TODO src/cmds.c src/config.c src/flags.c src/main.c src/radare.c src/vars.c src/visual.c description: * Added ?q command that acts like ? or ?v but without echo (quite) * Added cfg.vars (instead of messing with cmd.vprompt2) * Added string_flag with -2 mode (fixes sym+delta) - Used from visual prompt and 'fd' * Set cfg.debug when -d is used O_o * Avoid dupped vars in code analysis changeset: 1041:217552f790de user: pancake@localhost.localdomain date: Mon May 18 22:03:37 2009 +0000 files: TODO src/cmds.c src/flags.c src/print.h src/project.c description: * Fix 'fd' command. Oops :/ * Another hacky trick for vaddr * Save/restore 'am' data in project files changeset: 1040:06837ed2bfb1 user: nibble date: Mon May 18 20:39:11 2009 +0200 files: src/cons.c description: * Fixed cons_fitbuf changeset: 1039:0515fbd7c3f2 user: pancake <@youterm.com> date: Mon May 18 18:27:07 2009 +0200 files: src/dbg/objects.mk description: * Added support for mipsel and arm5vtel - Thanks debian build farm :) changeset: 1038:12813030c404 user: pancake@localhost.localdomain date: Mon May 18 10:47:11 2009 +0000 files: TODO src/cmds.c src/config.c src/dbg/open.c src/dbg/system.c src/main.c src/print.c src/print.h src/utils.c src/utils.h description: * Added 'am' command to manage a list of print memory formats - Used from pm [name]. This way you can follow pointers with nested structures and visualize them properly - 'am fmt' acts as an alias for 'pm format' - nested named structures are handled with [] chars - Some fixups in the 'pm' command. * Documentate !regio in !help * Do not change block size in FMT_MEMORY (pm) * Resolve argv[0] path and do not warn when using 'radare -d ls /' - resolve_path moved to utils.c changeset: 1037:35057de7b01a user: pancake@localhost.localdomain date: Sun May 17 22:02:35 2009 +0000 files: src/dbg/debug.h src/dbg/regs.c src/dbg/system.c description: * Added !regio [addr] argument to change the base address where registers are virtually mapped on memory changeset: 1036:6368f2dc1d7b user: pancake@localhost.localdomain date: Sun May 17 20:36:20 2009 +0000 files: TODO src/analyze.c src/cmds.c src/code.c src/data.c src/dbg/debug.c src/dbg/debug.h src/dbg/io.c src/dbg/regs.c src/dbg/system.c src/print.c src/radare.c src/utils.c src/visual.c description: * Fix 'as' command. was broken because !! was hooked previously - as lists structures and as? show help * Use NONFREE in src/data.c to skip including ppc_disasm.h * Added !regio command to abstract 0 address IO as registers read+write - It's cool for things like !contsc open&&pm sxx@0 * Fix pm command (problem related to set0word) - Added ':' format char to skip 4 bytes - Use %08llx everywhere. oops * Fix visual help for 'm' and ''' keys changeset: 1035:d0f5ec9646be user: pancake <@youterm.com> date: Fri May 15 19:49:56 2009 +0200 files: src/rabin/dietelf.c src/rabin/p9bin.h src/rabin/rabin.c src/rabin/rabin.h description: * Very buggy and early implementation for p9bin in rabin - A decent implementation will be done in r_bin for r2 * strings for unknown binaries strip the '+' char in rabin - fixes a problem with flagnames changeset: 1034:58f9bf734842 user: pancake <@youterm.com> date: Fri May 15 12:43:59 2009 +0200 files: src/cmds.c description: * Documentate $$S variable changeset: 1033:2117fb8d7883 user: pancake@localhost.localdomain date: Fri May 15 11:26:21 2009 +0000 files: TODO src/cmds.c src/code.c src/config.h src/environ.c src/flags.c src/radare.c description: * Added syntax sugar for temporally block size - Can be used for @ and @@= * Added help for !!? command (show environ vars exported to shell) * Show *all* flags of a certain offset as comments in branch instructions of the disassembly - Fixes a problem in string_flag * BADDR->VADDR for environment changeset: 1032:ee5db357e373 user: pancake@localhost.localdomain date: Fri May 15 00:50:33 2009 +0000 files: TODO src/config.c src/config.h src/main.c src/radare.c description: * Added support to interpret more than one script with -i changeset: 1031:9664163db3ec user: pancake@localhost.localdomain date: Fri May 15 00:29:43 2009 +0000 files: src/cmds.c src/data.c src/data.h description: * Added 'Cr' command to remove ranges of Code metadata - Cr 4096 @ eip changeset: 1030:dd7c0e61bd0d user: pancake@localhost.localdomain date: Thu May 14 23:55:39 2009 +0000 files: TODO config.mk.acr configure configure.acr global.h.acr src/arch/arm/aasm/Makefile src/code.c src/objects.mk description: * Added --without-nonfree flag in configure to build radare without nonfree sources. This is the case of the powerpc disassembler which doesnt follows the DFSG because doesnt permits modification. - http://en.wikipedia.org/wiki/Debian_Free_Software_Guidelines * Fix SHAREDIR path for aasm (aka armasm) changeset: 1029:c5f97187ad01 user: pancake@localhost.localdomain date: Thu May 14 23:36:04 2009 +0000 files: src/code.c description: * Show comments in jumps/calls depending on asm.flagsall - Good for grepping or regenerating xrefs changeset: 1028:533c4bfbaadb user: pancake@localhost.localdomain date: Thu May 14 23:26:17 2009 +0000 files: TODO src/cmds.c src/radare.c src/radiff/bdiff/bdiff.cpp description: * Fix build of bdiff.cpp * Make 'CC' list all comments - Cx lists all xrefs, like CX .. no need to C*~Cx now :) * Fix '"' for some commands like '!' * Added ?i command to query user for u64 input - Result of the evaluation is stored in $$? var - Useful for macros with user-defined configurations changeset: 1027:fc4ae945910a user: pancake@localhost.localdomain date: Thu May 14 12:59:03 2009 +0000 files: TODO doc/fortunes src/analyze.c src/code.c src/flags.c description: * Added some more fortune messages * analyze_progress() is now faster and cleaner changeset: 1026:da320ffe877e user: pancake@localhost.localdomain date: Wed May 13 23:25:03 2009 +0000 files: src/radare.c description: * Keep user defined block size in radare_go() changeset: 1025:259dfa6fa24a user: pancake@localhost.localdomain date: Wed May 13 23:16:13 2009 +0000 files: TODO src/cmds.c src/code.c src/config.c src/environ.c src/main.c src/radare.c description: * Fix a problem related to disassembly parsing due the value of cfg.verbose * Fix config.debug, config.verbose and config.color values to change properly * Warn if trying to use -i twice * flagspace push/pop while calling radare_cmd in interpret * Call env_update and enclose config.script code better changeset: 1024:65f6fec9d79a user: pancake <@youterm.com> date: Wed May 13 18:02:22 2009 +0200 files: src/plug/hack/python.c description: * Import namespaces 'r' and 'radare' into the locals python shell changeset: 1023:dd02688a7a94 user: pancake <@youterm.com> date: Wed May 13 14:44:53 2009 +0200 files: src/plug/hack/python.c description: * Use 'import code;code.interact()' as a default interactive python shell * Code cleanup for the python plugin changeset: 1022:00567ca54391 user: pancake@flubox date: Wed May 13 13:03:02 2009 +0200 files: src/cons.c src/dbg/arch/arm-darwin.h src/dbg/arch/arm-linux.h src/dbg/arch/arm.c vala/widget.c description: * Fix build for arm-linux * Workaround to build the graphs with gtk2.4 * Do not fit width when panning horitzontally changeset: 1021:9cafb675f261 user: pancake@localhost.localdomain date: Wed May 13 11:08:07 2009 +0000 files: src/cons.c src/cons.h src/plug/hack/python.c src/visual.c description: * Added cons_skipxy() function to chop and pan screen boundaries - Small terminals are no longer a restriction :) - scr.fit is now handling the panning (cols and rows) - Configurable with the '(){}' keys (together with []) * Show the visual help unbuffered (we want all the help :) changeset: 1020:a361ba6fa0e9 user: pancake@localhost.localdomain date: Tue May 12 23:47:08 2009 +0000 files: src/dbg/debug.c description: * Remove unnecessary hack for threads * NOTE: previous commit has set contscbt to false by default (cleaner output) changeset: 1019:6e5f45f911be user: pancake@localhost.localdomain date: Tue May 12 23:43:54 2009 +0000 files: src/config.c src/dbg/debug.c src/dbg/events.c src/dbg/io.c src/dbg/thread.c src/dbg/unix/debug.c description: * set OPTIONS at every process and thread while changing - dbg.forks or dbg.threads - change PTRACE_O stuff (only for linux >= 2.5.x * Better messages for Linux's ptrace event messages * Fixes the problems while debugging applications with multiple threads changeset: 1018:4190eb8e8197 user: pancake@localhost.localdomain date: Tue May 12 22:30:16 2009 +0000 files: src/analyze.c src/config.c src/config.h src/cons.c src/dbg/fd.c src/dbg/system.c src/dbg/unix/debug.c src/main.c src/print.c src/radare.c src/visual.c description: * Added scr.fit config attribute to fit the data in screen in visual - make clean required * Fix some zero divisions * Implement ansistrlen and ansistrchrn helper functions - Used for scr.fit code to properly count the width of ansi strings * Fix !fd format. Oops O:) * Added search.limit for s/ and s\ commands. (default=0) * Another fix for flushable in visual changeset: 1017:f112f7622321 user: pancake@localhost.localdomain date: Tue May 12 08:31:01 2009 +0000 files: src/cons.c src/plug/hack/Makefile description: * Implement internal grepword for cons_grepbuf * Install python26.so module changeset: 1016:ee3e93575672 user: pancake@localhost.localdomain date: Mon May 11 23:31:26 2009 +0000 files: src/visual.c description: * Fix V: with flushit() changeset: 1015:2978c8b9b91c user: pancake@localhost.localdomain date: Mon May 11 23:25:42 2009 +0000 files: src/config.c src/cons.c src/flags.c src/visual.c description: * Fix visual refreshes using cons_flushit() - Oops O:) changeset: 1014:0555cb5e0695 user: pancake@localhost.localdomain date: Mon May 11 23:15:13 2009 +0000 files: doc/radare.but src/cmds.c src/cons.c src/cons.h src/plug/hack/Makefile src/rabin/rabin.c src/radare.c src/utils.c src/visual.c description: * Fixes in the book for the forum appendixes * Do not show noisy error messages * Added pseudo ultrahacky implementation of doublebuffering in cons.c - Mostly reimplemented fix for grepping buffers - Fixes the bug of r.cmd("f~map") in python (inline grep for language bindings) * Add support to build plugin for python 2.6 * Fix build of dietpe changeset: 1013:f9335a3b7f0a user: nibble date: Tue May 12 00:02:14 2009 +0200 files: doc/fortunes src/dbg/debug.c src/dbg/io.c src/radare.c description: * Fixed 'e dbg.bep = ...' and 'radare -s ...' changeset: 1012:1f60aa357fba user: pancake <@youterm.com> date: Thu May 07 14:42:06 2009 +0200 files: doc/radare.but description: * Import interesting posts from the forum to the book changeset: 1011:7e61e431e2ac user: pancake@localhost.localdomain date: Thu May 07 13:41:30 2009 +0000 files: TODO src/analyze.c src/rabin/dietmach0_utils.c src/rabin/rabin.c src/rsc/pool/syms-dump description: * FIX: Clean lastlen chars in the codeanalysis progressbar * Fix rabin -o d/s for 0length symbols - Remove some debug printfs in rabin * rsc syms-dump (without spaces between hexpairs) changeset: 1010:10bbd5329546 user: pancake@localhost.localdomain date: Wed May 06 11:34:08 2009 +0000 files: TODO src/analyze.c src/config.c src/data.c src/grava.c src/macros.c src/utils.c description: * Fix str0word helper (strings ending with ' ' return one more word) * Only cleanup the chars needed in the code analysis progress bar * Added graph.userdup config var - 'gu' command do not create dupped nodes by default * Fix 'gud' (print in dot format) * Verboser macro call errors changeset: 1009:6d849888c816 user: pancake@localhost.localdomain date: Tue May 05 23:32:37 2009 +0000 files: TODO src/cmds.c src/cons.c src/grava.c src/print.c src/radare.c description: * Added 'gud' to dump user graph in dot format * Fix cons_yesno() for uppercase 'Y' key O:) * Fix pipe_command_to_string() for null strings - Fixes a bug introduced after a change in a previous commit * Update 'todo' file changeset: 1008:1f89cce50cc1 user: pancake@localhost.localdomain date: Mon May 04 22:38:11 2009 +0000 files: src/analyze.c src/rabin/Makefile src/rabin/dietmach0.c src/rabin/rabin.c description: * Fix malloc issue related to arm code analysis loop * Set asm.arch from rabin for mach0 binaries * Fix %% parsing in rabin -z for mach0 * Remove dietpe64.o in make clean changeset: 1007:3a8c1c554e81 user: pancake@localhost.localdomain date: Mon May 04 21:58:02 2009 +0000 files: src/arch/arm/aasm/Makefile description: * Use -fnested-functions on osx (fix aasm build) changeset: 1006:02fd870dae4b user: pancake@localhost.localdomain date: Mon May 04 21:55:25 2009 +0000 files: src/dbg/Makefile src/dbg/arch/arm-bp.c src/dbg/arch/arm-darwin.h src/dbg/arch/arm-linux.h src/dbg/arch/arm.c src/dbg/arch/arm.h src/dbg/arch/i386.c src/dbg/darwin/debug.c src/dbg/regs.h src/plug/io/gdbwrap.c src/rabin/Makefile src/rabin/dietmach0.h description: * Fix build of osx-arm debugger - Not yet working but all the pieces are matching now :) changeset: 1005:a9aaf3e8d350 user: pancake@localhost.localdomain date: Mon May 04 15:12:35 2009 +0000 files: src/rabin/dietmach0.c src/rabin/dietmach0.h src/rabin/dietmach0_utils.c description: * Quick hack in-place (ipod) to make rabin -S work natively - Fixes a strange bug related to the use of lseek/mmap changeset: 1004:2d970eafa285 user: pancake@localhost.localdomain date: Sun May 03 23:56:41 2009 +0000 files: src/rabin/dietmach0.c src/rabin/rabin.c description: * Set asm.arch in -r for dietmach0 * Hacky way to make strings work on not supported binaries (!ELF&&!PE) changeset: 1003:e95b7d962b79 user: pancake@localhost.localdomain date: Sun May 03 23:04:24 2009 +0000 files: src/rabin/Makefile src/rabin/dietmach0.c src/rabin/dietmach0.h src/rabin/dietmach0_utils.c description: * Added support for mach0-powerpc binaries - Fix endian issues while reading mach0 headers - Minor protection against some overflow bugs changeset: 1002:116dc25523f7 user: pancake@localhost.localdomain date: Sun May 03 18:27:59 2009 +0000 files: src/rabin/dietmach0.c src/rabin/rabin.c src/rio.c description: * Set io.paddr = 0x1000 for mach0-arm binaries - rio layer substracts io.paddr from seekable address * Added rabin -e for mach0 binaries * Flag registers in mach0 binaries - Added support for ARM (iphone) and I386 changeset: 1001:c3126e16fd4b user: pancake@localhost.localdomain date: Sun May 03 17:45:53 2009 +0000 files: config.mk.acr src/radare.c src/radiff/bdiff/Makefile src/vm.c description: * Build bdiff only if c++ compiler is found * Fix vm eval strings [foo+var] * Allow ^C in /z string search changeset: 1000:52d92956c419 user: pancake@localhost.localdomain date: Sun May 03 17:09:12 2009 +0000 files: configure configure.acr doc/radare.but src/binparse.c src/bytepat.c src/cons.c src/rabin/dietmach0.c src/rabin/rabin.c src/radare.c src/rsc/pool/sign src/search.c src/vm.c description: * Some segfault fixups in the search engine - Yeah, ugly patches for ugly bugs * Fix build for OSX (at least for ipod touch) with configure * rabin with mach0 shows proper flag names for sections. * Fix /z (oops with search.inar) O:) * Fix /: command (slower than before, but working properly :) - Nice for searching code signatures * Fix a syntax issue in vm_eval related to spaces - Use strbcpy changeset: 999:4617c2edf153 user: nibble date: Fri May 01 23:32:27 2009 +0200 files: src/rabin/rabin.c description: * Minor fixup in '-o d/S/...' output changeset: 998:8a6fe56c0199 user: nibble date: Fri May 01 23:26:23 2009 +0200 files: src/rabin/rabin.c description: * Added '-o d/S/' into rabin to dump sections changeset: 997:f319a628a53b user: pancake@localhost.localdomain date: Fri May 01 17:22:04 2009 +0000 files: src/binparse.c src/cmds.c src/rsc/pool/sign src/rsc/pool/syms-dump src/search.c description: * Added /: command to search keyword files like in rabin -o d/s or rsc syms-dump format * Added help for /.? and /:? changeset: 996:68b7959dfa97 user: pancake@localhost.localdomain date: Fri May 01 16:38:14 2009 +0000 files: src/config.c src/rsc/pool/sign src/search.c description: * Added search.flagname changeset: 995:72131e6141d7 user: nibble date: Fri May 01 17:23:49 2009 +0200 files: src/rabin/rabin.c description: * rabin -o d/s uses symbol size as default length changeset: 994:66a338e7019e user: pancake@localhost.localdomain date: Fri May 01 16:09:22 2009 +0000 files: src/code.c src/rabin/rabin.c description: * Fix segfault with -o d/s * Fix a bug in length of symbols * Remove unused code changeset: 993:003daee90fb0 user: nibble date: Fri May 01 15:49:06 2009 +0200 files: src/rabin/aux.c src/rabin/aux.h src/rabin/rabin.c src/rabin/rabin.h description: * Added "-o d/s/" into rabin to dump symbols changeset: 992:7422f0bcd1c4 user: nibble date: Fri May 01 02:03:10 2009 +0200 files: src/rasm/wscript_build src/wscript_build wscript description: * Fixed waf build changeset: 991:e74091ec8b0d user: nibble date: Fri May 01 01:36:21 2009 +0200 files: src/rabin/dietpe.c description: * Fixed imports bug in dietpe changeset: 990:e216874bfdf0 user: pancake@localhost.localdomain date: Thu Apr 30 23:38:30 2009 +0000 files: src/analyze.c src/radare.c src/rsc/pool/syms-dump src/utils.c description: * Fix syms-dump again O:) * Fix strbcpy helper and get_offset() issue changeset: 989:8c7fc1e394ac parent: 988:996aaeccdd43 parent: 983:88ec88901097 user: pancake@localhost.localdomain date: Thu Apr 30 19:09:04 2009 +0000 description: * Merge heads changeset: 988:996aaeccdd43 user: pancake <@youterm.com> date: Thu Apr 30 16:24:37 2009 +0200 files: src/cmds.c description: * Fix asm.xrefs related issue (thx graz for the bug report) changeset: 987:e09c1be356e7 user: pancake <@youterm.com> date: Thu Apr 30 14:29:32 2009 +0200 files: src/analyze.c src/arch/x86/code.c src/arch/x86/dislen.c src/code.c src/config.c src/flags.c src/radare.c src/utils.c description: * Lot of valgrind warn fixups in code analysis code and related - Implement strbcpy to make a non-optimized string copy * Data analysis not enabled by default (sometimes segfaults) - Can be enabled with 'e file.analdata=true' * Detect [ebp-num] as local var accesses on x86 changeset: 986:4da8e66bd61d user: pancake@localhost.localdomain date: Thu Apr 30 10:20:52 2009 +0000 files: src/analyze.c src/cmds.c src/cons.c src/radare.c src/radare.h src/utils.c description: * Fix analyze_function vaddr problem when using recursive analysis - afr fixed * Analyze entrypoint looking for the 'main' pointer * Hide the 'unbalanced ]' error changeset: 985:6dd70fdcaffc user: pancake@localhost.localdomain date: Thu Apr 30 08:30:19 2009 +0000 files: src/analyze.c src/cmds.c src/rabin/dietpe.c src/radare.c description: * Fix recursivity problem with 'afr' command - Code analysis is now much more complete - Ignore ultra-huge function sizes detected (bug in code analysis limits) * Fix import symbol names from dietpe - Just a workaround to avoid having silly names changeset: 984:73d877f531e5 parent: 982:67d21a9adb83 user: pancake@localhost.localdomain date: Thu Apr 30 01:23:04 2009 +0000 files: src/analyze.c description: * Drop r_prof code and reduce framerate for code analysis pgbar to 10 changeset: 983:88ec88901097 user: pancake@localhost.localdomain date: Thu Apr 30 01:11:20 2009 +0000 files: src/analyze.c description: * Drop profiling code from analyze.c - Show analysis progress at first time changeset: 982:67d21a9adb83 user: pancake@localhost.localdomain date: Thu Apr 30 01:02:44 2009 +0000 files: doc/fortunes src/analyze.c src/cmds.c src/data.c src/flags.c src/rabin.c src/rabin/rabin.c src/radare.c src/rax.c src/vars.c description: * Lot of nice enhacements for the code analysis visualization - Console messages are now cleaner when loading the file - Code analysis shows a nice asciiart progressbar - Make ^C work for @@ commands like the one used for code analysis * Fix order of arguments for Cx and CX commands - Code analysis and rabin now uses this format properly * Added 'data analysis' (.ad*@section._data)in data section by default * Fix flag_string name resolution * Add some more characters fixups for the flag_string_filter - This function needs more love :) * Count strings in Ci changeset: 981:568a3f7ce3d9 user: pancake@localhost.localdomain date: Wed Apr 29 00:40:35 2009 +0000 files: doc/fortunes src/cmds.c src/io.c src/io.h src/utils.c tests/chk/rax.sh description: * Added 'aos' command (returns the size of N opcodes from $$) * Added ?v to show the hex value of a math expression * Added $$w to get the last write size * Added test for rax bin2hex/hex2bin conversion changeset: 980:817f9b0599a1 user: pancake@localhost.localdomain date: Tue Apr 28 21:54:04 2009 +0000 files: src/rsc/pool/syms-dump description: * Fix rsc syms-dump bug changeset: 979:4a6e89d18b13 user: pancake@localhost.localdomain date: Tue Apr 28 10:15:08 2009 +0000 files: src/cmds.c src/objects.mk src/rasm/Makefile src/rasm/main.c src/rasm/rasm.c src/rasm/rasm.h src/rasm/rsc.c src/rasm/x86.c src/undo.c description: * Fix 'sn' and 'sb' commands when current block has changed * Added rasm 'rsc' architecture as a separate module that uses 'rsc' as backend for generating code. - Used as failback for x86 one * Fix order of undo write operation list (u,u*) - Avoid dupped entries in the undo write list changeset: 978:7f76e6d9bd77 user: pancake <@youterm.com> date: Mon Apr 27 19:17:26 2009 +0200 files: src/radare.c src/utils.c src/utils.h src/visual.c description: * Added yf and ytf commands to yank from/to files changeset: 977:4b808a0a557b user: pancake@localhost.localdomain date: Mon Apr 27 15:22:02 2009 +0000 files: src/arch/arm/aasm/wscript_build description: * Use -fnested-functions for waf build on armasm (osx fixup) === 1.3 === 2009-04-25 changeset: 975:5bd2db86a3d2 tag: tip user: pancake@localhost.localdomain date: Sat Apr 25 18:06:29 2009 +0000 files: ChangeLog description: * Sync changelog for 1.3 changeset: 974:1894d528a6c1 user: nibble date: Sat Apr 25 12:29:29 2009 +0200 files: wscript description: * Update radare version in waf changeset: 973:a087b214de1c user: pancake@localhost.localdomain date: Sat Apr 25 11:25:24 2009 +0000 files: configure configure.acr description: * Bump to 1.3 version for inminent release changeset: 972:39e5392558a8 user: nibble date: Sat Apr 25 12:14:31 2009 +0200 files: src/plug/hack/chkruby.rb src/rabin/dietelf.c src/rabin/dietelf_types.h src/rabin/rabin.c description: * Add get_header_fields backport from r2 * Fix ruby build changeset: 971:d1f102985fc1 user: pancake@localhost.localdomain date: Sat Apr 25 10:45:47 2009 +0000 files: src/grava.c src/rasm/x86.c description: * Fix build for --without-gui for the 'gu' command * Fix rasm 'push 0' assemble changeset: 970:b1477f4244ff user: pancake@localhost.localdomain date: Fri Apr 24 10:54:53 2009 +0000 files: src/config.c src/radare.c description: * Fix sign of keyword buffer for s/ and s\ * asm.profile=simple -> scr.color=false changeset: 969:5e149f96ed91 user: pancake@localhost.localdomain date: Thu Apr 23 10:25:25 2009 +0000 files: doc/radare.but src/cmds.c src/grava.c description: * Fix 'wT' command (need a block read before writing) * Some food for the book * Fix segfault when trying to load an empty user graph changeset: 968:d1009499e486 parent: 967:144447b7813a parent: 966:2165df1e40fe user: pancake <@youterm.com> date: Wed Apr 22 21:10:52 2009 +0200 description: * Oops merge :X changeset: 967:144447b7813a parent: 965:b09d8a0237b8 user: pancake <@youterm.com> date: Wed Apr 22 21:10:14 2009 +0200 files: src/cmds.c src/radare.c src/radare.h description: * Initial implementation of the s\ command - Support for backward search+seek for strings and hexpairs changeset: 966:2165df1e40fe user: nibble date: Wed Apr 22 18:53:19 2009 +0200 files: src/arch/arm/aasm/wscript_build src/wscript_build wscript description: * Fixed waf build changeset: 965:b09d8a0237b8 user: pancake <@youterm.com> date: Wed Apr 22 18:26:29 2009 +0200 files: src/cmds.c description: * Added ?e command to echo strings changeset: 964:4eacb651c148 user: pancake <@youterm.com> date: Wed Apr 22 18:19:27 2009 +0200 files: doc/radare.but scripts/gun-demo src/cmds.c src/grava.c vala/widget.c description: * Fix and add support for the 'gu' command - Added scripts/gun-demo - Body of graphs is now filled with commands (not strings) changeset: 963:35fd72ab9a17 user: pancake@localhost.localdomain date: Wed Apr 22 11:24:40 2009 +0000 files: src/analyze.c src/cmds.c src/config.c src/data.c src/data.h src/dbg/bp.c src/dbg/dump.c src/flags.c src/grava.c src/ira/Makefile src/ira/ira-to-c.pl src/rabin/rabin.c src/rabin/rabin.h src/radare.c src/radare.h src/utils.c src/utils.h vala/widget.c wscript description: * Fix graph callbacks * Added 'gu' command to create user-defined graphs - Not yet working, but it is mostly implemented ;) * Added command 'fN' to add eNumerations of flags - Useful for @@= * Added $$S for function size paired with $$F, but from curseek * Use get_math in !bp instead of get_offset * Added dummy rabin -H flag * Fix wscript installation paths for rsc scripts changeset: 962:32a62e72e7f9 user: pancake <@youterm.com> date: Tue Apr 21 19:12:50 2009 +0200 files: src/rdb.c vala/default_layout.c vala/widget.c description: * Comment out some noisy printf's in graphs changeset: 961:cdb825915930 user: pancake <@youterm.com> date: Tue Apr 21 16:35:01 2009 +0200 files: src/cons.c src/plug/io/libgdbwrap/gdbwrapper.c src/plug/io/libgdbwrap/include/revm.h description: * Re-fixup for darwin changeset: 960:859d349aef92 user: pancake <@youterm.com> date: Tue Apr 21 13:43:02 2009 +0200 files: src/cons.c src/plug/io/libgdbwrap/gdbwrapper.c src/plug/io/serial.c description: * Fixes for OSX build (thanks Demonic) * Fixes serial:// IO plugin - Multiple speeds can be used now - Simpler code (needs test) changeset: 959:ca505597b340 user: pancake <@youterm.com> date: Tue Apr 21 12:35:55 2009 +0200 files: src/config.c src/print.c description: * Added scr.bytewidth and make 'pc', 'pb', 'po' and 'px' happy - Fixes a bug in po (lat ascii chars not displayed) changeset: 958:60efd70e50b7 user: pancake@localhost.localdomain date: Tue Apr 21 10:08:10 2009 +0000 files: vala/graph.c vala/renderer.c vala/widget.c description: * More fixes for the graphs changeset: 957:356cf492ee1f user: pancake@localhost.localdomain date: Mon Apr 20 22:56:58 2009 +0000 files: src/grava.c vala/default_layout.c vala/edge.c vala/graph.c vala/layout.c vala/node.c vala/renderer.c vala/shape.c vala/widget.c description: * Sync grava from ragui but layout changeset: 956:af560dd1dc73 user: pancake <@youterm.com> date: Sun Apr 19 22:01:39 2009 +0200 files: src/cons.c src/dbg/arch/powerpc.c description: * Fix build on BSD * Show better error when powerpc cannot get program counter changeset: 955:b624950cbcc3 user: pancake date: Sun Apr 19 23:46:58 2009 -0400 files: gui/Makefile src/dbg/arch/mips64.c description: * Fix build in mips64 - Allow to !reg pc=N as an alias for !jmp * Do not fail install if no gradare found changeset: 954:056c273cf767 user: pancake@localhost.localdomain date: Sun Apr 19 19:39:41 2009 +0000 files: src/cmds.c src/io.c description: * Fix build * Add multi-opcode assembly support with ';' - wa mov eax,33;int 0x80;int3;nop;nop changeset: 953:4289d51d70e1 user: pancake@localhost.localdomain date: Sun Apr 19 19:21:56 2009 +0000 files: src/io.c src/plug/hack/Makefile src/plug/io/libgdbwrap/Makefile src/rsc/main.c description: * Do not build of lua when no liblua found * Make gdbwrap sync verbose * Fix rsc rscdir path and give verboser errors changeset: 952:39ac53aeda96 user: pancake@localhost.localdomain date: Sun Apr 19 19:11:05 2009 +0000 files: src/analyze.c src/cmds.c src/io.c src/macros.c src/main.c src/plug/io/gdbwrap.c src/plug/io/libgdbwrap/gdbwrapper.c src/radare.c description: * Rename '#' command to 'h' (hash) - 'h' is not anymore for help - Fix hashing in debug mode - Remove the hacky #! hashbang > hmd5 instead of #md5 * Do not prepend dbg:// if file uri contains :// * Sync gdbwrap debug/io backend - New commands: cd0, stat, pid, maps, kill, reg= - We can now change the value of registers (not only reading :) - We can also send signals to the process - Some segment registers are now displayed in !reg - A hacky way to view process maps of local processes changeset: 951:6d0ed1ce2865 user: pancake@localhost.localdomain date: Sun Apr 19 17:20:22 2009 +0000 files: src/plug/io/gdbwrap.c src/plug/io/libgdbwrap/client.c src/plug/io/libgdbwrap/gdbwrapper.c src/plug/io/libgdbwrap/include/gdbwrapper-internals.h src/plug/io/libgdbwrap/include/gdbwrapper.h src/plug/io/libgdbwrap/interface.c description: * Sync gdbwrap against eresi's svn changeset: 950:a2ca690b58ff user: pancake@localhost.localdomain date: Sun Apr 19 17:07:59 2009 +0000 files: src/arch/arm/code.c description: * Added support to the arm code analysis to manage 'add' and 'sub' instructions over the 'sp' register to track stackframe size. Hacky solution, but functional :) changeset: 949:7b6f35ccad4a user: pancake@localhost.localdomain date: Sun Apr 19 13:15:34 2009 +0000 files: src/rabin/Makefile description: * Fix build of rabin O:) changeset: 948:020377dce49c user: nibble date: Sun Apr 19 03:26:49 2009 +0200 files: src/rabin/aux.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/dietpe64.c src/rabin/dietpe64.h src/rabin/dietpe_static.h src/rabin/dietpe_types.h src/rabin/pe.h src/rabin/rabin.c src/rabin/wscript_build description: * dietelf - Fixed elf64 issues * dietpe - Added PE32+ (PE64) support - Minor fixups * rabin - Minor fixups changeset: 947:a7683cc859ee user: pancake@localhost.localdomain date: Sat Apr 18 21:47:00 2009 +0000 files: doc/fortunes src/analyze.c src/arch/arm/code.c src/arch/arm/gnudisarm.c src/cmds.c src/code.c src/config.c src/data.c src/vars.c src/visual.c description: * Added asm.xrefsto * Fix static code analysis problems with vaddr and paddr * Added variable analysis support for ARM - Detect store operation on local variables * Fix arm disassembly (hacky -=4 O:-) * Ascii-based stack-operations in 'ao' command * Added dummy '"' command for testing operations on code changeset: 946:1febacf43e44 user: pancake@localhost.localdomain date: Sat Apr 18 18:19:44 2009 +0000 files: src/analyze.c src/arch/arm/code.c src/arch/arm/disarm.c src/arch/arm/disarm.h src/code.c src/data.c description: * More fixups for the ARM code analysis - Fix a regression for certain non-load instructions - Correctly resolve the deltas against 'pc' * XREFs are now displayed at from and dest addresses changeset: 945:0736f700d23f user: pancake@localhost.localdomain date: Sat Apr 18 16:54:47 2009 +0000 files: src/Makefile.acr src/analyze.c src/arch/arm/code.c description: * Fix slowdown bug when doing code analysis for ARM code * Make arm code analysis support the 'ld' instruction following pointers indexed by the 'pc' register, which is the main use of current compilers to load pointers into registers changeset: 944:5378e9e5d8e9 user: nibble date: Fri Apr 17 01:30:35 2009 +0200 files: src/analyze.c description: * Fixed function boundaries detection changeset: 943:9b31357bf3e2 user: pancake@localhost.localdomain date: Thu Apr 16 23:33:18 2009 +0000 files: gui/toolbar.c description: * Apply gradare segfault fix from elektranox - Was segfaulting when loading the manpage changeset: 942:2a171bbfa3f6 user: pancake <@youterm.com> date: Thu Apr 16 18:20:36 2009 +0200 files: src/plug/hack/Makefile description: * Do not LUA_LIBS twice changeset: 941:98fc953eb5c8 user: pancake <@youterm.com> date: Thu Apr 16 16:02:39 2009 +0200 files: src/arch/x86/code.c description: * Fix and simplify code analysis for 'mov' on x86 - Thanks elektranox changeset: 940:067a482efd7d user: pancake <@youterm.com> date: Thu Apr 16 12:46:43 2009 +0200 files: src/arch/x86/code.c description: * Oops . fix code analysis problem in x86 again changeset: 939:b984fca7b3bf user: pancake <@youterm.com> date: Thu Apr 16 11:57:15 2009 +0200 files: src/project.c description: * Oops fix build changeset: 938:dff4eb1169cf user: pancake@localhost.localdomain date: Thu Apr 16 10:15:04 2009 +0000 files: src/analyze.c src/cmds.c src/code.c src/data.c src/data.h src/flags.c src/radare.c src/vars.c description: * Simplify message information in code analysis using singlechars instead of noisy long messages * Fix the problem of inner greps with CF, Cs, ... commands - Now the grep is handled natively by the data_*_list() functions * Fix string_flag_offset issue in disassembly that makes opcode data references not being recognized while doing static analysis * Fix bug in `` inside commands. - Newlines are now translated into spaces ' '. - Make @@= foreach work again :) changeset: 937:de514cbd2d25 user: pancake@localhost.localdomain date: Wed Apr 15 23:36:30 2009 +0000 files: src/cmds.c src/flags.c src/radare.c description: * Added 'fb' command to rebase a flag - f.ex: fb 0x8048000 @@ str. * Fix code analysis limitation bug :S changeset: 936:42d5ec042224 user: pancake@localhost.localdomain date: Wed Apr 15 23:09:45 2009 +0000 files: src/arch/x86/code.c src/config.c src/radare.c description: * Added cmd.open eval variable - Can be configured in radarerc - Executed after opening the file * Theorically fixes the code analysis problem in mov edi, - Thanks elektranox changeset: 935:8575ecf77cc1 user: pancake <@youterm.com> date: Wed Apr 15 20:14:03 2009 +0200 files: src/radare.c src/utils.c description: * Fix help message for 'yt' command changeset: 934:27eca9d67d09 user: pancake <@youterm.com> date: Wed Apr 15 14:04:44 2009 +0200 files: src/dbg/debug.c src/dbg/debug.h src/dbg/system.c description: * New debugger command '!contum' - Continue until modified instruction found in user code memory page - Useful to find OEPs in packed bins changeset: 933:689d4e9fe149 user: pancake@localhost.localdomain date: Wed Apr 15 00:46:56 2009 +0000 files: man/radare.1 description: * Fix manpage 'pG' -> 'ag' changeset: 932:b9f9c359d212 user: pancake@localhost.localdomain date: Wed Apr 15 00:08:50 2009 +0000 files: src/Makefile.acr src/dbg/arch/x86_64.c description: * Apply elektranox patch fixing ldflags for xrefs and rax - Nice catch :) * Added some partial fixups for the x86-64 debugger (needs test) changeset: 931:6d387f01cc12 user: pancake@localhost.localdomain date: Tue Apr 14 22:55:08 2009 +0000 files: Makefile.acr src/rsc/Makefile src/rsc/rsc.acr description: * Move rsc scripts to $pfx/lib/radare/bin to make lintian happy - Let's follow the rules * rsc.acr is now just calling the script directly instead of hacky argument passing and stupid perl dependency. keep it simple changeset: 930:fece4376f8d5 user: pancake <@youterm.com> date: Tue Apr 14 18:13:53 2009 +0200 files: src/cmds.c src/utils.c description: * Added $$s variable to get file size changeset: 929:8c93492bf2d6 user: pancake <@youterm.com> date: Tue Apr 14 12:08:31 2009 +0200 files: Makefile.acr description: * bindiff-ng is a script, not a bin changeset: 928:583c944c8ac0 user: pancake <@youterm.com> date: Tue Apr 14 10:05:15 2009 +0200 files: Makefile.acr description: * Create site-packages directory changeset: 927:b44acb1e5330 user: pancake@localhost.localdomain date: Mon Apr 13 21:44:56 2009 +0000 files: Makefile.acr man/gradare.1 description: * Added gradare.1 manpage changeset: 926:6a8645722856 user: pancake@localhost.localdomain date: Mon Apr 13 21:33:00 2009 +0000 files: Makefile.acr man/radare.1 src/radiff/main.c description: * More lintian fixups (thanks elektranox again :P) changeset: 925:92b4ef5b1fb0 user: pancake@localhost.localdomain date: Mon Apr 13 20:01:12 2009 +0000 files: Makefile.acr description: * Oops. missing mkdir man5 (thanks elektranox) changeset: 924:6cebd6ca3b00 user: pancake@localhost.localdomain date: Mon Apr 13 17:31:38 2009 +0000 files: Makefile.acr description: * Install radarerc.5 manpage changeset: 923:15505590bd01 user: pancake@localhost.localdomain date: Mon Apr 13 13:23:31 2009 +0000 files: Makefile.acr configure configure.acr src/rsc/pool/asm src/rsc/rsc.acr description: * Install javasm, armasm and lsbstego as 'rsc' scripts - This way we dont need to provide manpage for them * Update acr configure to handle 'prefix' and 'PREFIX' environment vars - Fixes an autotools compatibility issue required for proper debian packaging changeset: 922:83b28d44faef user: pancake@localhost.localdomain date: Mon Apr 13 11:45:55 2009 +0000 files: man/bindiff.1 man/rabin.1 man/radare.1 man/radarerc.5 man/radiff.1 man/rahash.1 man/rasc.1 man/rasm.1 man/rax.1 man/rfile.1 man/rsc.1 man/xrefs.1 src/plug/hack/radare.rb description: * Added radarerc(5) manpage * Remove 'puts "Load done"' in radare.rb Ruby API changeset: 921:4f789d6bb89e user: pancake <@youterm.com> date: Thu Apr 09 15:13:35 2009 +0200 files: configure configure.acr man/radiff.1 man/rasm.1 scripts/elf-entry-point scripts/elf-flag-header src/rsc/pool/elf-entry-point src/rsc/pool/elf-flag-header description: * Remove elf-* radare scripts from the rsc directory * Install radiff.1 and rasm.1 manpages - Fixes for .El * Fix configure script HAVE_EWF -> WANT_EWF changeset: 920:99e8fb623d1f user: pancake <@youterm.com> date: Thu Apr 09 13:55:29 2009 +0200 files: man/radare.1 man/rasc.1 man/rfile.1 man/rsc.1 description: * Fix manpages .El issues (thanks lintian+elektranox) changeset: 919:6aa02e9f717b user: pancake <@youterm.com> date: Thu Apr 02 20:05:58 2009 +0200 files: doc/xtra/linux-sys-syscall-64.h description: * Added 64bit syscall numbers for linux changeset: 918:3ef8b76eb393 user: pancake@localhost.localdomain date: Fri Mar 27 09:47:34 2009 +0000 files: src/cmds.c description: * Rename 'CD' into 'CL' changeset: 917:92dce3174090 user: pancake@localhost.localdomain date: Fri Mar 27 00:18:57 2009 +0000 files: src/cmds.c description: * Add 'CD' command (sync with r2) changeset: 916:56a978de463d user: pancake <@youterm.com> date: Fri Mar 20 18:11:44 2009 +0100 files: src/arch/arm/aasm/Makefile src/rahash/Makefile description: * Apply graz's patch fixing some makefile race conditions for -j4 changeset: 915:ef0f9e1dc86f user: nibble date: Sun Mar 15 02:15:35 2009 +0100 files: src/rabin/dietelf.c src/rabin/dietpe.c description: * Minor fix in dietelf and dietpe changeset: 914:9ed827117169 user: nibble date: Sat Mar 14 13:32:37 2009 +0100 files: src/rabin/dietelf.c description: * Fixed rabin -z bug changeset: 913:8927c9f4ac03 user: nibble date: Sat Mar 14 13:09:17 2009 +0100 files: src/rabin/dietelf.c src/rabin/dietpe.c src/rabin/elf.h src/rabin/pe.h description: * Fixed symbols name bug changeset: 912:593570ee5df5 user: pancake@localhost.localdomain date: Fri Mar 13 21:09:30 2009 +0000 files: src/print.c src/rasign/Makefile src/rasign/main.c src/rasign/sign.c src/rasign/sign.h description: * Remove rasign from radare1 (moved to r2 repo) changeset: 911:64a91fba3786 parent: 910:1f9699d46287 parent: 907:5cf3fa9b0a90 user: pancake <@youterm.com> date: Fri Mar 13 17:09:08 2009 +0100 files: src/socket.c description: * Merge changeset: 910:1f9699d46287 parent: 909:6edfa54aef10 parent: 908:7bd5041767fa user: pancake <@youterm.com> date: Fri Mar 13 17:07:59 2009 +0100 files: src/cmds.c src/utils.c src/utils.h vala/default_layout.c vala/graph.c vala/node.c vala/widget.c description: * Backport of the '?t' command from radare2 changeset: 909:6edfa54aef10 parent: 905:cecdeab95eaf user: pancake <@youterm.com> date: Mon Mar 09 16:55:22 2009 +0100 files: src/socket.c description: * Add nonblocking socket support for Windows(R) changeset: 908:7bd5041767fa parent: 901:8fed4139671b user: pancake <@youterm.com> date: Mon Mar 09 16:43:20 2009 +0100 files: src/socket.c vala/default_layout.c vala/graph.c vala/node.c vala/renderer.c vala/widget.c description: * Fix nonblock socket on w32 changeset: 907:5cf3fa9b0a90 user: pancake@localhost.localdomain date: Tue Mar 10 10:59:07 2009 +0000 files: src/config.c src/dietline.c src/visual.c description: * ^L in visual refreshes screen resolution * Add asm.profile=compact * Fix build of standaline dietline changeset: 906:bd6b5269ce57 user: pancake@localhost.localdomain date: Tue Mar 10 01:52:47 2009 +0000 files: src/socket.c description: * Fix nonblock socket issue on w32 changeset: 905:cecdeab95eaf user: pancake@localhost.localdomain date: Mon Mar 09 02:06:25 2009 +0000 files: src/cmds.c src/flags.c src/grava.c vala/Makefile vala/chart.c vala/chart.h vala/default_layout.c vala/default_layout.h vala/edge.c vala/edge.h vala/graph.c vala/graph.h vala/grava/chart.vala vala/grava/default_layout.vala vala/grava/edge.vala vala/grava/graph.vala vala/grava/node.vala vala/grava/widget.vala vala/node.c vala/node.h vala/widget.c description: * Add two optional arguments to 'f' command (like in radare2) - f foo $$b $$ ; default values (block size, current seek) * Fix warnings in vala - Only update .c files when necessary (handmade check to speedup build) changeset: 904:cc8f60ac63ee user: pancake@localhost.localdomain date: Sat Mar 07 18:01:45 2009 +0000 files: ChangeLog description: Sync changelog === 1.2.2 === 2009-03-07 changeset: 903:c74c378097b7 tag: tip user: pancake@localhost.localdomain date: Sat Mar 07 17:32:56 2009 +0000 files: scripts/macros src/plug/hack/radare.py description: * Sync script/macros and python api with last syntax changes changeset: 902:b19239973714 user: pancake@localhost.localdomain date: Fri Mar 06 13:18:00 2009 +0000 files: configure configure.acr description: * Add --without-ewf configure flag option - I dunno why ewf is found in ipod touch :) changeset: 901:8fed4139671b user: pancake <@youterm.com> date: Thu Mar 05 13:16:50 2009 +0100 files: Makefile.acr description: * Rename 'dist' as 'shot' make target * Rename 'ball' as 'dist' make target changeset: 900:6b1800f334c3 user: pancake@localhost.localdomain date: Wed Mar 04 23:53:54 2009 +0000 files: AUTHORS gui/Makefile description: * Fix race condition in gui/ build with make -j>1 (thanks graz!) changeset: 899:11a3668d0e36 user: pancake <@youterm.com> date: Wed Mar 04 13:26:58 2009 +0100 files: src/radare.c description: * Add support for multiple `` replaces for oneliners - Final '`' is now obligatory (like in r2) changeset: 898:fa2ed8b3c246 user: pancake@localhost.localdomain date: Tue Mar 03 01:15:40 2009 +0000 files: src/visual.c description: * Fix issue when adding comments in visual + cursor mode (';' key) changeset: 897:d9e29e82e2de user: pancake@localhost.localdomain date: Fri Feb 27 10:41:18 2009 +0000 files: src/config.c src/print.c src/print.h description: * Add print_zoom() helper - Enabled with config var: "zoom.enable" key * Fix headers of po (octal print) * Added p= command to print bars for each byte changeset: 896:3eb0eb8f43b7 user: pancake@localhost.localdomain date: Fri Feb 27 00:02:05 2009 +0000 files: TODO src/config.c src/cons.c src/cons.h description: * Add cons_interactive boolean * Fixes a limit to print to the screen - Avoids the user to do silly things like dumping 5GB to the console - Queries the user with a yesno() dialog changeset: 895:8cb2169dbfd8 user: pancake@localhost.localdomain date: Thu Feb 26 23:44:19 2009 +0000 files: config.mk.acr src/Makefile.acr src/cmds.c src/plug/hack/Makefile src/radiff/Makefile src/rasc/Makefile src/utils.c description: * Fix some makefile bugs (optimize rebuild time) * Rename ?x command as ?X * New command ?x to print hexpair strings - f.example: ?x 303132 ..will print 0123 * Show M/K/G size in float when evaluating '?' math expressions * Only build lua plugin when system have the .so * Add support for 'x' character evaluation - We can evaluate 'A' instead of 0x41 for example. changeset: 894:ac4796fafe48 user: pancake <@youterm.com> date: Thu Feb 26 18:51:04 2009 +0100 files: TODO configure scripts/recover-pics.rscript src/cmds.c src/radare.c description: * Add search.to for s/ command * Update configure for acr 0.7.1 * Add recover-pics radare script example * Add wT command (dump counted files) size can be specified - Useful for file recovery changeset: 893:fa17cda5b5ed user: nibble date: Wed Feb 25 09:46:41 2009 +0100 files: src/rasc/rasc.c description: * rasm: Fixed initial 0x41 ('A') issue changeset: 892:18dfcac08d92 user: pancake@localhost.localdomain date: Wed Feb 25 01:16:24 2009 +0100 files: vala/default_layout.c vala/graph.c vala/node.c vala/renderer.c vala/widget.c description: * Fix vala generated code using valac 0.5.7 changeset: 891:15251d9d72b4 user: pancake@localhost.localdomain date: Wed Feb 25 01:00:02 2009 +0100 files: configure configure.acr src/cmds.c src/cmds.h src/cons.c src/dbg/objects.mk src/rasc/shellcodes.c vala/chart.c vala/chart.h description: * Fix configure problem with /bin/install path - Up to 1.2.2 (just for development..not released yet) * Added initial 'd' command (backport of the r2 command) - dr=!regs, dc=!cont, ds=!step, dS=!stepo * Fix cons.c build on osx-arm (iPod touch 2G) - Debugger not yet ported * Import javicoder's SPARC linux shellcodes - Needs testing and port for Solaris changeset: 890:38619fc2a4f9 user: nibble date: Tue Feb 17 02:42:39 2009 +0100 files: src/code.c description: * Fix m68k disasm changeset: 889:5669dc8e07e1 user: pancake@localhost.localdomain date: Sun Feb 15 23:43:07 2009 +0100 files: config.mk.acr configure configure.acr gui/Makefile libusbsniff/Makefile src/Makefile.acr src/dbg/Makefile src/javasm/Makefile src/plug/hack/Makefile src/radiff/Makefile src/rahash/Makefile src/rasc/Makefile src/swig/Makefile description: * Applied gentoo's bug report: - Fixes --as-needed build https://bugs.gentoo.org/attachment.cgi?id=182129 changeset: 888:f269031cf7e0 user: pancake@localhost.localdomain date: Sat Feb 14 08:55:38 2009 -0800 files: wscript description: * waf is now installing manpages (Thanks sha0 for the tip :) changeset: 887:20049b83aa71 user: pancake@localhost.localdomain date: Fri Feb 13 23:25:48 2009 -0800 files: scripts/rscript.pl src/plug/hack/Makefile src/plug/hack/perl.c description: * Do not show stderr when buliding py, rb an pl hack plugins * Added rscript.pl perl example * Allow to run files from the perl hack plugin > H perl scripts/rscript.pl changeset: 886:f480af2ac1af user: pancake <@youterm.com> date: Fri Feb 13 16:54:56 2009 +0100 files: src/dbg/parser.c src/dbg/parser.h src/main.h src/plug/hack/Makefile src/plug/hack/perl.c src/plug/hack/python.c description: * Fix perl plugin build and execution - Read perlembed.pod for more information - Some enums in parser.h has been redefined to avoid collisions - A bit hacky, but works like python or ruby now :) changeset: 885:83e8102f2ab7 user: pancake@localhost.localdomain date: Thu Feb 12 20:45:45 2009 -0800 files: src/cmds.c src/plug/hack/scriptedit.c src/project.c src/rabin/rabin.c src/undo.c vala/default_layout.c vala/edge.c vala/graph.c vala/graph.h vala/grava/default_layout.vala vala/grava/renderer.vala vala/grava/widget.vala vala/node.c vala/node.h vala/renderer.c vala/renderer.h vala/widget.c vala/widget.h description: * Sync vala sources to be working with last vala compiler (0.5.6) - C files updated * Added 'u*' command to dump write changes as radare commands (thx robin) * 'Ps' command warns when no project name given (Thanks Robin!) * rabin shows the filename when an error occurs) changeset: 884:20e3119b8d4e user: pancake@localhost.localdomain date: Thu Feb 12 12:19:42 2009 -0800 files: src/radiff/Makefile description: * Fix build of radiff changeset: 883:a1128644134c user: pancake <@youterm.com> date: Fri Feb 06 15:27:01 2009 +0100 files: config.mk.acr src/radiff/Makefile src/ut.c wscript description: * Added ut.c as a replacement for utils.c copy hack - Should fix the build issues on gentoo sandbox * Remove the -Wall gcc flag by default - Ojos que no ven.. patada en los cojones changeset: 882:02502e2bf6b3 user: pancake date: Thu Feb 05 22:06:47 2009 +0100 files: src/libr/Makefile src/libr/README src/libr/TODO src/libr/asm/Makefile src/libr/asm/arch/arm/asm.c src/libr/asm/arch/arm/gnu/arm-dis.c src/libr/asm/arch/bf/asm.c src/libr/asm/arch/include/ansidecl.h src/libr/asm/arch/include/bfd.h src/libr/asm/arch/include/bfdlink.h src/libr/asm/arch/include/dis-asm.h src/libr/asm/arch/include/elf-bfd.h src/libr/asm/arch/include/elf/common.h src/libr/asm/arch/include/elf/external.h src/libr/asm/arch/include/elf/internal.h src/libr/asm/arch/include/elf/mips.h src/libr/asm/arch/include/elf/reloc-macros.h src/libr/asm/arch/include/libiberty.h src/libr/asm/arch/include/opcode/mips.h src/libr/asm/arch/include/opcode/sparc.h src/libr/asm/arch/include/opintl.h src/libr/asm/arch/include/symcat.h src/libr/asm/arch/include/sysdep.h src/libr/asm/arch/mips/asm.c src/libr/asm/arch/mips/gnu/mips-dis.c src/libr/asm/arch/mips/gnu/mips-opc.c src/libr/asm/arch/mips/gnu/mips16-opc.c src/libr/asm/arch/ppc/asm.c src/libr/asm/arch/ppc/ppc_disasm/ppc_disasm.c src/libr/asm/arch/ppc/ppc_disasm/ppc_disasm.h src/libr/asm/arch/sparc/asm.c src/libr/asm/arch/sparc/gnu/sparc-dis.c src/libr/asm/arch/sparc/gnu/sparc-opc.c src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/ollyasm/asmserv.c src/libr/asm/arch/x86/ollyasm/assembl.c src/libr/asm/arch/x86/ollyasm/disasm.c src/libr/asm/arch/x86/ollyasm/disasm.h src/libr/asm/arch/x86/pseudo.c src/libr/asm/arch/x86/realloc.c src/libr/asm/arch/x86/udis86/LICENSE src/libr/asm/arch/x86/udis86/README src/libr/asm/arch/x86/udis86/decode.c src/libr/asm/arch/x86/udis86/decode.h src/libr/asm/arch/x86/udis86/extern.h src/libr/asm/arch/x86/udis86/input.c src/libr/asm/arch/x86/udis86/input.h src/libr/asm/arch/x86/udis86/itab.c src/libr/asm/arch/x86/udis86/itab.h src/libr/asm/arch/x86/udis86/syn-att.c src/libr/asm/arch/x86/udis86/syn-intel.c src/libr/asm/arch/x86/udis86/syn.c src/libr/asm/arch/x86/udis86/syn.h src/libr/asm/arch/x86/udis86/types.h src/libr/asm/arch/x86/udis86/udis86.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/asm_x86.c src/libr/asm/t/disasm_arm.c src/libr/asm/t/disasm_bf.c src/libr/asm/t/disasm_mips.c src/libr/asm/t/disasm_ppc.c src/libr/asm/t/disasm_sparc.c src/libr/asm/t/disasm_x86.c src/libr/asm/t/rasm2.c src/libr/asm/t/realloc_x86.c src/libr/bin/Makefile src/libr/bin/bin.c src/libr/bin/elf.c src/libr/bin/elf64.c src/libr/bin/pe.c src/libr/bin/t/Makefile src/libr/bin/t/baddr.c src/libr/bin/t/data_resize.c src/libr/bin/t/entry.c src/libr/bin/t/imports.c src/libr/bin/t/info.c src/libr/bin/t/rabin2.c src/libr/bin/t/rsz_test.sh src/libr/bin/t/sections.c src/libr/bin/t/symbols.c src/libr/bp/Makefile src/libr/bp/README src/libr/bp/bp.c src/libr/cmd/Makefile src/libr/cmd/TODO src/libr/cmd/cmd.c src/libr/cmd/t/Makefile src/libr/cmd/t/test.c src/libr/config.mk src/libr/config/Makefile src/libr/config/callback.c src/libr/config/config.c src/libr/config/deprecated.c src/libr/config/t/Makefile src/libr/config/t/test.c src/libr/cons/Makefile src/libr/cons/color.c src/libr/cons/cons.c src/libr/cons/input.c src/libr/cons/pipe.c src/libr/cons/print.c src/libr/cons/strsub.c src/libr/cons/t/Makefile src/libr/cons/t/hello.c src/libr/core/Makefile src/libr/core/cmd.c src/libr/core/config.c src/libr/core/core.c src/libr/core/file.c src/libr/core/io.c src/libr/core/t/Makefile src/libr/core/t/radare2.c src/libr/core/visual.c src/libr/debug/Makefile src/libr/debug/debug.c src/libr/debug/handle.c src/libr/debug/p/ptrace.c src/libr/diff/Makefile src/libr/diff/diff.c src/libr/diff/t/Makefile src/libr/diff/t/radiff2.c src/libr/diff/t/test.c src/libr/flags/Makefile src/libr/flags/flags.c src/libr/flags/name.c src/libr/flags/old_flags.c src/libr/flags/old_flags.h src/libr/hash/Makefile src/libr/hash/crc16.c src/libr/hash/crc32.c src/libr/hash/crc32.h src/libr/hash/crca.c src/libr/hash/entropy.c src/libr/hash/hamdist.c src/libr/hash/hash.c src/libr/hash/hash.h src/libr/hash/md4.c src/libr/hash/md5.h src/libr/hash/md5c.c src/libr/hash/sha1.c src/libr/hash/sha1.h src/libr/hash/sha2.c src/libr/hash/sha2.h src/libr/hash/state.c src/libr/hash/t/Makefile src/libr/hash/t/hello.c src/libr/include/list.h src/libr/include/r.h src/libr/include/r_asm.h src/libr/include/r_bin.h src/libr/include/r_bin_elf.h src/libr/include/r_bin_elf64.h src/libr/include/r_bin_elf_specs.h src/libr/include/r_bin_pe.h src/libr/include/r_bin_pe_specs.h src/libr/include/r_cmd.h src/libr/include/r_config.h src/libr/include/r_cons.h src/libr/include/r_core.h src/libr/include/r_debug.h src/libr/include/r_diff.h src/libr/include/r_flags.h src/libr/include/r_hash.h src/libr/include/r_io.h src/libr/include/r_lang.h src/libr/include/r_lib.h src/libr/include/r_line.h src/libr/include/r_macro.h src/libr/include/r_print.h src/libr/include/r_range.h src/libr/include/r_reg.h src/libr/include/r_search.h src/libr/include/r_sign.h src/libr/include/r_socket.h src/libr/include/r_syscall.h src/libr/include/r_types.h src/libr/include/r_util.h src/libr/include/r_vm.h src/libr/io/Makefile src/libr/io/README src/libr/io/desc.c src/libr/io/handle.c src/libr/io/io.c src/libr/io/map.c src/libr/io/plugins/Makefile src/libr/io/plugins/README src/libr/io/plugins/dbg.c src/libr/io/plugins/malloc.c src/libr/io/plugins/ptrace.c src/libr/io/section.c src/libr/io/t/Makefile src/libr/io/t/cat.c src/libr/io/t/read4.c src/libr/io/undo.c src/libr/io/undo.h src/libr/lang/Makefile src/libr/lang/lang.c src/libr/lib/Makefile src/libr/lib/lib.c src/libr/lib/t/Makefile src/libr/lib/t/plugin.c src/libr/lib/t/test-plugin.c src/libr/line/Makefile src/libr/line/TODO src/libr/line/dietline.c src/libr/line/t/Makefile src/libr/line/t/hello.c src/libr/macro/Makefile src/libr/macro/macro.c src/libr/print/Makefile src/libr/print/format.c src/libr/print/print.c src/libr/print/t/Makefile src/libr/print/t/hex.c src/libr/range/Makefile src/libr/range/range.c src/libr/reg/Makefile src/libr/reg/README src/libr/reg/reg.c src/libr/rules.mk src/libr/search/Makefile src/libr/search/aes-find.c src/libr/search/binparse.c src/libr/search/bytepat.c src/libr/search/search.c src/libr/search/stripstr.c src/libr/search/t/Makefile src/libr/search/t/test-str.c src/libr/search/t/test.c src/libr/sign/Makefile src/libr/sign/sign.c src/libr/socket/Makefile src/libr/socket/socket.c src/libr/stripsyms.sh src/libr/syscall/Makefile src/libr/syscall/TODO src/libr/syscall/darwin.c src/libr/syscall/example.syscall-file src/libr/syscall/freebsd.c src/libr/syscall/linux.c src/libr/syscall/netbsd.c src/libr/syscall/syscall.c src/libr/syscall/t/Makefile src/libr/syscall/t/hello.c src/libr/tests.mk src/libr/util/Makefile src/libr/util/alloca.c src/libr/util/alloca.s src/libr/util/file.c src/libr/util/hex.c src/libr/util/mem.c src/libr/util/num.c src/libr/util/re.c src/libr/util/str.c src/libr/util/t/Makefile src/libr/util/t/ralloc.c src/libr/util/t/rax2.c src/libr/util/t/test.c src/libr/vapi/r_asm.vapi src/libr/vapi/r_bin.vapi src/libr/vapi/r_config.vapi src/libr/vapi/r_cons.vapi src/libr/vapi/r_core.vapi src/libr/vapi/r_hash.deps src/libr/vapi/r_hash.vapi src/libr/vapi/r_io.vapi src/libr/vapi/r_range.vapi src/libr/vapi/r_search.vapi src/libr/vapi/r_socket.vapi src/libr/vapi/r_syscall.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/asm.vala src/libr/vapi/t/bin.vala src/libr/vapi/t/core.vala src/libr/vapi/t/hash.vala src/libr/vapi/t/sc.vala src/libr/vapi/t/search.vala src/libr/vapi/t/socket.vala src/libr/vm/Makefile src/libr/vm/extra.c src/libr/vm/mmu.c src/libr/vm/op.c src/libr/vm/reg.c src/libr/vm/setup.c src/libr/vm/stack.c src/libr/vm/vm.c description: * Remove libr from the radare1 repository - Moved to a new one - Development of radare2 have been moved to another repo - Please visit the homepage to get instructions and fetch the new repository for libr changeset: 881:96ed26ef99e3 user: pancake <@youterm.com> date: Thu Feb 05 20:21:10 2009 +0100 files: src/dbg/close.c src/rsc/Makefile src/rsc/pool/daemon src/rsc/pool/daemon-cmd description: * Close process when stdin is eof - Fixes infinite loop+100% cpu in some stupid situations * Add daemon and daemon-cmd rsc utilities to use radare in background and launch commands remotely - It is a bit hacky shellscript way..but it works ;) changeset: 880:ed9c8383c7b9 user: pancake date: Thu Feb 05 18:55:15 2009 +0100 files: src/libr/core/cmd.c src/libr/core/core.c src/libr/core/t/Makefile src/libr/include/r_core.h src/libr/include/r_lang.h src/libr/include/r_lib.h src/libr/io/io.c src/libr/lang/Makefile src/libr/lang/lang.c description: * Added 'oobi support' for libr - oobi stands for 'Out Of Band Input' - Enables '<' and '<<' command modifiers - '<' : read from file - '<<' : read until EOF mark - Lot of commands will * Added r_lang - Nonworking integration with r_core in the '#!' command - Use: #!perl < file.pl for example changeset: 879:056a0f472dcb user: pancake date: Thu Feb 05 02:35:14 2009 +0100 files: src/libr/TODO src/libr/bp/README src/libr/bp/bp.c src/libr/core/cmd.c src/libr/core/core.c src/libr/debug/Makefile src/libr/debug/debug.c src/libr/debug/handle.c src/libr/debug/p/ptrace.c src/libr/debug/ptrace.c src/libr/include/r.h src/libr/include/r_debug.h src/libr/include/r_lib.h src/libr/io/io.c src/libr/line/dietline.c description: * Fix build for libr * Some refactor for libr_debug - Basic r_debug_handle api - Loaded debugger plugins integrated with core * Drop label related code from dietline changeset: 878:7d0081787d00 user: pancake <@youterm.com> date: Wed Feb 04 20:11:51 2009 +0100 files: src/libr/include/r_io.h src/libr/include/r_io_section.h src/libr/io/plugins/Makefile src/libr/io/plugins/dbg.c src/libr/io/plugins/malloc.c src/libr/io/plugins/ptrace.c src/libr/io/section.c src/libr/rules.mk src/libr/socket/socket.c src/libr/vapi/r_io.vapi description: * Remove r_io_section.h (merge with r_io.h) * Added malloc io plugin for libr - Ported from radare in few mins * Fix some issues with the dbg:// io-redirect plugin * Add plugins/ as subdir build rule if found * Change some old-to-new license lines changeset: 877:46f48b48c5d1 user: pancake date: Wed Feb 04 12:10:59 2009 +0100 files: src/libr/cons/pipe.c src/libr/core/cmd.c src/libr/core/core.c src/libr/core/file.c src/libr/core/io.c src/libr/core/t/Makefile src/libr/hash/t/hello.c src/libr/include/r_cons.h src/libr/include/r_core.h src/libr/include/r_io.h src/libr/include/r_io_section.h src/libr/include/r_lib.h src/libr/include/r_util.h src/libr/io/handle.c src/libr/io/io.c src/libr/io/map.c src/libr/io/plugins/dbg.c src/libr/io/plugins/ptrace.c src/libr/io/section.c src/libr/io/t/Makefile src/libr/io/t/cat.c src/libr/io/t/read4.c src/libr/lib/lib.c src/libr/util/file.c description: * Major refactoring for the r_io - API has changed. Now r_io is OO - Added r_io_redirect() - Makes ptrace() and dbg:// plugins work! - Sync program examples with new api * Remove lot of debugging mesages - Fix warnings * Added r_file_exist() helper in r_util * Added '|' command in the core - list io plugins and send commands thru io_system changeset: 876:6cf4c3d48ae8 user: pancake <@youterm.com> date: Tue Feb 03 20:16:11 2009 +0100 files: src/dbg/pt-example.c src/libr/core/core.c src/libr/include/r_io.h src/libr/io/io.c src/libr/io/plugins/Makefile src/libr/io/plugins/dbg.c src/libr/io/plugins/ptrace.c description: * Some more shitty updates for the debug io - Needs full io refactoring to make this io_redirect work changeset: 875:c927fcb736a7 user: pancake date: Tue Feb 03 10:43:59 2009 +0100 files: src/libr/core/t/Makefile src/libr/io/io.c src/libr/io/plugins/Makefile src/libr/io/plugins/dbg.c src/libr/io/plugins/ptrace.c src/libr/util/str.c description: * Initial import of the dbg:// io plugin - Forks a new process and redirects the uri to ptrace:// on *nix - If process name is a number directly pass the control to ptrace as a pid - The resulting process is not attachable :/ will have to fix this :) * radare2 is now linked dinamicly against libr - Fixes the problem of dupped r_io while using io plugins - Everything needs to be dynamic if we want to use r_io changeset: 874:7d6363813c0d user: pancake date: Mon Feb 02 04:28:02 2009 +0100 files: src/libr/core/cmd.c src/libr/core/core.c src/libr/core/t/Makefile src/libr/include/r_core.h src/libr/include/r_io.h src/libr/io/handle.c src/libr/io/io.c src/libr/io/plugins/Makefile src/libr/io/plugins/ptrace.c src/libr/lib/lib.c description: * Initial working implementation of the ptrace io plugin - Now r_core uses r_lib - Plugins are autoloaded at startup time - attach to process and read memory works changeset: 873:55c830447283 user: pancake date: Mon Feb 02 03:25:52 2009 +0100 files: src/libr/Makefile src/libr/include/r_lib.h src/libr/io/io.c src/libr/io/plugins/Makefile src/libr/io/plugins/ptrace.c src/rabin/rabin.c description: * Initial import of the ptrace io plugin - core does not yet uses r_lib to load io/plugins - Added R_LIB_TYPE_IO..more to come * Make rabin properly identify the redsn0w mach0 binary header changeset: 872:b24b3e49eb8d user: pancake date: Mon Feb 02 01:59:44 2009 +0100 files: src/libr/bp/bp.c src/libr/debug/debug.c src/libr/include/r_asm.h src/libr/include/r_reg.h src/libr/io/plugins/README src/libr/io_plugins/README src/libr/reg/reg.c description: * More draft code for r_bp and r_reg changeset: 871:34d24ca37ff9 user: nibble date: Mon Feb 02 00:50:19 2009 +0100 files: src/libr/asm/arch/arm/asm.c src/libr/asm/arch/bf/asm.c src/libr/asm/arch/mips/asm.c src/libr/asm/arch/ppc/asm.c src/libr/asm/arch/sparc/asm.c src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/pseudo.c src/libr/asm/arch/x86/realloc.c src/libr/asm/asm.c src/libr/asm/t/asm_x86.c src/libr/asm/t/disasm_arm.c src/libr/asm/t/disasm_bf.c src/libr/asm/t/disasm_mips.c src/libr/asm/t/disasm_ppc.c src/libr/asm/t/disasm_sparc.c src/libr/asm/t/disasm_x86.c src/libr/asm/t/rasm2.c src/libr/asm/t/realloc_x86.c src/libr/include/r_asm.h src/libr/vapi/r_asm.vapi description: * Types fixups in r_asm changeset: 870:3e992e014cb6 user: nibble date: Sun Feb 01 14:54:33 2009 +0100 files: src/libr/vapi/r_bin.vapi src/libr/vapi/t/bin.vala description: * Fixed r_bin vapi and test program changeset: 869:568b3537dc9c parent: 868:aeede8dbbdd7 parent: 867:b66d5b37d514 user: pancake date: Sun Feb 01 04:50:30 2009 +0100 files: src/libr/asm/arch/arm/gnu/ansidecl.h src/libr/asm/arch/arm/gnu/bfd.h src/libr/asm/arch/arm/gnu/dis-asm.h src/libr/asm/arch/arm/gnu/symcat.h src/libr/asm/arch/mips/gnu/ansidecl.h src/libr/asm/arch/mips/gnu/bfd.h src/libr/asm/arch/mips/gnu/bfdlink.h src/libr/asm/arch/mips/gnu/dis-asm.h src/libr/asm/arch/mips/gnu/elf-bfd.h src/libr/asm/arch/mips/gnu/elf/common.h src/libr/asm/arch/mips/gnu/elf/external.h src/libr/asm/arch/mips/gnu/elf/internal.h src/libr/asm/arch/mips/gnu/elf/mips.h src/libr/asm/arch/mips/gnu/elf/reloc-macros.h src/libr/asm/arch/mips/gnu/libiberty.h src/libr/asm/arch/mips/gnu/opcode/mips.h src/libr/asm/arch/mips/gnu/opintl.h src/libr/asm/arch/mips/gnu/symcat.h src/libr/asm/arch/mips/gnu/sysdep.h src/libr/include/r_asm.h src/libr/vapi/r_bin.vapi src/libr/vapi/t/bin.vala description: * Oops. merge changeset: 868:aeede8dbbdd7 parent: 866:783ecba9af73 user: pancake date: Sun Feb 01 04:48:03 2009 +0100 files: src/libr/Makefile src/libr/bp/README src/libr/cmd/cmd.c src/libr/core/cmd.c src/libr/core/t/Makefile src/libr/debug/Makefile src/libr/debug/debug.c src/libr/debug/ptrace.c src/libr/include/r_asm.h src/libr/include/r_cmd.h src/libr/include/r_core.h src/libr/include/r_debug.h src/libr/include/r_reg.h src/libr/reg/Makefile src/libr/reg/README src/libr/reg/reg.c src/libr/util/Makefile src/libr/util/alloca.c src/libr/util/alloca.s src/libr/util/t/Makefile src/libr/util/t/ralloc.c src/libr/vapi/r_bin.vapi src/libr/vapi/t/bin.vala description: * Initial nonworking draft for r_debug and r_reg - Basic debugger api defined - Needs implementation for various operating systems - Debugger is now designed to be modular at breakpoint, register, io, and debugging layers based on function pointers. - Lot of things to do here. - r_reg handles lists and definitions for registers of multiple architectures * Initial import of ralloc. - A minimalistic and fast stacked heap memory allocation - 40% faster than glibc's malloc and 60% faster than alloca - Exposes a bug in gcc optimizations. fmi: http://news.nopcode.org/gccfail - Added benchmarking test program * Some cleanup of the r_bin api. missing "public" attributes - Looks like arrays like Entry[] are not well integrated with vala - Test program now crashes. needs redesign solution * Dummy r_cmd_args() to be integrated easily with dietline * Added dummy help message for 'd' command in radare2 changeset: 867:b66d5b37d514 user: nibble date: Fri Jan 30 20:13:46 2009 +0100 files: src/libr/TODO src/libr/asm/Makefile src/libr/asm/arch/arm/asm.c src/libr/asm/arch/arm/gnu/ansidecl.h src/libr/asm/arch/arm/gnu/bfd.h src/libr/asm/arch/arm/gnu/dis-asm.h src/libr/asm/arch/arm/gnu/symcat.h src/libr/asm/arch/include/ansidecl.h src/libr/asm/arch/include/bfd.h src/libr/asm/arch/include/bfdlink.h src/libr/asm/arch/include/dis-asm.h src/libr/asm/arch/include/elf-bfd.h src/libr/asm/arch/include/elf/common.h src/libr/asm/arch/include/elf/external.h src/libr/asm/arch/include/elf/internal.h src/libr/asm/arch/include/elf/mips.h src/libr/asm/arch/include/elf/reloc-macros.h src/libr/asm/arch/include/libiberty.h src/libr/asm/arch/include/opcode/mips.h src/libr/asm/arch/include/opcode/sparc.h src/libr/asm/arch/include/opintl.h src/libr/asm/arch/include/symcat.h src/libr/asm/arch/include/sysdep.h src/libr/asm/arch/mips/asm.c src/libr/asm/arch/mips/gnu/ansidecl.h src/libr/asm/arch/mips/gnu/bfd.h src/libr/asm/arch/mips/gnu/bfdlink.h src/libr/asm/arch/mips/gnu/dis-asm.h src/libr/asm/arch/mips/gnu/elf-bfd.h src/libr/asm/arch/mips/gnu/elf/common.h src/libr/asm/arch/mips/gnu/elf/external.h src/libr/asm/arch/mips/gnu/elf/internal.h src/libr/asm/arch/mips/gnu/elf/mips.h src/libr/asm/arch/mips/gnu/elf/reloc-macros.h src/libr/asm/arch/mips/gnu/libiberty.h src/libr/asm/arch/mips/gnu/opcode/mips.h src/libr/asm/arch/mips/gnu/opintl.h src/libr/asm/arch/mips/gnu/symcat.h src/libr/asm/arch/mips/gnu/sysdep.h src/libr/asm/arch/sparc/asm.c src/libr/asm/arch/sparc/gnu/sparc-dis.c src/libr/asm/arch/sparc/gnu/sparc-opc.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/disasm_sparc.c src/libr/config.mk src/libr/include/r_asm.h src/libr/include/r_bin.h src/libr/include/r_bin_elf.h src/libr/include/r_bin_pe.h src/libr/vapi/r_asm.vapi src/libr/vapi/r_bin.vapi src/libr/vapi/t/asm.vala src/libr/vapi/t/bin.vala description: * r_asm - Added sparc support - Added test (disasm_sparc) - Major reorganization of headers * Minor fixups in r_asm & r_bin vapis changeset: 866:783ecba9af73 user: nibble date: Fri Jan 30 16:08:53 2009 +0100 files: src/libr/TODO src/libr/asm/arch/bf/asm.c src/libr/asm/arch/x86/pseudo.c src/libr/asm/arch/x86/realloc.c src/libr/include/r_bin_elf.h src/libr/vapi/r_asm.vapi src/libr/vapi/r_bin.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/asm.vala src/libr/vapi/t/bin.vala description: * r_asm - More refactoring * r_bin - Fixed header issue * vapis - Added r_asm and r_bin vapi - Modified t/asm including parsing - Added test (t/bin) changeset: 865:50e3b2e29e41 user: pancake date: Fri Jan 30 12:20:48 2009 +0100 files: src/libr/TODO src/libr/bp/Makefile src/libr/bp/README src/libr/cons/Makefile src/libr/cons/TODO src/libr/cons/color.c src/libr/cons/cons.c src/libr/cons/input.c src/libr/cons/pipe.c src/libr/cons/print.c src/libr/core/cmd.c src/libr/include/r_cons.h src/libr/include/r_util.h src/libr/stripsyms.sh src/libr/util/num.c src/libr/util/str.c description: * Split cons in multiple files * Initial README for r_bp breakpoint management library * File pipes are now working in radare2 ('>' and '>>') * stripsyms.sh only filters symbols in r_util starting with r_ * Added r_str_nchr in util/str.c - simplifies some cons code changeset: 864:cc8bad644a1d user: nibble date: Thu Jan 29 19:00:38 2009 +0100 files: src/libr/asm/t/realloc_x86.c src/libr/bin/bin.c src/libr/bin/t/baddr.c src/libr/bin/t/entry.c src/libr/bin/t/imports.c src/libr/bin/t/info.c src/libr/bin/t/rabin2.c src/libr/bin/t/sections.c src/libr/bin/t/symbols.c src/libr/include/r_bin.h description: * r_bin - Added r_bin_new and r_bin_free - r_bin_open renamed to r_bin_init - Tests modified accordingly changeset: 863:279b0b1bb362 user: nibble date: Thu Jan 29 12:15:18 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/bf/asm.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/disasm_bf.c src/libr/include/r_asm.h description: * r_asm - Added bf support ;) - Added test (disasm_bf) changeset: 862:612f9aabcb39 user: pancake date: Thu Jan 29 12:24:47 2009 +0100 files: src/libr/TODO src/libr/include/r_core.h src/libr/include/r_range.h src/libr/range/range.c src/libr/vapi/r_cons.vapi src/libr/vapi/r_core.vapi src/libr/vapi/r_range.vapi src/libr/vapi/r_socket.vapi src/libr/vapi/r_syscall.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/core.vala src/libr/vapi/t/hash.vala description: * Initial import of r_cons, r_range and r_core VAPI files * Verboser TODO file * Fix out of namespace range function * Added Hello world test for vala-core changeset: 861:281224e02f42 user: nibble date: Thu Jan 29 10:49:27 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/arm/asm.c src/libr/asm/arch/mips/asm.c src/libr/asm/arch/ppc/asm.c src/libr/asm/arch/ppc/ppc_disasm/ppc_disasm.c src/libr/asm/arch/ppc/ppc_disasm/ppc_disasm.h src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/disasm_ppc.c src/libr/bin/Makefile src/libr/include/r_asm.h src/libr/include/r_util.h src/libr/util/hex.c description: * r_asm - Added ppc support - Added test (disasm_ppc) * r_util - Minor fix changeset: 860:996ef907bde5 user: nibble date: Thu Jan 29 00:38:47 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/arm/asm.c src/libr/asm/arch/mips/asm.c src/libr/asm/arch/mips/gnu/ansidecl.h src/libr/asm/arch/mips/gnu/bfd.h src/libr/asm/arch/mips/gnu/bfdlink.h src/libr/asm/arch/mips/gnu/dis-asm.h src/libr/asm/arch/mips/gnu/elf-bfd.h src/libr/asm/arch/mips/gnu/elf/common.h src/libr/asm/arch/mips/gnu/elf/external.h src/libr/asm/arch/mips/gnu/elf/internal.h src/libr/asm/arch/mips/gnu/elf/mips.h src/libr/asm/arch/mips/gnu/elf/reloc-macros.h src/libr/asm/arch/mips/gnu/libiberty.h src/libr/asm/arch/mips/gnu/mips-dis.c src/libr/asm/arch/mips/gnu/mips-opc.c src/libr/asm/arch/mips/gnu/mips16-opc.c src/libr/asm/arch/mips/gnu/opcode/mips.h src/libr/asm/arch/mips/gnu/opintl.h src/libr/asm/arch/mips/gnu/symcat.h src/libr/asm/arch/mips/gnu/sysdep.h src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/asm_x86.c src/libr/asm/t/disasm_arm.c src/libr/asm/t/disasm_mips.c src/libr/asm/t/disasm_x86.c src/libr/asm/t/rasm2.c src/libr/asm/t/realloc_x86.c src/libr/include/r_asm.h description: * r_asm - Added mips support - Added new test (disasm_mips) - Minor fixups in arm changeset: 859:01693373b933 user: pancake date: Thu Jan 29 01:25:55 2009 +0100 files: src/libr/bin/bin.c src/libr/core/Makefile src/libr/core/cmd.c src/libr/core/core.c src/libr/core/file.c src/libr/core/io.c src/libr/core/write.c src/libr/sign/sign.c src/libr/vapi/r_bin.vapi src/libr/vapi/r_core.vapi src/libr/vapi/r_io.vapi src/libr/vapi/t/Makefile description: * Initial vapi files for core, io and bin * Added simple core vapi test program changeset: 858:00abc72fdb25 user: pancake <@youterm.com> date: Wed Jan 28 19:48:38 2009 +0100 files: Makefile.acr src/vars.c description: * Applied build and installation bugfix patch - Thanks Mathias Krause! === 1.2 === changeset: 846:a4d83e09a192 tag: tip user: pancake <@youterm.com> date: Mon Jan 26 14:03:47 2009 +0100 files: src/libr/asm/arch/arm/asm.c src/libr/asm/arch/arm/gnu/arm-dis.c src/libr/asm/arch/x86/ollyasm/asmserv.c src/libr/asm/arch/x86/ollyasm/disasm.h src/libr/cmd/cmd.c src/libr/core/cmd.c src/libr/core/write.c src/libr/include/r_asm.h src/libr/include/r_macro.h src/libr/include/r_types.h src/libr/include/r_util.h src/libr/print/print.c src/libr/util/hex.c src/libr/util/str.c src/libr/vapi/r_asm.vapi src/libr/vapi/t/asm.vala src/rsc/pool/add src/rsc/pool/ffftoneg src/rsc/pool/move src/rsc/pool/strings-flag description: * Fix some warnings in libr - Maybe ollydasm works fine now * Added missing write.c file * asm.vala test program is compiling now :) * Use 'rax' instead of 'xc' in rsc pool changeset: 845:7153fe12402a user: pancake date: Mon Jan 26 13:58:56 2009 +0100 files: src/libr/core/Makefile src/libr/core/cmd.c src/libr/core/t/radare2.c src/libr/include/r_util.h description: * Added 'wo' comamnd to r_core_cmd * Added 'wv' one * Simplify help message in radare2 changeset: 844:32d6665be870 parent: 843:f901be9168fc parent: 842:25ac60c5415e user: pancake date: Mon Jan 26 00:40:37 2009 +0100 files: src/libr/asm/arch/x86/udis86/syn-pseudo.c description: * Merge changeset: 843:f901be9168fc parent: 840:125a3bb07de0 user: pancake date: Mon Jan 26 00:40:15 2009 +0100 files: src/libr/core/cmd.c src/libr/include/r_io.h src/libr/include/r_search.h src/libr/include/r_util.h src/libr/io/io.c src/libr/search/Makefile src/libr/search/binparse.c src/libr/search/search.c src/libr/search/stripstr.c src/libr/search/t/test.c src/libr/util/hex.c src/libr/util/str.c description: * Added some implementations for the write command in r_core - w, ww, wx, wb, wm - Added support for write binary mask to r_io_write * Added slurp_random_line for r_util - Added some hex2bin bin2hex helpers * Added stripstr algorithm to r_search - r_search is borken, needs a new binparse changeset: 842:25ac60c5415e user: nibble date: Sun Jan 25 12:19:14 2009 +0100 files: src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/pseudo.c src/libr/asm/asm.c src/libr/asm/t/disasm_x86.c src/libr/include/r_asm.h description: * r_asm - Add r_asm_parse - Refactoring changeset: 841:6834b2717a02 user: nibble date: Sun Jan 25 04:46:54 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/pseudo.c src/libr/asm/arch/x86/udis86/extern.h src/libr/asm/arch/x86/udis86/syn-pseudo.c src/libr/asm/arch/x86/udis86/types.h src/libr/asm/asm.c src/libr/asm/t/disasm_arm.c src/libr/asm/t/disasm_x86.c src/libr/asm/t/rasm2.c src/libr/bin/t/Makefile src/libr/bin/t/rabin2.c src/libr/include/r_asm.h description: * r_asm - Added parsing support - Added parser "pseudo" (dirty copy&paste) - Removed syntax "pseudo" from udis86 - Minor refactoring - Minor fixups in rasm2 * rabin2 now uses r_num changeset: 840:125a3bb07de0 user: pancake date: Sat Jan 24 22:47:41 2009 +0100 files: src/libr/core/cmd.c src/libr/include/r_search.h src/libr/search/search.c description: * Added fake commands 'w' and '/' in core * Added mode search changeset: 839:2816afbe6e3c user: pancake date: Sat Jan 24 21:07:10 2009 +0100 files: src/libr/search/binparse.c src/libr/search/t/test.c description: * Fix segfault in test program of r_search - First working version. API not yet stabilized changeset: 838:9253acf8b6bc user: pancake date: Sat Jan 24 20:57:15 2009 +0100 files: src/binparse.c src/libr/asm/t/asm_x86.c src/libr/asm/t/rasm2.c src/libr/include/r_search.h src/libr/search/Makefile src/libr/search/aes-find.c src/libr/search/binparse.c src/libr/search/bytepat.c src/libr/search/search.c src/libr/search/t/Makefile src/libr/search/t/test.c src/libr/util/num.c description: * Make r-search compile - Much more work required :P - Added a example test program that segfaults - Added aes-search inside r_search (not yet integrated) * Minor code indent for rasm2 changeset: 837:9a4387970e51 user: pancake date: Sat Jan 24 19:14:15 2009 +0100 files: src/libr/cons/cons.c src/libr/include/r_range.h src/libr/include/r_search.h src/libr/include/r_util.h src/libr/range/Makefile src/libr/range/range.c src/libr/search/Makefile src/libr/search/search.c src/libr/util/num.c description: * New libr module: "r_range" - Needs some cleanup but it is almost defined * Add r_cons_progressbar() to r_cons api * Some more work on r_search refactoring - Needs even more cleanup - Not yet defined - Lot of structures needs to change name - Integrate bytepat and esteve's search engine * Add r_num_minmax_swap helper in r_util changeset: 836:cbd01aba74e2 user: nibble date: Sat Jan 24 17:15:47 2009 +0100 files: src/libr/asm/arch/arm/asm.c src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/asm_x86.c src/libr/asm/t/disasm_x86.c src/libr/asm/t/rasm2.c src/libr/bin/t/rabin2.c description: * r_asm - Initial rasm2 implementation - Minor bug fixing - Remove unnecessary includes changeset: 835:ba092ed637f0 user: nibble date: Sat Jan 24 13:46:46 2009 +0100 files: src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/asm_x86.c src/libr/asm/t/disasm_arm.c src/libr/asm/t/disasm_x86.c src/libr/asm/t/test_arm.c src/libr/asm/t/test_x86.c src/libr/bin/t/rabin2.c src/libr/include/r_asm.h description: * r_asm - Add x86 assembly support using olly - Add assembly test * rabin2 - Aesthetic fixups changeset: 834:fadf69282565 user: pancake date: Fri Jan 23 11:29:53 2009 +0100 files: src/libr/include/r_search.h src/libr/include/r_util.h src/libr/search/binparse.c src/libr/search/search.c src/libr/util/Makefile src/libr/util/hex.c description: * More work on r_search - Not yet finished changeset: 833:e291ca31ca35 user: pancake date: Thu Jan 22 22:04:05 2009 +0100 files: src/libr/core/t/radare2.c src/libr/include/r_vm.h src/libr/io/README src/libr/io/undo.c src/libr/io/undo.h src/libr/print/print.c src/libr/vm/extra.c src/libr/vm/mmu.c src/libr/vm/reg.c src/libr/vm/setup.c src/libr/vm/vm.c description: * Initial compilable version of r_vm - Not yet tested - Fix lot of warning messages * Added undo.* in rio - Not yet integrated * Added lsbstego into r_print changeset: 832:b8c90a3ad8f3 user: pancake <@youterm.com> date: Thu Jan 22 19:53:14 2009 +0100 files: src/libr/include/r_vm.h src/libr/vm/Makefile src/libr/vm/extra.c src/libr/vm/mmu.c src/libr/vm/op.c src/libr/vm/reg.c src/libr/vm/setup.c src/libr/vm/stack.c src/libr/vm/vm.c description: * Lot of work on libr_vm - Not yet usable, stills not compiling - Major refactoring in C sucks :P changeset: 831:3c1f91e2cd23 user: pancake <@youterm.com> date: Thu Jan 22 11:51:05 2009 +0100 files: src/libr/core/cmd.c src/libr/core/core.c src/libr/core/t/radare2.c src/libr/macro/macro.c src/libr/util/str.c description: * Initial working implementation of macros - Pointers required maybe needs a bit of work * Check for ending '"' and ')' chars - Properly parse commands starting with '"' * Added -n flag to radare2 - Run ~/.radarerc by default * Added r_str_home() helper changeset: 830:55d688044fa3 user: pancake date: Thu Jan 22 11:57:54 2009 +0100 files: src/libr/core/cmd.c src/libr/core/core.c src/libr/core/t/Makefile src/libr/include/r_cons.h src/libr/include/r_core.h src/libr/include/r_print.h src/libr/include/r_vm.h src/libr/io/README src/libr/macro/macro.c src/libr/print/Makefile src/libr/print/format.c src/libr/print/print.c src/libr/vm/Makefile src/libr/vm/vm.c description: * Make the '.' command work happier - Add support for .() to call macros - Command '(' is now also working - Needs some fun pointers to be properly initialized * Added $$ and $b in r_num_callback * Added pr in help * Initial implementation of '#' using r_hash from core * Initial import of r_vm - Just c&p from r1..needs some work changeset: 829:375a0e8afbe5 user: pancake date: Thu Jan 22 02:46:48 2009 +0100 files: src/libr/include/r_lib.h src/libr/lib/Makefile src/libr/lib/lib.c src/libr/lib/t/Makefile src/libr/lib/t/test-plugin.c description: * Major refactoring over the initial design * Added support for destructors - Some structure and field renamings - More methods defined in .h - Build with -Wall - Optimization thru the use of pointers - Needs another review for simplification * Make the test program close and free all loaded plugins before exiting changeset: 828:e01213be6562 user: pancake date: Wed Jan 21 23:32:52 2009 +0100 files: src/libr/bin/t/rabin2.c src/libr/include/r_lib.h src/libr/lib/lib.c src/libr/lib/t/Makefile src/libr/lib/t/plugin.c src/libr/lib/t/test-plugin.c src/libr/stripsyms.sh description: * Fix stirpsyms for gentoo * Some syntax fixups for rabin2 * Initial working implementation of r_lib - Added a test program - Pointer to internal data not yet working at all changeset: 827:6969c38f1d27 user: nibble date: Wed Jan 21 20:59:39 2009 +0100 files: src/libr/bin/bin.c src/libr/bin/elf.c src/libr/bin/elf64.c src/libr/bin/pe.c src/libr/bin/t/Makefile src/libr/bin/t/rabin2.c src/libr/include/r_asm.h src/libr/include/r_bin.h src/libr/include/r_bin_elf.h src/libr/include/r_bin_elf64.h src/libr/include/r_bin_pe.h src/libr/include/r_bin_pe_specs.h description: * Add radare output to rabin2 changeset: 826:4f3d7a3cf4d0 user: pancake <@youterm.com> date: Tue Jan 20 20:10:14 2009 +0100 files: src/libr/Makefile src/libr/cons/cons.c src/libr/core/cmd.c src/libr/include/r_cons.h src/libr/print/print.c src/libr/stripsyms.sh description: * Add 'macro' in makefile build * Initial nonworking and ugly implementation of cons_pipe * Added r_cons_memcat and 'pr' command for r_print changeset: 825:546ca0a46e75 user: nibble date: Tue Jan 20 19:19:01 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/arm/asm.c src/libr/asm/arch/arm/gnu/ansidecl.h src/libr/asm/arch/arm/gnu/arm-dis.c src/libr/asm/arch/arm/gnu/bfd.h src/libr/asm/arch/arm/gnu/dis-asm.h src/libr/asm/arch/arm/gnu/symcat.h src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/test.c src/libr/asm/t/test_arm.c src/libr/asm/t/test_x86.c src/libr/core/core.c src/libr/include/r_asm.h description: * r_asm - Add initial arm support (needs more love) - Add new tests * r_core - Remove unnecessary include changeset: 824:863327273c45 user: nibble date: Tue Jan 20 13:27:37 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/udis86/syn-pseudo.c src/libr/asm/arch/x86/udis86/udcli/udcli.c src/libr/asm/t/test.c src/libr/core/cmd.c src/libr/core/core.c src/libr/core/t/Makefile src/libr/include/r_cons.h src/libr/include/r_core.h src/libr/include/r_flags.h src/libr/macro/Makefile src/libr/macro/macro.c src/libr/macro/macros.h description: * r_asm - Add pseudo syntax using udis86 - Remove unnecessary files * r_core - Remove some warnings - Partially Fix build * r_macro - Add Makefile - Remove macros.h changeset: 823:a1b09db6da5c user: pancake date: Tue Jan 20 13:07:32 2009 +0100 files: src/libr/asm/asm.c src/libr/core/cmd.c src/libr/core/core.c src/libr/include/r_core.h src/libr/include/r_macro.h src/libr/macro/macro.c src/libr/macro/macros.h description: * Added dummy macro and interpret commands for r_core * Initial implementation of r_macro - Needs testing and integration with r_core changeset: 822:16ef87931fdb user: nibble date: Tue Jan 20 11:59:53 2009 +0100 files: src/libr/asm/arch/x86/ollyasm/asmserv.c src/libr/asm/arch/x86/ollyasm/assembl.c description: * Ooops, add missing files changeset: 821:51665340300f user: nibble date: Tue Jan 20 11:56:56 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/ollyasm/disasm.c src/libr/asm/arch/x86/ollyasm/disasm.h src/libr/asm/asm.c src/libr/asm/t/test.c src/libr/include/r_asm.h description: * r_asm - Add r_asm_free - Add olly syntax for x86 - Huge dewarnification (olly code) changeset: 820:5f9fa04311bc user: nibble date: Tue Jan 20 03:58:27 2009 +0100 files: src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/include/r_asm.h description: * Fix r_asm build O:-) changeset: 819:f242a181f93a user: nibble date: Tue Jan 20 03:53:11 2009 +0100 files: src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/asm/t/test.c src/libr/core/cmd.c src/libr/include/r_asm.h description: * r_asm refactoring changeset: 818:fb3f69373af5 user: pancake date: Tue Jan 20 04:55:02 2009 +0100 files: src/libr/vapi/r_asm.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/asm.vala description: * Added r_asm vala api and test program changeset: 817:26a9c7a6e782 user: pancake date: Tue Jan 20 04:21:17 2009 +0100 files: src/libr/Makefile src/libr/core/cmd.c src/libr/core/config.c src/libr/core/core.c src/libr/core/t/Makefile src/libr/core/t/radare2.c src/libr/flags/flags.c src/libr/include/r_config.h src/libr/include/r_flags.h description: * Lot of work on radare2 (libr based) * Build r_asm by default - Initial pd command working * 'x' command accepts numeric argument * 'f' command working, f+ for adding * 'px-' shows hexdump without headers * Make radare2 test program open multiple files - Add -w and -e flags * Add r_flag_list and ..unset changeset: 816:10cac3656cf5 user: nibble date: Tue Jan 20 03:01:03 2009 +0100 files: src/libr/asm/arch/x86/asm.c src/libr/asm/asm.c src/libr/asm/t/test.c src/libr/include/r_asm.h description: * Move buf_asm & buf_hex into r_asm_t changeset: 815:817f2ba7ce1f user: nibble date: Tue Jan 20 02:44:28 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/arch/x86/asm.c src/libr/asm/arch/x86/ollyasm/disasm.c src/libr/asm/arch/x86/ollyasm/disasm.h src/libr/asm/arch/x86/udis86/LICENSE src/libr/asm/arch/x86/udis86/README src/libr/asm/arch/x86/udis86/decode.c src/libr/asm/arch/x86/udis86/decode.h src/libr/asm/arch/x86/udis86/extern.h src/libr/asm/arch/x86/udis86/input.c src/libr/asm/arch/x86/udis86/input.h src/libr/asm/arch/x86/udis86/itab.c src/libr/asm/arch/x86/udis86/itab.h src/libr/asm/arch/x86/udis86/syn-att.c src/libr/asm/arch/x86/udis86/syn-intel.c src/libr/asm/arch/x86/udis86/syn.c src/libr/asm/arch/x86/udis86/syn.h src/libr/asm/arch/x86/udis86/types.h src/libr/asm/arch/x86/udis86/udcli/udcli.c src/libr/asm/arch/x86/udis86/udis86.c src/libr/asm/asm.c src/libr/asm/t/Makefile src/libr/asm/t/test.c src/libr/bin/t/rabin2.c src/libr/include/r_asm.h description: * x86 support for r_asm :) changeset: 814:092c61e62303 user: pancake date: Tue Jan 20 03:11:09 2009 +0100 files: src/libr/config/config.c src/libr/core/cmd.c src/libr/core/config.c src/libr/core/visual.c src/libr/include/r_config.h src/libr/include/r_util.h src/libr/util/num.c description: * Lot of enhacements and new commands for radare2 - eval, flags, quit with args, !system, seek - support for: . internal grep ~ . temporary seek @ . internal cmd output subst `` . conditional commands now supported ?? ?! ?+ ?- (==0, !=0, >0, <0) - Added lot of help messages '?' everywhere - Support repeat prefix for commands (3x) - r_num_t now stores the comparision result - Used for conditional * Commands without arguments return numeric value * Define MIN, MAX, LESSTHAN and GREATERTHAN defines changeset: 813:3c35297f2e83 user: pancake <@youterm.com> date: Mon Jan 19 19:03:33 2009 +0100 files: src/libr/README src/libr/cmd/cmd.c src/libr/cmd/t/Makefile src/libr/cmd/t/test.c src/libr/cons/cons.c src/libr/core/core.c src/libr/core/t/radare2.c src/libr/flags/flags.c src/libr/include/r_cmd.h src/libr/include/r_core.h src/libr/include/r_io.h src/libr/include/r_util.h src/libr/io/io.c src/libr/io/section.c src/libr/io/t/Makefile src/libr/io/t/read4.c src/libr/rules.mk src/libr/util/str.c src/libr/vapi/r_socket.vapi src/libr/vapi/t/socket.vala description: * Rewrite 'libr' README * Add long command support for r_cmd * Fix bug in r_core related to seeking * Fix crash in r_flag_get * Fix vala socket example changeset: 812:7238036d3083 user: pancake date: Mon Jan 19 02:40:27 2009 +0100 files: src/libr/Makefile src/libr/print/Makefile description: * Build r_flags and r_print by default changeset: 811:4d141b319960 user: pancake date: Mon Jan 19 02:38:11 2009 +0100 files: src/libr/include/r_cmd.h description: * Oops for r_cmd build changeset: 810:038e7697fb89 user: pancake date: Mon Jan 19 02:34:57 2009 +0100 files: src/libr/vapi/r_socket.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/socket.vala description: * Added socket example - Crashing everytime changeset: 809:7d75819b583b user: nibble date: Mon Jan 19 01:08:49 2009 +0100 files: src/libr/bin/bin.c src/libr/bin/t/Makefile src/libr/bin/t/rabin2.c src/libr/include/r_bin.h description: * Initial implementation of rabin2 using r_bin changeset: 808:07b21a0c6224 user: pancake date: Mon Jan 19 02:11:07 2009 +0100 files: src/libr/cmd/cmd.c src/libr/cons/cons.c src/libr/core/Makefile src/libr/core/cmd.c src/libr/core/core.c src/libr/core/t/Makefile src/libr/core/t/radare2.c src/libr/core/visual.c src/libr/flags/Makefile src/libr/flags/flags.c src/libr/flags/name.c src/libr/flags/old_flags.c src/libr/flags/old_flags.h src/libr/include/r_cmd.h src/libr/include/r_core.h src/libr/include/r_flags.h src/libr/include/r_print.h src/libr/include/r_util.h src/libr/print/print.c src/libr/print/t/Makefile description: * Added null command callback for libr_cmd * Added basic support for command preprocessing - Supports '@' and '"' - Temporally seek works fine * Resolve numbers with flag names - Enhacements for the r_flags library - r_num_t is now initialized and used * Added p8 and px commands - Added r_print_bytes with format string - Initial nonworking 'f' command changeset: 807:3983b9bfb385 user: pancake date: Sun Jan 18 21:55:04 2009 +0100 files: doc/fortunes src/libr/Makefile src/libr/cmd/TODO src/libr/cmd/cmd.c src/libr/cmd/t/test.c src/libr/config/callback.c src/libr/config/config.c src/libr/cons/Makefile src/libr/cons/cons.c src/libr/cons/strsub.c src/libr/cons/t/Makefile src/libr/core/Makefile src/libr/core/cmd.c src/libr/core/config.c src/libr/core/core.c src/libr/core/file.c src/libr/core/t/Makefile src/libr/core/t/radare2.c src/libr/flags/Makefile src/libr/flags/flags.c src/libr/flags/old_flags.c src/libr/flags/old_flags.h src/libr/include/r_cmd.h src/libr/include/r_core.h src/libr/include/r_flags.h src/libr/include/r_radare.h src/libr/include/r_util.h src/libr/io/io.c src/libr/io/section.c src/libr/line/Makefile src/libr/line/dietline.c src/libr/line/t/Makefile src/libr/radare/Makefile src/libr/radare/radare.c src/libr/radare/t/Makefile src/libr/radare/t/radare2.c src/libr/util/str.c description: * Lot of work on libr - Initial radare2 test program in libr/core/t - Some basic commands (s, b, x, q) - r_cmd is working .. needs support for long commands - Lot of refactoring * Remove r_radare .. moved into r_core * Some recursive dependencies needs to be cleaned up - r_cons is not depending on r_line - uses dietline for everything (no readline for radare2) * Link test programs against object archives (.a) changeset: 806:d7c6584162f4 user: nibble date: Sun Jan 18 02:40:22 2009 +0100 files: src/search.c description: * fix search boundaries issue * remove useless warning changeset: 805:16cd084fcda8 user: nibble date: Sun Jan 18 02:04:23 2009 +0100 files: src/libr/asm/Makefile src/libr/asm/asm.c src/libr/bin/elf.c src/libr/include/r_asm.h description: * initial work on r_asm changeset: 804:add36c5d9140 user: pancake date: Sun Jan 18 03:06:37 2009 +0100 files: src/libr/cmd/Makefile src/libr/cmd/cmd.c src/libr/cmd/t/Makefile src/libr/cmd/t/test.c src/libr/config.mk src/libr/core/core.c src/libr/include/r_cmd.h src/libr/include/r_cons.h src/libr/include/r_core.h src/libr/include/r_print.h src/libr/include/r_radare.h src/libr/include/r_types.h src/libr/io/handle.c src/libr/io/map.c src/libr/print/print.c src/libr/print/t/Makefile src/libr/print/t/hex.c src/libr/radare/Makefile src/libr/radare/radare.c src/libr/radare/t/radare2.c src/libr/rules.mk src/libr/util/Makefile src/libr/util/str.c description: * Initial implementation of r_cmd with test * More work on r_radare and r_core * Added r_print_hexdump to r_print changeset: 803:8e1ed9377016 user: pancake <@youterm.com> date: Fri Jan 16 19:04:22 2009 +0100 files: src/cmds.c src/radare.c description: * Make 'f*' work as 'f *' does * Show helpful message when trying to interpret a non-existant radare script file changeset: 802:d32bbdd45b32 user: pancake <@youterm.com> date: Fri Jan 16 18:30:17 2009 +0100 files: src/libr/Makefile src/libr/include/r_util.h src/libr/util/Makefile src/libr/util/mem.c src/libr/util/num.c src/libr/util/re.c src/libr/util/t/Makefile src/libr/util/t/calc.c src/libr/util/t/test.c src/radare.c src/stripstr.c src/visual.c description: * Use portable flags for find(1) in libr make install * Twice-ESC quits from visual-insert mode (thx mandingo) * Added r_str_re for regular expression helpers * Fixups for stripstr for ranges - Starting getting hits from the begging - Properly get hits of ascii outside the first block - Rename 'unicode' as 'widechar' changeset: 801:40754edd72c0 user: pancake date: Fri Jan 16 12:23:58 2009 +0100 files: src/libr/Makefile src/libr/line/dietline.c src/libr/util/mem.c description: * Better make install for libr * Initial ^R support for r_line changeset: 800:13b09b3a2519 user: pancake date: Fri Jan 16 12:01:31 2009 +0100 files: TODO src/bytepat.c src/cmds.c src/radare.c src/radare.h src/stripstr.c src/utils.h description: * Added ranged search for /p pattern search engine * Added 'min length' and 'max length' limits for '/z' * Fix endian problem with /v changeset: 799:b7300e5770d3 user: pancake date: Fri Jan 16 04:22:18 2009 +0100 files: TODO description: * Small tip for /z in TODO changeset: 798:0dd3aa0480eb user: pancake date: Fri Jan 16 04:17:44 2009 +0100 files: src/config.c src/libr/Makefile src/libr/include/r_util.h src/libr/util/Makefile src/libr/util/mem.c src/libr/util/num.c src/libr/util/str.c src/libr/util/t/calc.c src/libr/util/t/rax2.c src/radare.c src/ranges.c src/ranges.h src/search.c description: * New config key "search.inar" - Search for /z and / /x .. using ranges defined by 'ar' - Thanks mandingo again for the ideas! * Added 'install' target for libr - installed at /tmp/libr-install - just for development - Initial working version of 'rax2' using r_util - Basic nested math expression support with ( and ) - Added test program with check failres for math exprs changeset: 797:29bc0d2e8725 user: pancake date: Fri Jan 16 00:59:08 2009 +0100 files: src/cmds.c src/libr/include/r_core.h src/libr/include/r_radare.h src/libr/include/r_util.h src/libr/radare/t/Makefile src/libr/radare/t/radare2.c src/libr/util/num.c src/libr/util/str.c src/libr/util/t/Makefile src/libr/util/t/calc.c src/libr/util/t/rax2.c description: * Initial import of r_radare * Added new command /v to search for values - Little and big endian support - Thanks mandingo for the idea! :) * Enhacements for the r_util API - stable numeric and string api - needs more love - Added some tests - extensible state based get value function * rax2 and radare2 will be implemented as test programs for libr changeset: 796:8b01b2397d20 user: pancake date: Thu Jan 15 11:45:19 2009 +0100 files: TODO src/libr/include/r_radare.h src/libr/io/README src/libr/io/desc.c src/libr/io/io.c src/libr/radare/Makefile src/libr/radare/radare.c src/vars.c description: * Some more work on the r_io module * Initial import of r_radare module - Will implement a full radare client into a library - Small c program will be enought to implement radare2 * Pseudofix var_add_access recursivity bug - Needs some love changeset: 795:16383ca6700b user: pancake <@youterm.com> date: Wed Jan 14 14:27:52 2009 +0100 files: src/search.c description: * Show searching ranges before search changeset: 794:3ab634a3ef37 user: pancake <@youterm.com> date: Wed Jan 14 14:19:01 2009 +0100 files: src/radare.c description: * Fix non-readline shell (thanks mandingo for the PR) - Multiline support non readline works now - Needs huge code cleanup changeset: 793:b3ac4fc29024 user: pancake <@youterm.com> date: Wed Jan 14 13:24:33 2009 +0100 files: Makefile.acr src/dbg/mem.c src/libr/vapi/t/Makefile src/rsc/pool/maps description: * Fix 'make' installation problems notified by mandingo - Buggy order while installing rsc files * Properly filter '+' char in maps flags in core and rsc changeset: 792:7f329936a6dd user: pancake date: Wed Jan 14 12:16:02 2009 +0100 files: src/rasign/Makefile src/rasign/main.c src/rasign/sign.c src/rasign/sign.h description: * Add make clean to rasign * Refactoring rasign to live inside libr (libr_sign) changeset: 791:aed4a04c7f8e user: pancake date: Wed Jan 14 02:50:23 2009 +0100 files: src/analyze.c src/cmds.c src/data.c src/data.h src/flags.c src/utils.c src/visual.c description: * Make function analysis store a single line for framesize info - Construct it with comma separated framesize changes * Make Vdu undefine functions - Runs .afu* cmd - Implement CF- command * Added $$b to get block size from utils - Minor optimitzation for get_offset * Added '/b' easter egg command * Show Vt '?' help message changeset: 790:5726a923ccd1 user: pancake date: Wed Jan 14 01:42:04 2009 +0100 files: src/bytepat.c src/libr/search/bytepat.c description: * Apply esteve's patch for bytepat.c - Do not show nested patterns (much more clean output :D) - Some code cleanup - Make use of search.from and search.to - Control read errors * Added bytepat into libr_search for future integration changeset: 789:351fe8f7042f user: pancake <@youterm.com> date: Tue Jan 13 17:54:33 2009 +0100 files: src/rasc/Makefile src/rasc/syscall.c src/rasign/Makefile src/rasign/main.c description: * Make syscall.c build with relative path access - Fix build for acr and waf * Import 'make' for dummy rasign changeset: 788:ac6937ff37cf user: pancake <@youterm.com> date: Tue Jan 13 13:47:29 2009 +0100 files: scripts/macros src/cons.c src/dietline.c src/libr/cons/cons.c description: * Added macro label example * Added support for negative column indexing in cons_grep - Shows column -N and the following - Sync r_cons * Drop label stuff for the basic shell - Only works for macros changeset: 787:363572569b5e user: pancake date: Tue Jan 13 12:53:39 2009 +0100 files: src/bytepat.c src/dietline.c src/print.c src/rasign/main.c description: * Initial draft for the new 'rasign' program - Radare Signature utility * Lot of fixups for the pattern matching search algo (/p) - Handle min/max sizes to avoid overflows - Fix output format for it changeset: 786:e8cfbe6a1c5f user: pancake date: Tue Jan 13 02:33:18 2009 +0100 files: TODO config.mk.acr src/cmds.c src/print.c src/radare.h src/rasc/Makefile src/rasc/syscall.c src/search.c description: * Add missing 'syscall.c' file to fix build of rasc --with-sysproxy - Thanks flux for the tip! * Enhacements in the search command '/' - /s has been renamed to /z (zero-end string search) - /s is now used to substitute strings (search+replace) - /S works like /s but for hexpair strings For example: > /s hello world TODO: no file resize yet :) * Fix scr.color=false bug when printing address at cursor - Non-colored shell works fine again changeset: 785:8fa329b44781 user: pancake <@youterm.com> date: Mon Jan 12 20:00:25 2009 +0100 files: src/Makefile.acr src/analyze.c src/cmds.c src/radare.c description: * Drop spaces in bytes dump for code and basicblock analysis * Added @@= iterator for multiple offsets - Can work with @@=` commands - Added @@? for help * sysproxy is not building properly changeset: 784:17f796126572 user: pancake date: Mon Jan 12 10:27:11 2009 +0100 files: TODO src/analyze.c src/arch/arm/disarm.c src/arch/x86/code.c src/cmds.c src/code.c src/config.c src/data.c src/dbg/arch/i386.c src/dbg/bp.c src/dbg/debug.c src/flags.c src/flags.h src/grava.c src/pas.c src/print.c src/section.c src/vars.c src/visual.c description: * Analyze some 32bit local stack access var opcodes on x86 - Ugly as shit.. needs cleanup * Make 'string_flag_offset' return multiple flags at the same time - Separated by comma: sym.main,eip: - Nicer disassembly for debugger * Do not truncate function bytes length - Code analysis is broken on on-disk mode (vaddr breaks everything :( changeset: 783:e36d5875f486 user: pancake date: Mon Jan 12 00:33:52 2009 +0100 files: TODO src/cmds.c src/cons.c src/radare.c src/readline.c src/visual.c description: * Added '\' end of line char to support multiline commands - Working on shell and visual mode * Fix autocompletion of !cont command (readline.c) * Note 'yt' in 'w?' help changeset: 782:758291281e53 user: pancake date: Sun Jan 11 16:47:20 2009 +0100 files: src/cons.c src/radare.c description: * Fix two issues while handling cons_grep and cons_pipe - Now file pipe can work with grep line or grep column - Count recursivity level to support pipes for '@@' foreach changeset: 781:de35b5e467a9 user: nibble date: Fri Jan 09 15:36:33 2009 +0100 files: src/libr/bin/elf.c description: * More love and refactoring for the elf section resizer changeset: 780:5b63ce2692f6 user: pancake <@youterm.com> date: Fri Jan 09 14:47:48 2009 +0100 files: src/libr/bin/elf.c src/libr/bin/t/rsz_test.sh src/libr/cmd/cmd.c src/libr/config/callback.c src/libr/config/config.c src/libr/config/t/Makefile src/libr/config/t/test.c src/libr/core/core.c src/libr/include/r_config.h src/libr/include/r_io_section.h src/libr/include/r_util.h src/libr/io/section.c src/libr/util/num.c src/libr/util/str.c src/libr/vapi/r_config.vapi description: * Working implementation of the ELF section resizer - Needs to be cleaned up (so many debug printfs everywhere) * Fixups for the r_config library - Less warnings - Test program is now compiling and working - r_util needs more love - Added new/free interface for it - vapi template for it (not yet done) * Added rwx property to rio_sections changeset: 779:4808a5aa94db user: pancake <@youterm.com> date: Fri Jan 09 13:04:16 2009 +0100 files: src/cmds.c src/libr/bin/elf.c src/libr/bin/t/data_resize.c src/libr/config/Makefile src/libr/config/callback.c src/libr/config/config.c src/libr/config/config.h src/libr/include/r_config.h src/libr/include/r_types.h src/rio.c src/section.h description: * Added documentation for the 'Sp' command - rio_write_at checks for section perms before writing - rio_write_at checks for undowrite config var - RWX is now handled as in UNIX 4+2+1 * Fix type warnings in r_bin/elf.c * Initial pseudo defined r_config API - Lot of code cleanup has been done - Needs more work changeset: 778:24660d2b35a4 user: nibble date: Fri Jan 09 10:15:11 2009 +0100 files: src/libr/bin/elf.c description: * r_bin_elf - more work on resize_section changeset: 777:cef58a465a52 user: nibble date: Fri Jan 09 03:22:21 2009 +0100 files: src/libr/bin/bin.c src/libr/bin/elf.c src/libr/bin/t/Makefile src/libr/bin/t/baddr.c src/libr/bin/t/data_resize.c src/libr/bin/t/entry.c src/libr/bin/t/imports.c src/libr/bin/t/info.c src/libr/bin/t/scn_resize.c src/libr/bin/t/sections.c src/libr/bin/t/symbols.c src/libr/include/r_bin.h src/libr/include/r_bin_elf.h description: * r_bin_elf - initial implementation of resize_section changeset: 776:f481467caa56 user: pancake date: Fri Jan 09 02:04:16 2009 +0100 files: src/cmds.c src/libr/cmd/Makefile src/libr/cmd/cmd.c src/libr/config/Makefile src/libr/config/config.c src/libr/config/config.h src/libr/config/deprecated.c src/libr/core/Makefile src/libr/core/core.c src/libr/include/r_cmd.h src/section.c src/section.h description: * Added trash code into libr * Added undocumented code in section.c for rwx perms - Needs to be integrated changeset: 775:eec60a85bd53 user: pancake <@youterm.com> date: Mon Jan 05 18:00:27 2009 +0100 files: scripts/fix-shoff.rs src/cmds.c src/cons.c src/macros.c src/radare.c src/search.c description: * Initial import of the fix-sht.rs script - Automagically fixes the section header pointer * Initial addition of the 's/' command to seek to the first coincidence for a hexpair or string keyword for example: "s/x 00" or "s/ lib" * Added ?! command to be a negated ?? conditional * Fix cons_stdin_fd problem - reinit after const init in palette (quick hack) needs more love - fixes a segfault in macro_add * Increase palloc in cons_strcat to avoid segfault when no color console changeset: 774:aaec2642ec1d user: pancake <@youterm.com> date: Mon Jan 05 14:46:56 2009 +0100 files: src/radiff/bytediff.c src/radiff/main.c description: * Added radiff -n (count changes) changeset: 773:df3a34f2b0f9 user: pancake date: Mon Jan 05 01:51:15 2009 +0100 files: src/libr/bin/elf.c src/rabin/aux.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c description: * Use LD_TRACE_LOADED_OBJECTS to get list of libraries - Hacky but functional for mangled shoff bins * Allow to load binaries where shoff is 0xffffffff - Maybe we are ignoring another case.. changeset: 772:8380e8e20f08 user: pancake date: Mon Jan 05 01:18:51 2009 +0100 files: src/libr/bin/elf.c src/libr/include/r_types.h src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c description: * Make dietelf handle mangled elf headers - Set shnum=0 if cannot read section headers - Set phnum=0 if cannot read program headers * Make rabin add ph and sh offsets - Stored inside 'elf' flagspace - Store offset of pointer and offset of struct * Show file:line in perror() for libr changeset: 771:1bdaa94d31fc user: pancake date: Sun Jan 04 05:37:03 2009 +0100 files: doc/xtra/segdump.S src/config.c src/flags.c src/print.c src/utils.c description: * Fix get_math issues with '[]' with math ops inside - Fix relative offset access inside brackets * Increase cfg.delta to 4096 by default * Fix pm X (string_flag was extending the higher bit) * More cleanup of segdump.S changeset: 770:36a091aca798 user: pancake date: Sat Jan 03 22:40:10 2009 +0100 files: TODO doc/xtra/segdump.S src/analyze.c src/cmds.c src/radare.c src/vm.c description: * Fix segdump.S to use .fill directive * Added 'afu' command to undefine functions - Makes the inverse process of .af* (.afu) - Needs more work (CF- is broken and CFv.- doesnt works) * Added 'avI' command to import reg values from flags 'vm.eax'.. - av* exports registers into the vm flagspace * Added '{' prefix for commands to repeat commands expr times: {[1:0x8048000]}x ; runs 'x' 0x7f times =) changeset: 769:f1dd86e4c7cb user: nibble date: Sat Jan 03 12:42:25 2009 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - fix context bug - more refactoring changeset: 768:63f0bf2fc4cf user: pancake <@youterm.com> date: Fri Jan 02 19:09:55 2009 +0100 files: src/libr/bin/t/symbols.c src/libr/include/r_socket.h src/libr/include/r_syscall.h src/libr/lib/lib.c src/libr/syscall/example.syscall-file src/libr/syscall/syscall.c src/libr/syscall/t/hello.c src/libr/vapi/r_socket.vapi src/libr/vapi/r_syscall.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/hash.vala src/libr/vapi/t/hello.vala src/libr/vapi/t/sc.vala src/rax.c description: * Initial vapi implementation for r_syscall and r_socket - Some minor refactoring to fit with gobject - Added vala syscall example * Final implementation for r_hash state calling conventions - Fix hash example (now digest can be calculated once) * Another minor code cleanup for rax(1) changeset: 767:451e591e52c1 user: pancake <@youterm.com> date: Fri Jan 02 17:49:52 2009 +0100 files: src/libr/hash/state.c src/libr/vapi/t/hello.vala src/rax.c description: * Make r_hash state api flush digest when init receives false and len is 0 - Sync example program * 'rax' ends up with \n when '-' is given as arg changeset: 766:a8fa52c02a9b user: pancake <@youterm.com> date: Fri Jan 02 15:11:27 2009 +0100 files: src/libr/hash/state.c src/libr/include/r_hash.h src/libr/syscall/darwin.o src/libr/syscall/freebsd.o src/libr/syscall/linux.o src/libr/syscall/netbsd.o src/libr/syscall/syscall.o src/libr/vapi/r_hash.vapi src/libr/vapi/t/hello.vala description: * Added init flag to r_hash state api - Sync with vapi and example - add Algorithm enum * OMFG! There are bin objects in the repo! changeset: 765:e34c1320b26c user: pancake <@youterm.com> date: Fri Jan 02 14:44:39 2009 +0100 files: src/libr/bin/Makefile src/libr/cons/Makefile src/libr/hash/Makefile src/libr/hash/init.c src/libr/hash/state.c src/libr/hash/t/hello.c src/libr/include/r_hash.h src/libr/io/Makefile src/libr/lib/Makefile src/libr/line/Makefile src/libr/rules.mk src/libr/socket/Makefile src/libr/stripsyms.sh src/libr/syscall/Makefile src/libr/vapi/r_hash.deps src/libr/vapi/r_hash.vapi src/libr/vapi/t/Makefile src/libr/vapi/t/hello.vala description: * Initial import of the vala api for r_hash * Added stripsyms.sh helper to strip out-of-namespace symbols for the different 'R' libraries. Used from rules.mk * Some refactoring for r_hash has been done changeset: 764:d600407b72a7 user: pancake date: Fri Jan 02 02:44:46 2009 +0100 files: src/libr/include/r_syscall.h src/libr/syscall/TODO src/libr/syscall/darwin.o src/libr/syscall/netbsd.o src/libr/syscall/syscall.c src/libr/syscall/syscall.o src/libr/syscall/t/hello.c description: * Make r_syscall API have a context argument - Avoid static library configurations changeset: 763:8a65d15c0bcf user: pancake date: Fri Jan 02 02:29:01 2009 +0100 files: src/libr/hash/Makefile src/libr/hash/entropy.c src/libr/hash/hash.c src/libr/hash/init.c src/libr/hash/md4.c src/libr/hash/md5.h src/libr/hash/md5c.c src/libr/hash/sha1.c src/libr/hash/sha1.h src/libr/hash/sha2.c src/libr/hash/sha2.h src/libr/hash/t/hello.c src/libr/include/r_hash.h description: * Full implementation of r_hash api - Standarized function groups into: - checksumming, hashing and algorithm - Needs code cleanup - Test example now checks for the hashing api changeset: 762:9ef3b2563224 user: nibble date: Thu Jan 01 22:37:42 2009 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - Add section and symbol diffing support - Major refactoring changeset: 761:da6299d88c58 user: pancake date: Wed Dec 31 23:13:46 2008 +0100 files: ChangeLog description: * Sync changelog for release 1.1 === 1.1 === changeset: 760:1ee333cdfd71 tag: tip user: nibble date: Wed Dec 31 12:48:35 2008 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - Add arch autodetection changeset: 759:700879c7799a user: nibble date: Wed Dec 31 12:23:35 2008 +0100 files: src/rabin/rabin.c src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - fix PE support changeset: 758:cac692f9f997 user: pancake date: Wed Dec 31 02:53:28 2008 +0100 files: src/libr/include/r_io_section.h src/libr/io/Makefile src/libr/io/io.c src/libr/io/section.c description: * Added vaddr/paddr support to r_io - Also added support for sections - Needs test changeset: 757:d442e8bb4369 user: pancake date: Mon Dec 29 03:35:20 2008 +0100 files: src/cmds.c description: * Fix a segfault for 'ax' command. changeset: 756:21c8d0172b35 user: pancake date: Mon Dec 29 03:27:10 2008 +0100 files: src/cmds.c src/rax.c description: * Remove 'aF' command. It makes the same as 'af' * Simplify a bit rax.c changeset: 755:cb24d3f0dbbe user: nibble date: Mon Dec 29 01:29:46 2008 +0100 files: src/cmds.c src/radare.c src/radiff/bindiff-ng/bindiff-ng src/radiff/main.c description: * bindiff-ng - add '-a arch' - add full context support with '-c -1' - get defaults from environment * radiff - minor fix * radare core - fix cc changeset: 754:f8da898df16e user: pancake date: Sun Dec 28 04:29:45 2008 +0100 files: doc/radare.but src/radiff/bindiff-ng/bindiff-ng src/radiff/main.c description: * Use color bindiff-ng from radiff by default * Added documentation for 'cc' command * Added documentation for the 'av' command - Virtual machine regs, code and mmu changeset: 753:519ffaf6c568 user: nibble date: Sun Dec 28 03:11:04 2008 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - Color output - Configurable context - Support for raw files changeset: 752:e26e32514e2a user: pancake date: Sun Dec 28 03:10:29 2008 +0100 files: doc/xtra/trk src/cmds.c src/plug/io/trk.c src/radare.c src/radare.h src/utils.c src/utils.h description: * Added 'cc' command for code compare - Uses radiff -c as backend * Some more enhacements for trk * Added 'file_dump' helper in utils.c changeset: 751:8e971d4842e3 user: nibble date: Sun Dec 28 01:58:04 2008 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - Context support changeset: 750:efd81e0da5fb user: pancake date: Sun Dec 28 02:31:22 2008 +0100 files: Makefile.acr src/plug/io/trk.c src/radiff/main.c tests/radare_test.rb wscript description: * Some more advances for the TRK IO plugin (symbian debugger) - Not yet working, interface is being started * Integrate bindiff-ng into radiff (-c flag) - Fix flag parsing bugs in radiff - Install bindiff-ng as rsc changeset: 749:ea906d4ed784 user: nibble date: Sat Dec 27 23:22:54 2008 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * bindiff-ng - Minor fix changeset: 748:12551baf1806 user: nibble date: Sat Dec 27 23:12:40 2008 +0100 files: src/radiff/bindiff-ng/bindiff-ng description: * radiff-ng - Initial working implementation changeset: 747:707f68fd67a7 user: pancake date: Sat Dec 27 22:36:57 2008 +0100 files: Makefile.acr src/analyze.c src/plug/hack/radare.rb src/plug/hack/ruby.c src/plug/io/trk.c src/utils.c tests/radare_test.rb description: * Apply brainstorm patch for ruby - Fix build on ubuntu and other systems - Add some tests for ruby * Initial import of trk.c io plugin - Just a sketch ( not working or implemented ) - Should be easy to do. (fork from serial://) * Show delta where framesize changes in comments when analyze changeset: 746:aa377fdb4302 user: pancake date: Sat Dec 27 21:21:59 2008 +0100 files: scripts/shell.ra src/cmds.c src/utils.c description: * Added pseudoshell in radare script * Added '?<' command to ask values to the user - The result is stored in '$$?' which is config.last_cmp changeset: 745:95aaeabaf30b user: pancake date: Sat Dec 27 20:58:45 2008 +0100 files: src/arch/x86/code.c src/config.c src/data.c src/data.h src/dbg/debug.c src/dbg/open.c src/flags.c src/main.c src/print.c src/vars.c description: * Fixes for the 'cmp' x86 opcode analysis - Fix local/arg bug and CFV support * Set CFV into cmd.vprompt2 - Show flag offset string as comment - default print format is hex 32bit dword * Fix var access list order in CFv * Implement support for format of var types (Cv) in CFV) - Initialize some var types in var_init * Fix config.file when using debugger+args changeset: 744:76e08d7c0a77 user: pancake date: Sat Dec 27 15:28:11 2008 +0100 files: src/analyze.c src/cmds.c src/data.c src/vars.c description: * Initial working implementation of the variable support - CFV: Code Function Variables: shows local vars and args of current function (previosly analyzed Vdf or .aF) - Uses 'ebp'-delta by default for x86 * Creates new variables within function bounds on access - Supports get/set - Defaults to int32 variables * Integrate code analysis with variables facilities changeset: 743:e5e517334d54 user: pancake date: Wed Dec 24 15:40:29 2008 +0100 files: TODO src/config.c src/dbg/debug.c src/visual.c description: * Added dbg.contsc2 (true by default) - Makes dupped !contsc to avoid contsc before syscalls - Needs more love * Make F4 key in visual continue until cursor if cursor mode is enabled. changeset: 742:2880e1ace414 user: pancake date: Wed Dec 24 15:21:56 2008 +0100 files: src/cmds.c src/vm.c description: * Added 'avrt' command to list variable types changeset: 741:71f805d17272 user: pancake date: Wed Dec 24 15:05:21 2008 +0100 files: src/cons.c src/vm.c description: * Fix 'call' opcode declaration for 'avo' - $$ -> $$$ for opcode size * Make scr.grephigh work * Make ~* grephigh work * Fix str_replace helper (not segfaulting anymore :) changeset: 740:fab66f7642d8 user: nibble date: Wed Dec 24 13:22:34 2008 +0100 files: src/radiff/bsdiff-4.3/bspatch.c description: * bsdiff - Experimental radiff like output changeset: 739:5f9ce8c9e429 user: pancake date: Wed Dec 24 04:18:01 2008 +0100 files: src/cmds.c src/config.c src/cons.c src/rio.c src/vm.c description: * Added 'wo2' and 'wo4' for 2 and 4 byte endian swap - write operation command * Added 'grephigh' experimental feature - Usable with ~*highword - Added new str_replace to replace gnu's strsub * Fix $$ and $$$ meanings in vm code changeset: 738:8f9e08216143 user: pancake date: Tue Dec 23 18:56:55 2008 +0100 files: src/analyze.c src/dbg/arch/arm.c src/dbg/arch/arm.h src/dbg/libps2fd.h src/dbg/objects.mk src/main.c src/plug/io/bfdbg.c src/plugin.h description: * Fixes for CH3S NAS ARM5 Linux - Added initial nonworking implementation for arm-mprotect * Enhacements for the arm debugger (syscall and regs facilities) * Get and set cpu and fpu registers (r##) (f##) - Added support for some aliases 'pc', 'lr', 'sp, 'ip', 'cpsr' * Fix build for non-debugger changeset: 737:b468117209ea user: pancake date: Mon Dec 22 01:50:54 2008 +0100 files: src/radiff/bsdiff-4.3/Makefile src/radiff/bsdiff-4.3/bsdiff.c src/radiff/bsdiff-4.3/bspatch.c description: * Fix build and usage message for bsdiff changeset: 736:ab5829401df2 user: pancake date: Mon Dec 22 01:41:30 2008 +0100 files: src/dbg/arch/x86_64.c description: * Apply erg0t patches for x86-64 debugger - fpu related.. sync with i386 code changeset: 735:04fb955e62d6 user: pancake date: Sat Dec 20 21:05:59 2008 +0100 files: src/radiff/bsdiff-4.3/Makefile src/radiff/bsdiff-4.3/README src/radiff/bsdiff-4.3/bsdiff.1 src/radiff/bsdiff-4.3/bsdiff.c src/radiff/bsdiff-4.3/bspatch.1 src/radiff/bsdiff-4.3/bspatch.c description: * Initial import of the bsdiff and bspatch utilities - Not yet linked with radiff :) changeset: 734:89d6ebf638ac user: pancake date: Sat Dec 20 19:23:09 2008 +0100 files: src/analyze.c src/flags.c src/rabin/rabin.c src/rio.c src/section.c description: * Initial pseudo working implementation of vaddr+paddr - Tested on esteve's minickme.exe for ARM-WCE * Adapt flags and analyze...but should work different - Needs more love changeset: 733:295ee586534c user: pancake date: Sat Dec 20 18:46:58 2008 +0100 files: src/cmds.c src/radare.h src/rio.c src/vm.c description: * Added vm.realio to choose real write or cached for the VM * Added support for '$$' in evals * Make the VM work again with real writes and virtual opcodes - vm_get_reg now works with end ']' * Define some default opcodes for x86 arch (call, ret ...) * Added cleaner debug output (needs more cleanup) * 'avra' lists all defined register aliases changeset: 732:8d74dd57c0a7 user: pancake date: Sat Dec 20 16:54:43 2008 +0100 files: src/config.c src/pas.c src/vm.c src/vm.h description: * Added vm.realio to allow write memory changes - Added vm_mmu_real() to select real or cached modes - 'ret' opcode is not working..emulation is broken now changeset: 731:2133d629d39b user: pancake date: Sat Dec 20 16:32:36 2008 +0100 files: doc/radare.but src/analyze.c src/arch/arm/gnudisarm.c src/cmds.c src/code.c src/config.c src/config.h src/data.c src/dbg/debug.c src/environ.c src/flags.c src/grava.c src/print.c src/rabin/rabin.c src/radare.c src/rio.c src/section.c src/section.h src/stripstr.c src/utils.c src/visual.c description: * Rename file.baddr into io.vaddr - Base address is now known as Virtual Address - A new io.paddr has been added for Physical Address - Sections code has been partially updated to support this. - You can just use these vars to hardcode it - Sync part of the documentation * Accelerate asm.section resolution - Handles from-to ranges for this section - Only updates when necessary (much faster!) * Fix build O:) * Reindent config.c with tabs * Enhaced 'e' .. now 'e str.' is the same as 'e str' - Lists eval config vars starting with 'str' * Added dbg.stepo to make !contu work with step into or step over - Fixes !contu when starting outside the user code (ld.so f.ex) changeset: 730:0e9f21845b85 user: pancake date: Sat Dec 20 05:23:34 2008 +0100 files: TODO src/flags.c src/libr/config.mk src/libr/rules.mk src/libr/syscall/freebsd.o src/libr/syscall/linux.o src/vm.c description: * Added few default opcodes * FLAGSPACES=32 changeset: 729:aae9ee1b4586 user: pancake date: Sat Dec 20 05:12:11 2008 +0100 files: src/section.c description: * Show ondisk section info in section list command changeset: 728:3a8283fc8c51 user: pancake date: Sat Dec 20 05:05:34 2008 +0100 files: src/cmds.c src/libr/bin/pe.c src/rio.c src/section.c src/section.h src/vm.c description: * Added 'Sd' to define ondisk access offset for sections - added 'ondisk' attribute - Thanks esteve! :D - On the way to fix the problems with PE RVA's * rio.c: radare_seek now uses section-align before seeking * Fix PE-THUMB problem in libr/bin * Added support for 8,16,32,64 read and write eval operations for the virtual machine. > ave eax=[8:0x8048000] changeset: 727:ec0af28a3d92 user: pancake date: Sat Dec 20 04:23:34 2008 +0100 files: Makefile.acr config.mk.acr configure configure.acr src/analyze.c src/cmds.c src/cons.c src/libr/cons/cons.c src/libr/syscall/freebsd.c src/libr/syscall/linux.c src/print.c src/rabin/dietpe.c src/readline.c src/vm.c src/vm.h tests/Makefile description: * Fix ${INSTALL} path problem (thanks erg0t) * Added 'avo' command to manage opcodes - add, list opcodes - Allows to generate new userdefined opcodes - Semi replaces the pas functionality * Remove 'time' in tests/ * Fix greptoken bug f~[0] now works * Make !bp autocomplete with flags (readline) * Documentate the X format for pm command * Fix THUMB PE binaries support for dietpe in rabin changeset: 726:8f72dcbcc28e user: pancake <@youterm.com> date: Thu Dec 18 20:02:26 2008 +0100 files: src/code.c src/cons.c src/io.c src/libr/cons/cons.c src/libr/cons/strsub.c src/libr/include/r_io.h src/libr/io/io.c src/libr/io/map.c src/libr/line/TODO src/libr/syscall/darwin.o src/libr/syscall/freebsd.o src/libr/syscall/linux.o src/libr/syscall/netbsd.o src/libr/syscall/syscall.o src/visual.c description: * Added grepneg with ~! into cons and libr_cons * Fix some signatures in r_io - Added r_io_size() to return maximum size for a fd * Added 'm' and ''' chars in visual like in vim (mark and go) changeset: 725:102292b65b84 user: pancake <@youterm.com> date: Thu Dec 18 17:28:24 2008 +0100 files: src/libr/Makefile src/libr/cons/cons.c src/libr/hash/Makefile src/libr/hash/t/Makefile src/libr/hash/t/hello.c src/libr/include/r_io.h src/libr/include/r_search.h src/libr/include/r_socket.h src/libr/include/r_syscall.h src/libr/include/r_types.h src/libr/io/Makefile src/libr/io/io.c src/libr/io/map.c src/libr/rules.mk src/libr/search/Makefile src/libr/search/search.c src/libr/socket/socket.c src/libr/syscall/darwin.c src/libr/syscall/freebsd.c src/libr/syscall/linux.c src/libr/syscall/netbsd.c src/libr/syscall/syscall.c src/radare.c description: * Create default ~/.radarerc if does not exists - Thanks jfv for the tip :) * Some build fixups on libr - Added some missing include files - Added test for r_hash using r_io - Use -Wall by default - Fix build for r_cons * Initial dummy r_search interface (not yet implemented) * Some redesign for r_syscall changeset: 724:dd11208a4978 user: pancake date: Thu Dec 18 11:14:02 2008 +0100 files: src/libr/Makefile src/libr/config.mk src/libr/io_plugins/README src/libr/rules.mk src/libr/socket/Makefile src/libr/socket/socket.c src/libr/syscall/syscall.o src/libr/tests.mk description: * Added r_socket and r_io_plugins * Dummy config.mk for libr changeset: 723:a6c18520673b user: pedro@dhcp-237.fluendo.lan date: Wed Dec 17 15:40:49 2008 +0100 files: src/plug/io/gdbwrap.c src/plug/io/libgdbwrap/include/revm.h description: * Fix build on osx changeset: 722:e0ab1a594cae user: pancake <@youterm.com> date: Wed Dec 17 14:04:46 2008 +0100 files: Makefile.acr src/cmds.c src/plug/io/gdbwrap.c src/plug/io/libgdbwrap/client.c src/plug/io/libgdbwrap/gdbwrapper.c src/plug/io/libgdbwrap/include/gdbwrapper-internals.h src/plug/io/libgdbwrap/include/gdbwrapper.h src/plug/io/libgdbwrap/include/revm.h src/rio.c description: * Source-sync with ERESI's gdbwrap library - Sync gdbwrap arg order * Do not build libusbsniff when --without-usb.. * Use alloca in radare_seek - Be more restrictive changeset: 721:a492cfcab48f user: nibble date: Wed Dec 17 14:00:57 2008 +0100 files: src/libr/bin/bin.c src/libr/bin/elf.c src/libr/bin/pe.c src/libr/bin/t/scn_resize.c src/libr/include/r_bin.h src/libr/include/r_bin_elf.h src/libr/include/r_bin_pe.h description: * r_bin - Adds get_section_rva, useful for PE bins * r_bin_elf, r_bin_pe - Fixes minor bugs - Minor refactoring changeset: 720:73c29d2c53e0 user: pancake <@youterm.com> date: Wed Dec 17 12:49:02 2008 +0100 files: doc/xtra/vmware-gdbwrap src/config.c src/dbg/system.c src/libr/bin/bin.c src/libr/bin/elf.c src/libr/bin/pe.c src/main.c src/radare.c description: * Added bouncer helper script for vmware debugging * Added cfg.debug (can be changed in runtime :D) - The -d flag is now just setting cfg.debug to true - Any IO layer can be manually defined to be a debug * Syntax and indent fixups for libr.bin - Some minor cleanup and added few tips changeset: 719:4d7b78dc02ae user: nibble date: Wed Dec 17 03:23:50 2008 +0100 files: src/libr/bin/bin.c src/libr/bin/elf.c src/libr/bin/t/Makefile src/libr/bin/t/info.c src/libr/bin/t/scn_resize.c src/libr/include/r_bin.h src/libr/include/r_bin_elf.h description: * r_bin - Adds get_section_size and get_section_offset - Adds "class" in r_bin_info - Dummy section resizing example using libr_bin * r_bin_elf - Minor refactoring changeset: 718:9e7b0d94efbc user: nibble date: Wed Dec 17 01:10:30 2008 +0100 files: src/libr/bin/bin.c src/libr/bin/pe.c src/libr/bin/t/Makefile src/libr/bin/t/info.c src/libr/bin/t/sections.c src/libr/include/r_bin.h src/libr/include/r_bin_pe.h description: * libr_bin - Add get_info function - Add examples changeset: 717:fe3e57b67a36 user: pancake <@youterm.com> date: Mon Dec 15 17:56:25 2008 +0100 files: TODO doc/xtra/vmware-gdbwrap src/code.c src/objects.mk src/plug/io/gdbwrap.c src/print.c description: * Added documentation for connecting to vmware/gdb * Added cont, info, help, stop, bp commands to gdbwrap plugin * Added variable based 'pm' repeater using brackets - pm {ecx/8}xx @ esi changeset: 716:b20f1af2515c user: pancake <@youterm.com> date: Mon Dec 15 16:10:02 2008 +0100 files: TODO doc/xtra/macho doc/xtra/sparc src/objects.mk src/plug/io/gdbwrap.c src/plug/io/libgdbwrap/Makefile src/plug/io/libgdbwrap/README src/plug/io/libgdbwrap/client.c src/plug/io/libgdbwrap/gdbwrapper.c src/plug/io/libgdbwrap/include/gdbwrapper-internals.h src/plug/io/libgdbwrap/include/gdbwrapper-stddef.h src/plug/io/libgdbwrap/include/gdbwrapper.h src/plug/io/libgdbwrap/include/libaspect.h src/plug/io/libgdbwrap/include/libe2dbg.h src/plug/io/libgdbwrap/include/revm.h src/plug/io/libgdbwrap/interface.c src/plug/io/wscript_build src/plugin.c src/plugin.h src/radare.c description: * Initial import of gdbwrapper ERESI's library - 'make sync' to keep in sync with eresi source - Added gdbwrap:// URI to connect to gdb using gdbwrap api - makes gdb-server segfault easily LOL! - move gdb and gdbx * Added missing docu for macho and sparc changeset: 715:9730ffd788f1 user: pancake date: Mon Dec 15 12:33:35 2008 +0100 files: src/vars.c src/xrefs.c description: * Mostly implemented the raw variable access user interface - CF[aAv][gs] - arg,fastarg,var - get,set changeset: 714:6b06820914cb user: pancake date: Mon Dec 15 02:18:23 2008 +0100 files: src/cmds.c src/vars.c description: * Added better CFv list (function variables) - CFv is working now - Supports arrays, needs some better help messages - Lot of parsing changeset: 713:bb94db9ca03b user: pancake date: Mon Dec 15 01:04:25 2008 +0100 files: src/analyze.c src/arch/x86/code.c src/cmds.c src/code.c src/code.h src/dbg/debug.c src/vars.c description: * Add 'from' address to analyze_function * Fixups for the get/set var code analysis on x86 - Other fixups for code analysis * Proper function-length detection with Vdf * Pseudofix for framesize comment changeset: 712:eb3b58c21092 user: pancake date: Sun Dec 14 15:12:22 2008 +0100 files: src/cmds.c src/data.c src/data.h src/objects.mk src/vars.c src/wscript_build description: * Added 'vars' into waf and make * Initial base code for variable definition - Needs more love and a bit of rethinking - Initial draft for variable access tracking - Cv, CF? .. changeset: 711:1c37027a7394 user: pancake date: Thu Dec 11 23:22:55 2008 +0100 files: TODO dist/maemo/Makefile src/cmds.c src/data.c src/libr/syscall/syscall.c src/utils.h src/vars.c description: * Initial dummy code for variable support - Must think more on the design * Do not install bindiff on maemo changeset: 710:5474887ca96a user: pancake date: Thu Dec 11 11:05:08 2008 +0100 files: AUTHORS src/cmds.c src/radare.c description: * Use alloca in _cmd() -- faster and safer * Added '"' quoted prefix for commands to disable '>,|,@,`,&' pipes changeset: 709:8fda74e6b421 user: pancake date: Wed Dec 10 22:32:30 2008 +0100 files: src/cmds.c src/libr/syscall/TODO src/print.c src/radare.c src/vm.c src/vm.h description: * Fix get/set for subregisters (ax/ah/al) * Fix 'pm' issue when giving field names * Added some more help for 'av' command * Allow type grepping for 'avr' changeset: 708:4de8ccdde652 user: pancake date: Tue Dec 09 12:23:33 2008 +0100 files: src/cmds.c src/radare.c src/vm.c description: * Added 'avf' to evaluate expressions from a file * Fixed '>' and '<' usage for 'ave' command (hacky way) * Fixed math expressions, multiple concatenated exprs too * Fix infinite loop for get/set expressions * Added 'al' and 'ah' aliased registers * Fix a parsing bug in 'av' command changeset: 707:e2844c6a680c user: pancake date: Mon Dec 08 20:20:51 2008 +0100 files: src/vm.c src/vm.h description: * Added mmu_cache for writes * Added basic reg-alias for get/set evals - Added pseudo 'al' register (not yet working) - Work in progress commit ... O:) changeset: 706:4954519ffc86 user: pancake date: Mon Dec 08 04:34:51 2008 +0100 files: src/libr/Makefile src/libr/syscall/Makefile src/libr/syscall/TODO src/libr/syscall/darwin.c src/libr/syscall/darwin.o src/libr/syscall/freebsd.c src/libr/syscall/freebsd.o src/libr/syscall/linux.c src/libr/syscall/linux.o src/libr/syscall/netbsd.c src/libr/syscall/netbsd.o src/libr/syscall/syscall.c src/libr/syscall/syscall.o src/libr/syscall/t/Makefile src/libr/syscall/t/hello.c description: * Initial import of libr.syscall - Stable api for getting information from syscall numbers and strings - Should be used from the core and the debugger - Added test program changeset: 705:9ebce7835c1e user: pancake date: Mon Dec 08 03:58:56 2008 +0100 files: src/pas.c src/vm.c src/vm.h description: * Added cmovl opcode for pas.x86 * Added 'cmp' and 'jz/jnz' opcodes to the VM - cmp uses vm_cpu.zf. * Added 'ifnot' pseudo-preprocessor assembly directive for conditional opcodes * Added 'ret' opcode. - Stack access stills being 'real' * Fix track of disassembly by using 'pd 1 @ pc' changeset: 704:5c9068bb15c4 user: pancake date: Mon Dec 08 03:30:26 2008 +0100 files: TODO src/cmds.c src/code.c src/rio.c src/vm.c src/vm.h description: * Initial pseudo working implementation of the VM with real code - Added peek and poke from memory using '[]' expressions > avr eax = [0x8048000] > avr [ebp-4]=0x33 - Stack access is not emulated yet. (should be previously dumped) - Aims to support multiple function calling systems - Aims to implement syscalls for asm.os and asm.arch - Implemented jmp, call and syscall psuedoopcodes - All basic arithmetic and logical operations are now supported - vm_get_math +-*/%&|^ - Allow to add and remove registers in runtime (avr+, avr-) > avr+ eax int32 > avr+ rip int64 - Added 'avx' command that emulates using pas_aop with pseudo - Not yet working at all (udis pseudo-disasm is broken) changeset: 703:0ba49e9cb104 user: pancake date: Sat Dec 06 19:28:06 2008 +0100 files: Makefile.acr TODO src/dbg/debug.c src/ranges.c src/ranges.h description: * Added some missing rmfiles for make deinstall (thx ianis!) * Initial implementation of the touchtrace with ranges (!ttr) - !tt is the same as before * Minor optimization for debug_trace() * Added indirect enhacements for the ranges api changeset: 702:8c9657e7c8c1 user: pancake <@youterm.com> date: Fri Dec 05 17:12:18 2008 +0100 files: TODO src/cmds.c src/config.c src/dbg/debug.c src/ranges.c src/vm.c src/vm.h description: * Make 'av' command happy with vm.c - Basic register allocation and asignation for the vm - Soon will be integrated with PAS to evaluate real code changeset: 701:e8d9f1b7a49f user: pancake date: Fri Dec 05 10:49:18 2008 +0100 files: src/config.c description: * dbg.regs2 is false by default changeset: 700:6672af4def37 user: pancake date: Fri Dec 05 10:48:56 2008 +0100 files: doc/xtra/segdump.S doc/xtra/x86-flags src/config.c src/dbg/arch/i386-bsd.h src/dbg/arch/i386-linux.h src/dbg/arch/i386-linux64.h src/dbg/arch/i386.c src/dbg/system.c src/radare.c src/rasm/olly.c description: * Added $FROM to dumpseg.S * Added !reg2 to show segment registers on x86 - Linux and BSD support atm * Fixed ollydbg assembler with 'rasm -a olly' changeset: 699:649c89c9109e user: pancake <@youterm.com> date: Thu Dec 04 16:22:38 2008 +0100 files: src/cmds.c src/config.c src/cons.c src/libr/cons/cons.c src/rio.c src/undo.c description: * Initial implementation of 'wm' - Binary write mask (f.ex: wm ff00ff) * Added file.undowrite toggle to disable undos * Merged grepcounter into libr.cons changeset: 698:8cf0aa4314f4 user: pancake <@youterm.com> date: Thu Dec 04 13:14:22 2008 +0100 files: TODO src/cmds.c src/code.c src/cons.c description: * Fix indentation of command help messages * Apply Nibble patch partially fixing 'pas' * Added help for 'q' command. (q?) * Added line counter in cons_grep as ~? - f~? = 740 - f~?sym = 80 changeset: 697:aa11fbcb3f63 user: nibble date: Thu Dec 04 01:39:25 2008 +0100 files: src/libr/bin/elf.c description: * r_bin_elf - fix r_bin_elf_get_symbols changeset: 696:0e9d75825f8c user: pancake <@youterm.com> date: Wed Dec 03 19:55:08 2008 +0100 files: src/config.c src/data.c src/data.h src/dbg/debug.c src/trace.c src/undo.c src/utils.c description: * Added cmd.touchtrace - Fixed "Displaying..." message index * Added $$F and data_prev helper for it * Added undo_get_last_seek() helper for $$l * Added $$e for end of basic block boolean check changeset: 695:91c99bceed8f user: pancake <@youterm.com> date: Wed Dec 03 14:05:26 2008 +0100 files: TODO src/cmds.c src/code.h src/radare.h src/ranges.c src/trace.c description: * Initial implementation of the 'att' command - Analyze Trace Tag set. Receives a number as argument. - Tag is one bit of 64. - Each trace is tagged when added or modified - Tag is used as filtering for trace processing * Added trace_sort() * Display total unused bytes in arb (boolean ranges) changeset: 694:a9db358fca83 user: pancake date: Wed Dec 03 10:46:39 2008 +0100 files: src/dbg/debug.c description: * Port touchtrace to mips and arm * Initial rethink for ranging support changeset: 693:64b51eb7b62d user: pancake date: Wed Dec 03 10:34:21 2008 +0100 files: src/config.c src/ranges.c src/ranges.h description: * Full implementation of ranges - Added 'ari' command to import ranges - Uses range.trace,graphs,functions - Working implementation of ranges_boolean() - Added ranges_sort() - Caches changes in ranges list to avoid unnecesary sorts - Added ar% (percentatge visual ranges) changeset: 692:2e9fdc583d27 user: pancake <@youterm.com> date: Tue Dec 02 19:59:47 2008 +0100 files: src/cmds.c src/config.c src/dbg/arch/i386.c description: * Added 'dbg.btlast' to avoid ultra-large backtraces * Use graph.depth only for 'ac', not for a* changeset: 691:48d476760ad7 user: pancake <@youterm.com> date: Mon Dec 01 19:46:14 2008 +0100 files: src/hist.c src/libr/cons/Makefile src/libr/cons/cons.c src/libr/cons/strsub.c src/libr/cons/t/hello.c src/libr/include/r_cons.h src/libr/include/r_line.h src/libr/line/Makefile src/libr/line/TODO src/libr/line/dietline.c src/libr/line/dietline.h src/libr/line/t/Makefile src/libr/line/t/hello.c src/libr/rules.mk src/libr/tests.mk src/objects.mk src/ranges.c src/ranges.h src/utils.c src/wscript_build description: * Remove unused/deprecated hist.c * Fix ignored error for libr * Initial working implementation of r_cons and r_line - Added hello world examples for both - r_line depends on r_cons - r_cons is independent - We need to optionally link against readline * Some minor fixups for ar command - arm -> merge ranges - fixups for ranges_sub - str_grep is now handling '*' endchar changeset: 690:e8211d1a6dc8 user: nibble date: Mon Dec 01 13:16:36 2008 +0100 files: src/libr/bin/Makefile src/libr/bin/bin.c src/libr/bin/dietelf.c src/libr/bin/dietelf64.c src/libr/bin/dietpe.c src/libr/bin/elf.c src/libr/bin/elf64.c src/libr/bin/pe.c src/libr/bin/t/sections.c src/libr/include/r_bin.h src/libr/include/r_bin_dietelf.h src/libr/include/r_bin_dietelf64.h src/libr/include/r_bin_dietelf_static.h src/libr/include/r_bin_dietelf_types.h src/libr/include/r_bin_dietpe.h src/libr/include/r_bin_dietpe_static.h src/libr/include/r_bin_dietpe_types.h src/libr/include/r_bin_elf.h src/libr/include/r_bin_elf64.h src/libr/include/r_bin_elf_specs.h src/libr/include/r_bin_pe.h src/libr/include/r_bin_pe_specs.h src/libr/rules.mk description: * r_bin - r_bin_dietelf -> r_bin_elf - r_bin_dietpe -> r_bin_pe - merge headers * libr - fix .a generation changeset: 689:af97306bf150 user: pancake <@youterm.com> date: Mon Dec 01 11:08:31 2008 +0100 files: src/libr/Makefile src/libr/bin/Makefile src/libr/bin/bin.c src/libr/bin/dietelf.c src/libr/bin/dietelf64.c src/libr/bin/dietpe.c src/libr/bin/t/Makefile src/libr/bin/t/baddr.c src/libr/bin/t/entry.c src/libr/bin/t/imports.c src/libr/bin/t/sections.c src/libr/bin/t/symbols.c src/libr/include/r.h src/libr/include/r_bin.h src/libr/include/r_bin_dietelf.h src/libr/include/r_bin_dietelf64.h src/libr/include/r_bin_dietelf_static.h src/libr/include/r_bin_dietelf_types.h src/libr/include/r_bin_dietpe.h src/libr/include/r_bin_dietpe_static.h src/libr/include/r_bin_dietpe_types.h src/libr/include/r_bin_elf.h src/libr/include/r_bin_pe.h description: * Import r_bin library patch from Nibble - Mostly working implementation for ELF32/64 and PE - Added some usage examples changeset: 688:a144de1069a3 user: pancake <@youterm.com> date: Fri Nov 28 20:06:09 2008 +0100 files: src/plug/hack/Makefile src/plug/hack/mkruby.rb wscript description: * Rename libruby.so to ruby.so * Fix again the installer for ruby changeset: 687:bbd8e11e4079 user: pancake <@youterm.com> date: Fri Nov 28 19:17:19 2008 +0100 files: Makefile.acr src/rsc/Makefile wscript description: * Theorically fix the build order bug for make * Ignore --without-ruby wscript option (brainstorm test plz :) * Finally fix the make+rsc install problem changeset: 686:4090cd869adb user: pancake <@youterm.com> date: Fri Nov 28 19:00:36 2008 +0100 files: src/plug/hack/wscript_build src/rsc/Makefile wscript description: * Fix ruby plugin build+install for waf (thx brainstorm!) * FIx make+rsc install changeset: 685:a39705ea8d40 user: pancake <@youterm.com> date: Fri Nov 28 17:11:43 2008 +0100 files: TODO src/cmds.c src/data.c src/dbg/debug.c src/ranges.c src/trace.c description: * Update TODO * Added 'atr' to import traces as ranges * Simplify CF grep * Added data_list_ranges changeset: 684:98a637cbcc24 user: pancake <@youterm.com> date: Fri Nov 28 16:44:06 2008 +0100 files: src/cmds.c src/cmds.h src/config.c src/main.h src/rabin/rabin.c src/ranges.c src/ranges.h src/rdb.c description: * Use / splitter for rabin -o * Use graph.depth for 'ac' by default * Refactor 'g' command usage. - gr outputs ranges - gr* outputs range commands (basic block byte ranges) * Added missing ranges.h * Make ranges api work independently from the owned ranges linked list - fix a bug about dupped items - Added ar-* to reset ranges table - Added ar* to output in ar+ format changeset: 683:217210eeb91b user: pancake date: Fri Nov 28 11:01:27 2008 +0100 files: TODO description: * Added todo tip to import trace, func and graph info into ranges changeset: 682:84a42413b070 user: pancake date: Fri Nov 28 10:58:12 2008 +0100 files: src/cmds.c src/config.c src/main.h src/objects.mk src/ranges.c src/wscript_build description: * Initial implementation of 'ar' command - Analyze ranges - _add, _sub and _list implemented - traces,functions,graphs info not yet integrated - dummy boolean op todo changeset: 681:fed3e60f7e1a user: pancake <@youterm.com> date: Thu Nov 27 14:13:56 2008 +0100 files: src/data.c description: * Apply nibble patch fixing the data corruption bug - related to p% zomfg :) changeset: 680:aefd85306902 user: pancake <@youterm.com> date: Thu Nov 27 12:46:45 2008 +0100 files: src/flags.c description: * Oops..fix build dont blame me changeset: 679:41840c9f0575 user: pancake <@youterm.com> date: Thu Nov 27 12:44:30 2008 +0100 files: src/cmds.c src/code.c src/config.c src/config.h src/flags.c src/print.c src/visual.c description: * Apply nibble patch fixing height in Ve * Fix 3rd arg of flag_grep_np function changeset: 678:b527760939c4 user: pancake date: Thu Nov 27 11:14:39 2008 +0100 files: src/cmds.c src/flags.c src/flags.h src/utils.c src/utils.h description: * Added fgp and fgn commands - Flag grep next and previous commands * Drop 'malloc' from flag_grep * Added str_grep helper functions in utils changeset: 677:e74b2eef2939 user: pancake date: Thu Nov 27 01:04:30 2008 +0100 files: src/rabin/aux.c src/rabin/aux.h src/rabin/rabin.c src/rabin/rabin.h description: * Add -o flag to rabin - to 'Operate' binaries - Initial implementation of the section resizer - fix some printf indentations changeset: 676:82cb2a67168b user: pancake <@youterm.com> date: Wed Nov 26 12:10:28 2008 +0100 files: src/code.c src/data.c description: * Beutify .byte (DATA_HEX) output in disassembly - Fix jk scrolling keys for cursor - Start dumping under the flag changeset: 675:e1f265bf843c user: pancake <@youterm.com> date: Wed Nov 26 11:13:29 2008 +0100 files: src/cmds.c src/print.c src/rabin/rabin.c description: * Recognize OBJECT type for ELF data * Fix build changeset: 674:3cc01e20763b user: pancake date: Wed Nov 26 10:28:12 2008 +0100 files: src/code.c src/code.h src/config.c src/pas.c src/rabin/dietelf.c src/rabin/rabin.c description: * Apply nibble patch fixing problems for loading symbols from .o - Sets CF and Cd depending of symbol type - Needs more work on this area - code view by default * Add new asm.profile 'gas' - Enables 'asm.jmpflags' - Uses aop_gas to display flags instead of offsets - automatically set flags for flags - only showing opcodes and flags * Use '.byte' and '0x%02x,' for Cd in disas (gas format) changeset: 673:c05cc4e397b8 user: pancake date: Wed Nov 26 01:01:16 2008 +0100 files: src/cmds.c src/cons.c src/print.c src/visual.c description: * Fix segmentation fault when entering in Visual without previous print (???) * Fix scr.seek (nibble patch) changeset: 672:f0a73c93984c user: pancake <@youterm.com> date: Tue Nov 25 20:15:57 2008 +0100 files: src/code.c src/radare.c description: * Properly display asm.flagsline=true * Fix segfault for !! in _raw changeset: 671:c7c38f6a0c1f user: pancake <@youterm.com> date: Tue Nov 25 14:33:02 2008 +0100 files: scripts/macros src/cmds.c src/radare.c description: * Add ?z strlen strings * Add branch-analysis macro example > (step-post-anal,?z`ao@oeip~type = cond, \ ??(),?eip==`ao@oeip~jump =[2], \ ??CC likely@oeip,??(),CC unlikely@oeip,) changeset: 670:9d055a107f4f user: pancake date: Tue Nov 25 10:59:55 2008 +0100 files: src/cons.c src/cons.h src/libr/cons/TODO src/libr/cons/cons.c src/libr/cons/t/Makefile src/libr/cons/t/hello.c src/libr/include/r_cons.h src/libr/include/r_util.h src/libr/rules.mk src/libr/tests.mk src/libr/util/Makefile src/libr/util/mem.c src/libr/util/num.c src/libr/util/str.c src/libr/util/string.c src/macros.c src/radare.c description: * r_cons initial build - Some more refactoring needed - Depends on libr_util * Add tests.mk to ease tests build * Fix build for libr_util * Use ',' as separator for oneliner macros - Fix infinite loop bug in macros_add when replacing a macro changeset: 669:fd48bf6ae1e8 user: pancake date: Tue Nov 25 03:55:16 2008 +0100 files: src/radare.c description: * Do not show cursor in stack view of debugger changeset: 668:59151080af34 user: pancake date: Tue Nov 25 03:39:42 2008 +0100 files: src/code.h src/config.c src/cons.c src/cons.h src/visual.c description: * Major refactoring and optimizations for cons.c - Prepared to be moved into libr! - Externalize config_ stuff to avoid excessive linkedlist abuse - Make cons_print_real work with buffer_len - Remove strcat! use hand-made memcpy version (speed++) - Recicle vsnprintf return values to get length - More optimal management of console buffer allocation - Avoid strlen as much as possible - Remove noisy code * Fix scrseek to _always_ seek to scr.seek changeset: 667:b837cb35d5a5 user: pancake <@youterm.com> date: Mon Nov 24 18:53:55 2008 +0100 files: src/visual.c description: * Apply Nibble's patch to make scrseek work again changeset: 666:58f0194ef83f user: pancake <@youterm.com> date: Mon Nov 24 18:43:29 2008 +0100 files: TODO doc/radare.but src/macros.c src/radare.c description: * Fix flag underline for the book * Fix the use of for '.' command in for-each changeset: 665:4f0e5e0dd9d7 user: pancake <@youterm.com> date: Mon Nov 24 18:10:32 2008 +0100 files: src/code.c src/macros.c src/print.h src/radare.c description: * Add support for oneliner macro definitions - f.ex: (for-fun\()`C*~CF[3]#$@\) - Using '\' for newlines - Some nasty hacks in radare_cmd to make it work * Add some more myrow++ changeset: 664:65efdf7a5b7d user: pancake <@youterm.com> date: Mon Nov 24 17:15:11 2008 +0100 files: src/cmds.c src/code.c src/flags.c src/rdb.c src/rsc/Makefile src/rsc/pool/maps description: * Enforce the use of '.' instead of '_' for flags - maps_ -> map_ - asm.section fixed again * Measure cons lines for comments in disassembly changeset: 663:8c6d551d6a3f user: pancake <@youterm.com> date: Mon Nov 24 14:34:02 2008 +0100 files: TODO scripts/macros src/code.c src/cons.c src/plug/io/debug.c src/print.c src/radare.c src/rsc/pool/dwarf-addr src/rsc/pool/dwarf-addrs description: * Added for-fun macro to iterate over functions * Added TODO tips for optimizations (thx callgrind) * Use dwarf-addrs script to use rsc line - Adaptation of dwarf-addr * Fixed disassembly CHECK_LINES for visual - avoid disasm more lines than screen height * Cleanup getHTTPdate function * Better handler of cons_buffer_sz and _len - Always growing console buffer - Avoid strlen'ing too many times - We should destroy strcat too * Use cache for dbg_lseek changeset: 662:867ec99a721a user: pancake <@youterm.com> date: Mon Nov 24 12:38:07 2008 +0100 files: doc/fortunes doc/radare.but src/analyze.c src/cmds.c src/cons.c src/data.c src/macros.c src/print.c src/radare.c description: * Use fun. instead of fun_ * Add help for iterators in (? * Minor optimizations in cons.c * Fix segfault in data_list * Problem found in print.c related to dwarf changeset: 661:e145308eed24 user: pancake date: Mon Nov 24 00:24:42 2008 +0100 files: src/config.c src/cons.c description: * Show 'pd 5' in Ve -> asm. * Fix pd~[N] single-line bug changeset: 660:45d734e262d7 user: pancake date: Mon Nov 24 00:01:13 2008 +0100 files: src/cons.c src/dbg/mem.c src/radare.c src/visual.c description: * Reduce cons_ usage in visual - Use pseudobuffering for nullcmd (dbg basic view) - Fix grepline for pd * Use map. instead of map_ changeset: 659:c679a946ff38 user: pancake date: Sun Nov 23 20:59:27 2008 +0100 files: src/cons.c src/rabin/rabin.c description: * Fix ptr to make ~[N] work * Rename '_' into '.' for rabin output - sym_main is now sym.main - ... changeset: 658:611552f3f94d user: pancake date: Sun Nov 23 20:35:37 2008 +0100 files: src/code.c src/config.c src/cons.c src/data.c src/flags.c src/flags.h description: * Added asm.flagsall - Useful to bypass anti-disassembly tricks * Better support for Cm - Listed properly in C* now - Displayed better in pd * Fix asm.flagsline to not depend on asm.comments * Initial implementation of awk-like word grepping with ~[#] > pd 20~mov#$@[2] changeset: 657:6ccfd33802bc user: pancake@flubox date: Fri Nov 21 17:40:19 2008 +0100 files: dist/maemo/Makefile src/cmds.c src/dbg/arch/arm-bp.c src/dbg/objects.mk src/visual.c src/w32utils.c description: * Fixups for building on maemo changeset: 656:0fe3293aebb5 user: pancake <@youterm.com> date: Fri Nov 21 13:31:22 2008 +0100 files: TODO doc/radare.but scripts/macros src/cons.c description: * Added documentation for iterators * Added support for greplines in cons > f ~sym_#4 ; get 4rt symbol > :pd ~#3 ; get 3rd opcode changeset: 655:6f0894bbbf95 user: pancake <@youterm.com> date: Fri Nov 21 12:30:48 2008 +0100 files: src/cmds.c src/code.c src/cons.c src/macros.c src/radare.c src/utils.c description: * Fix comparision without spaces (?$@==3) works * Make :pd disassembly without opsize or stackptr * Add cons_grep natively with ~ from the shell > "f ~ sym_" is the same as "f | grep sym_" * Make macro iterators work! changeset: 654:706aa9af3378 user: pancake date: Fri Nov 21 10:44:25 2008 +0100 files: TODO src/cmds.c src/macros.c src/macros.h src/print.c src/radare.c src/rasm/x86.c description: * Apply Nibble patch fixing wa seek address - Also applied the branch cursor highlighting for baddr * Initial implementation of macro iterators - Macros now can return u64 values or NULL - Not yet working but infrastructure is done - Fix recursivity limit when using breaks in macros changeset: 653:555737379cd1 user: pancake date: Fri Nov 21 00:25:01 2008 +0100 files: src/radare.c description: * Implement @@.file foreach iteration with files changeset: 652:6b5e59f3b9f7 user: pancake <@youterm.com> date: Thu Nov 20 19:54:54 2008 +0100 files: doc/radare.but src/dbg/darwin/fd.c src/dbg/fd.c src/dbg/os.h src/dbg/system.c src/dbg/unix/fd.c src/dbg/win32/fd.c src/radare.c description: * Fix !fd > file (All debugger commands now can dump to file :D) * Add example for pm with GStreamer * Added minimal cheat sheet in documentation * Add !fd* to list filedescriptors as radare commands - Add !fd -* to close all filedescriptors * Add help for !reg? changeset: 651:5eaee632a126 user: pancake <@youterm.com> date: Wed Nov 19 19:03:00 2008 +0100 files: doc/radare.but description: * Added documentation for labels in macros for the book changeset: 650:a2c9890ee200 user: pancake <@youterm.com> date: Wed Nov 19 18:41:23 2008 +0100 files: src/macros.c description: * Avoid dupped label additions changeset: 649:9d2f38df668a user: pancake <@youterm.com> date: Wed Nov 19 18:16:55 2008 +0100 files: scripts/macros src/arch/dalvik/code.c src/arch/dalvik/dexdump/DexDump.c src/arch/dalvik/dexdump/Makefile src/arch/dalvik/dexdump/OpCodeNames.c src/arch/dalvik/dexdump/OpCodeNames.h src/arch/dalvik/dexdump/include/libdex/CmdUtils.h src/arch/dalvik/dexdump/include/libdex/DexCatch.h src/arch/dalvik/dexdump/include/libdex/DexClass.h src/arch/dalvik/dexdump/include/libdex/DexDataMap.h src/arch/dalvik/dexdump/include/libdex/DexFile.h src/arch/dalvik/dexdump/include/libdex/DexProto.h src/arch/dalvik/dexdump/include/libdex/InstrUtils.h src/arch/dalvik/dexdump/include/libdex/Leb128.h src/arch/dalvik/dexdump/include/libdex/OpCode.h src/arch/dalvik/dexdump/include/libdex/OptInvocation.h src/arch/dalvik/dexdump/include/libdex/SysUtil.h src/arch/dalvik/dexdump/include/libdex/ZipArchive.h src/arch/dalvik/dexdump/include/libdex/sha1.h src/arch/dalvik/dexdump/include/vm/Common.h src/cmds.c src/config.h src/macros.c src/plug/hack/perl.c description: * Added support for labels in macros for scripting - Added a simple loopy program in scripts/macros * Added dummy dexdump and basic code analysis for DalvikVM changeset: 648:4f335775ec11 user: pancake <@youterm.com> date: Wed Nov 19 14:31:45 2008 +0100 files: TODO src/config.c src/dbg/debug.c src/dbg/debug.h src/dbg/dump.c src/dbg/fd.c src/dbg/mem.c src/dbg/mem.h src/dbg/objects.mk src/dbg/system.c src/dbg/wscript_build description: * Initial non-working implementation of fd dumper/restorer - Added dump.c (takes stuff from debug.c, mem.c ,..) - Adds dump.regs, dump.user, dump.libs, dump.fds changeset: 647:44477984a712 user: pancake <@youterm.com> date: Wed Nov 19 14:02:16 2008 +0100 files: doc/radare.but src/cmds.c src/code.c src/trace.c description: * Update documentation for 'at' command - Added ioli's and pcme0's crackmes as appendix in the book * Added atd and atD commands - Show trace of executed code for assembly or dwarf changeset: 646:bb044ffcdcd0 user: pancake <@youterm.com> date: Wed Nov 19 12:45:13 2008 +0100 files: doc/radare.but src/dbg/debug.c src/dbg/system.c src/rsc/pool/dwarf-addr src/rsc/pool/dwarf-at src/rsc/pool/dwarf-lines src/rsc/pool/dwarf-traces description: * Added rsc helpers for dwarf - dwarf-traces uses 'at' information to show source-level traces - Fix dwarf-addr script - Added dwarf-at addr2line wrapper * Added documentation for dwarf-traces * Make '!stepu' work in two ways: - step until address (address as argument) - step until user code (no arguments) changeset: 645:1a4687569751 user: pancake <@youterm.com> date: Wed Nov 19 12:01:15 2008 +0100 files: src/config.c src/macros.c src/print.c src/visual.c description: * Add cmd.visualbind - Bind 'b' key in visual to run this eval * Use tabs again in macros.c - Some minor work on labelling * Fix cursor over jumps to use config.baddr changeset: 644:54e1194b681c user: pancake date: Wed Nov 19 10:38:37 2008 +0100 files: doc/radare.but src/config.c src/dbg/debug.c description: * Added documentation for !trace debugger command - Added examples for rasc * New options for !trace debugger command - e trace.bps -> do not stop on breakpoints (trace them) - e cmd.trace -> execute this command at every traced opcode - Shows counter of executed opcodes - Fix 'stop in breakpoints' problem changeset: 643:e670d007f3d4 user: pancake <@youterm.com> date: Tue Nov 18 19:35:39 2008 +0100 files: doc/radare.but description: * Added documentation for !fdio bt and dwarf changeset: 642:db85ae8d0706 user: pancake <@youterm.com> date: Tue Nov 18 18:12:00 2008 +0100 files: src/config.c src/dbg/debug.c src/dbg/system.c description: * Added trace.calls option for !trace command - Only traces 'call' instructions changeset: 641:72512ab82c05 user: pancake <@youterm.com> date: Tue Nov 18 17:47:22 2008 +0100 files: src/code.c src/config.c description: * Implement asm.case to get uppercase disassemblies changeset: 640:8dba4b03dcb0 user: pancake <@youterm.com> date: Tue Nov 18 16:59:03 2008 +0100 files: src/arch/x86/ollyasm/asmserv.c src/arch/x86/ollyasm/disasm.c src/code.c description: * Apply Nibble patches to make OLLY disassembler work - lowercase by default - Use 0x for hex values to avoid confusing people changeset: 639:dc0264e3c55d user: pancake date: Tue Nov 18 10:53:55 2008 +0100 files: src/dbg/darwin/debug.c src/dbg/fd.c src/dbg/io.c src/dbg/unix/debug.c src/dbg/win32/debug.c src/libr/io/io.c description: * New debug_os_write and debug_os_read - Under layer for debug_read and debug_read_at - debug_fd_read is also handled from read_at - Fix infinite loop - Not yet working :/ * Added dummy r_io_resize in r_io changeset: 638:528b6577f526 user: pancake date: Tue Nov 18 10:24:50 2008 +0100 files: TODO src/dbg/debug.c src/dbg/debug.h src/dbg/fd.c src/dbg/io.c src/dbg/libps2fd.c src/dbg/mem.c src/dbg/objects.mk src/dbg/procs.c src/dbg/regs.c src/dbg/wscript_build description: * Some refactoring for the debugger - Initial not yet fully working of fdio - We have to also wrap read_at and write_at - Added fd.c io.c and regs.c changeset: 637:de20f8f44f83 user: pancake <@youterm.com> date: Mon Nov 17 17:53:30 2008 +0100 files: src/analyze.c src/code.c src/config.c src/config.h src/data.c src/dbg/arch/i386.c src/dbg/darwin/fd.c src/dbg/debug.c src/dbg/os.h src/dbg/unix/fd.c src/dbg/win32/fd.c src/print.c src/visual.c description: * Initial implementation of config.acursor - Aligned cursor to opcode - Used to colorize target offset for jumps (visual+cursor over a branch) - Also used for '' key over an opcode to jump there and F2 for adding breakpoints (Fixes the problem of adding breakpoints in the middle of an instruction visually) * Added !fdr and !fdw commands. - Read and write on filedescriptors of debugged child process changeset: 636:d3bc0b94b618 parent: 635:cf33696efd24 parent: 634:14a9b6f585d7 user: pancake <@youterm.com> date: Mon Nov 17 15:08:21 2008 +0100 files: src/arch/x86/udis86/Makefile src/arch/x86/udis86/Makefile.in src/arch/x86/udis86/Makefile.standalone src/arch/x86/udis86/mnemonics.c src/arch/x86/udis86/mnemonics.dat src/arch/x86/udis86/mnemonics.h src/arch/x86/udis86/mnemonics.pl src/arch/x86/udis86/opcmap.c src/arch/x86/udis86/opcmap.h src/arch/x86/udis86/udcli/Makefile src/code.c description: * Merge heads changeset: 635:cf33696efd24 parent: 627:6ca6bc467e85 user: pancake <@youterm.com> date: Mon Nov 17 15:04:55 2008 +0100 files: doc/fortunes src/code.c description: * Handle 'error' field for olly disassembler - Stills broken..grr * Fix asm.pseudo=true for x86 changeset: 634:14a9b6f585d7 user: pancake date: Mon Nov 17 10:00:46 2008 +0100 files: src/cmds.c src/dbg/close.c src/plug/hack/mkruby.rb src/radiff/rdbdiff_main.c src/visual.c description: * Initial implementation of 'wt' command * Fix debug_close() : refactoring * Build ruby plugin with -fPIC * Apply Anderson patch fixing build of rdbdiff changeset: 633:9ac7ce1bb0de user: pancake date: Sun Nov 16 21:58:54 2008 +0100 files: Makefile.acr config.mk.acr configure configure.acr global.h.acr src/Makefile.acr src/objects.mk src/pas.c src/xrefs.c vala/api/core.vala vala/chart.c vala/core.c vala/default_layout.c vala/edge.c vala/graph.c vala/graph.h vala/layout.c vala/node.c vala/node.h vala/renderer.c vala/renderer.h vala/widget.c wscript description: * Lot of fixups related to make with/out gui - Up waf/acr to version to 1.1 - Some GUI->HAVE_GUI - Fix build of udis1.7 for make - fix api/core.vala to use env_udpate() * Stupid rebuild of vala C files for vala changeset: 632:fe55d271db03 user: pancake date: Sun Nov 16 19:12:53 2008 +0100 files: src/code.c src/pas.c description: * Apply Nibble patch fixing asm.pseudo - asm.syntax=pseudo is working too :D changeset: 631:e76eeeecb1be user: pancake date: Sun Nov 16 19:09:24 2008 +0100 files: TODO src/arch/x86/udis86/Makefile src/arch/x86/udis86/Makefile.in src/arch/x86/udis86/Makefile.standalone src/arch/x86/udis86/decode.c src/arch/x86/udis86/decode.h src/arch/x86/udis86/input.c src/arch/x86/udis86/itab.c src/arch/x86/udis86/itab.h src/arch/x86/udis86/mnemonics.c src/arch/x86/udis86/mnemonics.dat src/arch/x86/udis86/mnemonics.h src/arch/x86/udis86/mnemonics.pl src/arch/x86/udis86/opcmap.c src/arch/x86/udis86/opcmap.h src/arch/x86/udis86/syn-att.c src/arch/x86/udis86/syn-intel.c src/arch/x86/udis86/syn-pseudo.c src/arch/x86/udis86/types.h src/arch/x86/udis86/udcli/Makefile src/arch/x86/udis86/udcli/udcli.c src/arch/x86/udis86/udis86.c description: * Apply Nibble's patch upgrading udis86 to version 1.7 changeset: 630:31d62cb197c3 user: pancake date: Sun Nov 16 02:52:08 2008 +0100 files: src/code.c src/visual.c description: * Apply Nibble patch to fix x86 disassembler - fix disassembler - fix call's comments changeset: 629:ff0ba4b31d2c user: pancake date: Sat Nov 15 15:49:16 2008 +0100 files: src/libr/Makefile src/libr/include/r_lib.h src/libr/lib/Makefile src/libr/lib/lib.c src/libr/rules.mk description: * Initial import of libr_lib for portable dynlib support changeset: 628:13a23cec2a23 user: pancake date: Sat Nov 15 15:06:42 2008 +0100 files: src/libr/include/r_io.h src/libr/include/r_types.h src/libr/io/handle.c src/libr/io/io.c src/libr/io/map.c src/libr/io/t/Makefile src/libr/io/t/cat.c src/libr/rules.mk description: * Initial full implementation of libr_io - Implements a full handle plugin - Adds per-plugin handled file-descriptor list - Adds cache for plugins use - Add test example program ('cat' using r_io) - Cache last seek information - Build libs using -fPIC to avoid data relocations changeset: 627:6ca6bc467e85 user: pancake <@youterm.com> date: Fri Nov 14 19:28:43 2008 +0100 files: src/cmds.c src/libr/hash/rahash.c src/libr/hash/sha1.c description: * Add 'wt' dummy command * Some indent for libr_hash changeset: 626:da1f0c2f2a74 user: pancake <@youterm.com> date: Fri Nov 14 16:18:53 2008 +0100 files: src/dbg/close.c src/libr/Makefile src/libr/include/list.h src/libr/include/r.h src/libr/include/r_io.h src/libr/include/r_util.h src/libr/io/Makefile src/libr/io/handle.c src/libr/io/io.c src/libr/io/map.c src/libr/line/dietline.c src/libr/util/Makefile src/libr/util/mem.c src/libr/util/num.c src/libr/util/string.c src/plugin.c src/print.c src/utils.c description: * Initial import of libr_util * Some more work on libr changeset: 625:9a82e506b5b1 user: pancake <@youterm.com> date: Fri Nov 14 12:30:01 2008 +0100 files: TODO src/code.c src/libr/Makefile src/libr/README src/libr/cons/Makefile src/libr/cons/cons.c src/libr/hash/Makefile src/libr/hash/crc16.c src/libr/hash/crc32.c src/libr/hash/crc32.h src/libr/hash/crca.c src/libr/hash/entropy.c src/libr/hash/hamdist.c src/libr/hash/hash.c src/libr/hash/hash.h src/libr/hash/md4.c src/libr/hash/md5.h src/libr/hash/md5c.c src/libr/hash/rahash.c src/libr/hash/sha1.c src/libr/hash/sha1.h src/libr/hash/sha2.c src/libr/hash/sha2.h src/libr/include/r_cons.h src/libr/include/r_hash.h src/libr/include/r_io.h src/libr/include/r_print.h src/libr/include/r_types.h src/libr/io/Makefile src/libr/io/handle.c src/libr/io/io.c src/libr/line/Makefile src/libr/line/TODO src/libr/line/dietline.c src/libr/line/dietline.h src/libr/print/Makefile src/libr/print/print.c src/libr/rules.mk src/main.h src/print.c src/rabin/dietmach0.c src/rabin/dietpe.c src/rahash/md5c.c src/visual.c description: * Initial import of libr - libr is composed by multiple sublibs - libr_hash fully implemented * io, hash, line, print, asm... * Some syntax fixups for dietmach0 and dietpe * Oops for px % (15 -> 16) changeset: 624:9c4ee971ee6d user: pancake <@youterm.com> date: Thu Nov 13 17:23:30 2008 +0100 files: TODO src/analyze.c src/arch/x86/code.c src/cmds.c src/code.c src/dbg/arch/i386.c src/dbg/mem.c src/flags.c src/print.c src/print.h src/undo.c src/visual.c description: * Fixes for stack-inc with sub for x86 code analysis * Minor cleanup for TODO * Cleaner and more flexible implementation of 'px' * Better feedback at visual's top bar * Remove INILINE and NEWLINE (use cons_ api directly) changeset: 623:b02475a547ef user: pancake <@youterm.com> date: Wed Nov 12 18:48:12 2008 +0100 files: TODO configure doc/radare.but src/cmds.c vala/grava/widget.vala vala/widget.c description: * Added p?f modifier to temporally set block size to func size - pdf @ sym_main will show the whole main - p8f @ sym_main will dump the sym_main symbol * Sync configure with configure.acr for HAVE_GUI * Add wiki stuff to the book - usb sniffer documentation - rsc graphing with yed * Added separators to popup menu in grava widget changeset: 622:e05b7d0d1802 user: pancake <@youterm.com> date: Wed Nov 12 17:28:46 2008 +0100 files: src/radare.h src/rahash/hash.c src/xrefs.c vala/chart.c vala/default_layout.c vala/edge.c vala/graph.c vala/graph.h vala/grava/widget.vala vala/layout.c vala/node.c vala/node.h vala/renderer.c vala/renderer.h vala/widget.c description: * Fix build * Reduce zoom limit in vala changeset: 621:96abeb10314c user: pancake date: Wed Nov 12 05:47:27 2008 +0100 files: src/cmds.c src/grava.c src/radare.c vala/Makefile vala/chart.c vala/default_layout.c vala/edge.c vala/graph.c vala/graph.h vala/grava/widget.vala vala/layout.c vala/node.c vala/node.h vala/renderer.c vala/renderer.h vala/widget.c description: * Update .c files for valac 0.5.1 * '/' and '*' rotate graph with the keyboard * Better management of the config.graph variable * Make 'u' and 'U' work in graph view (undo/redo seek) * Fix build of vala files with make changeset: 620:e63e7a7c2ac9 user: pancake date: Wed Nov 12 05:20:44 2008 +0100 files: src/cmds.c src/code.c src/code.h src/config.c src/config.h src/cons.c src/flags.c src/grava.c src/print.c src/xrefs.c description: * Add help for 'ag' command - ag. outputs graph 'dot' format * Fix build for xrefs * Added 'smart' profile * Added cons_invert() to be used for cursor and eip * Add config.graph to stilyze the graph disassembly changeset: 619:bae97948396b user: pancake date: Wed Nov 12 04:38:17 2008 +0100 files: scripts/macros src/Makefile.acr src/cmds.c src/cmds.h src/code.c src/cons.h src/grava.c src/hack.c src/macros.c src/macros.h src/main.c src/plugin.c src/print.c description: * Add scripts/macros as examples for radare scripts * Refactor HAVE_VALAC and GUI to HAVE_GUI for waf+make * Add () command to 'break' macros * Another minor optimization for the disassembler * Added macro limit to avoid recursivity segfaults changeset: 618:9c2dc82bf2d8 user: pancake date: Wed Nov 12 03:49:23 2008 +0100 files: configure.acr global.h.acr src/cmds.c src/code.c src/code.h src/config.c src/config.h src/environ.c src/flags.c src/grava.c src/io.c src/io.h src/list.h src/macros.c src/macros.h src/main.h src/objects.mk src/plug/io/remote.c src/plugin.c src/plugin.h src/print.c src/print.h src/project.c src/rabin.c src/radare.c src/radare.h src/rio.c src/types.h src/utils.h src/visual.c src/wscript_build wscript description: * Minor optimization for disassembly using a flags_cache * Lot of refactoring - HAVE_GUI added for waf and acr - source splitted in more files - api core functions renamed - reorganization of .h files - clean plugins.c code * Fix x86 disassembly offset (correct jump addresses) * Try 2 space indentation changeset: 617:65b67aa03405 user: pancake date: Tue Nov 11 10:33:37 2008 +0100 files: src/code.c src/dbg/debug.c description: * Apply nibble's patch fixing !mp xwr->rwx bug changeset: 616:28148adeb40b user: pancake date: Mon Nov 10 10:25:31 2008 +0100 files: src/pas.c src/plug/hack/lua.c src/plug/hack/python.c src/plug/hack/radare.py src/plug/hack/ruby.c description: * Fix stdin eof issue for lua, python and ruby plugins - Safe ^D exit * Added op= syntax sugar for pas decompiler with mips === 1.0 === changeset: 614:dfd0c6fd7ded tag: tip user: pancake date: Sat Nov 08 18:47:12 2008 +0100 files: configure configure.acr src/Makefile.acr src/rabin/Makefile vala/Makefile wscript description: * Upgrade program version in acr/waf to 1.0 * Hack to ignore valac in acr - Only used for developers ;) - Release tarball should build without vala changeset: 613:31d531e1283f user: pancake@bare date: Fri Nov 07 21:44:29 2008 +0100 files: TODO configure.acr src/code.c src/config.c src/grava.c description: * Add asm.profile=graph * Fixes for graph save/restore for asm. evals changeset: 612:8bba42975b57 user: pancake <@youterm.com> date: Fri Nov 07 20:15:42 2008 +0100 files: wscript description: * Vala != GUI for waf - We need to do the same for make changeset: 611:6de735df2c47 user: pancake <@youterm.com> date: Fri Nov 07 17:14:41 2008 +0100 files: doc/radare.but src/utils.c description: * Fix segmentation fault in check * Move scripting section before debugging changeset: 610:938ce5a0da40 user: pancake <@youterm.com> date: Fri Nov 07 16:45:12 2008 +0100 files: doc/radare.but description: * Add documentation for scr.pal. - Also for scr.pal. - Add documentation for rsc gokolu, asm/dasm and idc2rdb changeset: 609:4983b97afec5 user: pancake <@youterm.com> date: Fri Nov 07 14:17:00 2008 +0100 files: README doc/radare.but doc/xtra/trk src/cmds.c src/radare.c description: * Added documentation in the book for - serial port io plugin using trk symbian debugger - Macro definition and usage - Basic ruby usage - Conclussions * Added new command 'bt' block size from here to flag given * Implement macro_rm functionality changeset: 608:26eeffd07efc user: pancake date: Fri Nov 07 14:07:16 2008 +0100 files: src/radare.c src/utils.c description: * Added stdin_fd to be used for macro_add * Initial working implementation of macros from stdin or rcfile - Added support for arguments in macros * Handle nullptr strings by get0word changeset: 607:9f035a44b0b5 user: pancake date: Fri Nov 07 13:24:47 2008 +0100 files: doc/xtra/trk src/cmds.c src/cmds.h src/dbg/mem.c src/radare.c src/radare.h description: * Initial support for macros for radare scripting - (macro-name \n code \n) - .(macro-name) - Needs support for arguments * Added radare command to debug trk protocol changeset: 606:c9dac473719a user: pancake date: Fri Nov 07 10:46:35 2008 +0100 files: doc/xtra/trk src/plug/io/serial.c src/plug/io/socket.c description: * Fix socket and serial IO plugins read() hook - Add experimental !lock !unlock and !log commands to serial:// * Add a hello world capture from symbian trk debugger changeset: 605:a23aae4a0377 user: pancake date: Fri Nov 07 10:26:48 2008 +0100 files: src/plug/io/serial.c src/plugin.c description: * Do not build serial:// for non-unix platforms changeset: 604:912ba66402ff user: pancake date: Fri Nov 07 10:25:43 2008 +0100 files: TODO doc/xtra/trk src/cmds.c src/plug/io/serial.c src/undo.c description: * Fix help for serial:// * Add command 'u-' to remove the list of history changes * Initial import of the TRK protocol specs changeset: 603:72b90781327c user: pancake date: Fri Nov 07 09:57:59 2008 +0100 files: TODO doc/radare.but src/plug/hack/radare.rb src/plug/io/serial.c description: * Apply nibble's patch with documentation update * Apply brainstorm's update for radare.rb Ruby API * Fix serial:// IO plugin - Uses 9600 bps by default - Known to work with rfcomm bluetooth connection with Symbian TRK debugger changeset: 602:b4b04636744b user: pancake date: Fri Nov 07 01:14:31 2008 +0100 files: TODO src/objects.mk src/plug/io/serial.c src/plug/io/wscript_build src/plugin.c src/plugin.h description: * Added serial.c IO plugin - Not yet working...but maybe tomorrow.. changeset: 601:0cc738382ad4 user: pancake date: Thu Nov 06 21:52:30 2008 -0500 files: src/arch/mips/code.c src/arch/mips/gnudismips.c src/code.c src/plugin.c vala/wscript_build description: * Fix GNU disassembler for MIPS - jump addresses -8 (wtf?) * Do not warn about gtk init when loading plugins * Fix build for non-gtk+waf changeset: 600:cb293a741832 user: pancake <@youterm.com> date: Thu Nov 06 16:46:01 2008 +0100 files: TODO doc/radare.but description: * Apply nibble patch for the book changeset: 599:64e01a2e26ee user: pancake <@youterm.com> date: Thu Nov 06 12:36:23 2008 +0100 files: TODO src/arch/arm/gnudisarm.c src/code.c src/config.c src/radare.c vala/chart.c vala/default_layout.c vala/edge.c vala/graph.c vala/graph.h vala/layout.c vala/node.c vala/node.h vala/renderer.c vala/renderer.h vala/widget.c description: * Swap bigendian for ARM disassembler * Fix asm.size order problem * Add 'asm.profile' with 'default', 'simple', 'debug', 'full' * Apply Nibble's patch to keep seek for radare_cmd_foreach * Update .c files from vala 0.5.1 changeset: 598:e1e98c81a557 user: pancake date: Thu Nov 06 12:27:23 2008 +0100 files: TODO src/cmds.c src/trace.c src/undo.c src/undo.h vala/Makefile vala/api/disassembler.vala vala/asm.c vala/asm.h vala/disassembler.c vala/disassembler.h vala/grava/Makefile vala/grava/main.v vala/grava/main.vala vala/window.c vala/window.h vala/wscript_build description: * Fully implement the 'at+' command * More fixups for valabuild make+waf changeset: 597:0fff77692401 user: pancake date: Thu Nov 06 01:34:28 2008 +0100 files: TODO src/cmds.c description: * Minor cleanup of TODO * Add 'at+' command changeset: 596:7cec36a6fb15 user: pancake@osx86 date: Wed Nov 05 14:32:14 2008 +0100 files: src/plugin.c vala/main.c vala/main.h vala/search.c vala/search.h vala/utils.c vala/utils.h wscript description: * Fix build for OSX+waf - Remove noisy .h files from vala/ - Check before installing libruby (needs dylib/dll support here) * Fix .dylib plugin loading changeset: 595:3044a4d9ff75 user: pancake date: Wed Nov 05 04:27:16 2008 +0100 files: src/arch/arm/gnudisarm.c src/arch/mips/gnudismips.c src/arch/sparc/gnudisparc.c src/code.c src/code.h src/pas.c src/utils.h description: * Fix sparc, mips and arm disassemblers - All of them using the gnu binutils interface - fprintf and print_value callbacks now work on a buffer * Add pseudocode support for mips - Initial work on this * (Nibble) fix null strings issue changeset: 594:dfdeb5194856 user: pancake date: Wed Nov 05 02:41:46 2008 +0100 files: TODO src/cmds.c src/code.c src/rabin/dietpe.c src/rabin/dietpe_static.h description: * dietpe - add offset_to_rva function * rabin - fix rva in show_strings for PE binaries * radare - fix C (@ here) - make 'Cs' autodetect multiple strings changeset: 593:79111a89bc39 user: pancake date: Wed Nov 05 02:39:23 2008 +0100 files: vala/asm.c vala/asm.h vala/chart.c vala/chart.h vala/config.c vala/config.h vala/core.c vala/core.h vala/debug.c vala/debug.h vala/debugger.c vala/debugger.h vala/default_layout.c vala/default_layout.h vala/disassembler.c vala/disassembler.h vala/edge.c vala/edge.h vala/graph.c vala/graph.h vala/info.c vala/info.h vala/io.c vala/io.h vala/layout.c vala/layout.h vala/line.c vala/line.h vala/list.c vala/list.h vala/logs.c vala/logs.h vala/main.c vala/main.h vala/node.c vala/node.h vala/panel.c vala/panel.h vala/plugin.c vala/plugin.h vala/project.c vala/project.h vala/radget.c vala/radget.h vala/renderer.c vala/renderer.h vala/search.c vala/search.h vala/shape.c vala/shape.h vala/shell.c vala/shell.h vala/term.c vala/term.h vala/utils.c vala/utils.h vala/visor.c vala/visor.h vala/widget.c vala/widget.h vala/window.c vala/window.h description: * Import of all the generated C,H files (9600 LOC) - fyi vala ratio is 2200 LOC vs C 9600 - ease build system changeset: 592:5ad25a8a40ac user: pancake date: Wed Nov 05 02:36:39 2008 +0100 files: Makefile.acr configure configure.acr src/Makefile.acr src/radare.c src/radare.h src/wscript_build vala/Makefile vala/api/config.vala vala/api/io.vala vala/api/plugin.vala vala/api/project.vala vala/api/utils.vala vala/grava/Makefile vala/wscript_build description: * Check for vala 0.5.0 at least * Fix build of vala files for make and waf - externalize radare_close changeset: 591:aada005c1ca5 user: pancake <@youterm.com> date: Tue Nov 04 17:47:28 2008 +0100 files: global.h.acr src/analyze.c src/code.c src/radare.c vala/grava/Makefile description: * Fix typo for readline+make (REDALINE->READLINE) O:) - Fix build for readline * Fix some more warnings * Fix segmentation fault for analyze_function for x86 - Add verbose dots for initial analyze * Make asm.stackptr work again changeset: 590:17d1fdcfb88a user: pancake <@youterm.com> date: Tue Nov 04 16:28:14 2008 +0100 files: gui/main.c gui/main.h gui/toolbar.c src/arch/arm/disarm.c src/arch/bf/code.c src/arch/csr/code.c src/arch/csr/dis.c src/arch/csr/dis.h src/arch/mips/code.c src/arch/msil/code.c src/arch/msil/demsil.c src/arch/msil/demsil.h src/cmds.c src/code.c src/config.c src/cons.h src/data.c src/dbg/arch/i386.c src/dbg/bp.h src/dbg/debug.c src/dbg/debug.h src/dbg/mem.h src/dbg/open.c src/dbg/parser.c src/dbg/procs.c src/dbg/system.c src/dbg/thread.c src/dbg/unix/debug.c src/dbg/unix/syscall.c src/dietline.c src/flags.c src/flags.h src/grava.c src/pas.c src/plug/hack/gtk-prefs.c src/plug/hack/lua.c src/plug/hack/scriptedit.c src/plug/io/bfdbg.c src/plugin.c src/plugin.h src/print.c src/project.c src/rabin/dietmach0_utils.c src/radare.c src/radare.h src/readline.c src/undo.c src/undo.h src/utils.h description: * Huge dewarnification... more work is needed! changeset: 589:166f02078b59 user: pancake <@youterm.com> date: Tue Nov 04 13:18:37 2008 +0100 files: TODO src/binparse.c src/code.c src/code.h src/dbg/debug.c src/pas.c src/rabin/dietmach0_utils.c src/radare.c description: * More null pointer issues reported by Timo (Thanks!) - Less memory leaks! * Minor stuff for pas (assembly parser layer) changeset: 588:7d0187efd58f user: pancake <@youterm.com> date: Mon Nov 03 20:18:39 2008 +0100 files: Makefile.acr gui/actions.c gui/menubar.c gui/topbar.c src/code.c src/code.h src/rabin/javasm.c src/radare.h description: * Remove some warnings in gui/ * Make disassembler work happy again :) - Needs more love..but works at least changeset: 587:3e7b16ba904c user: pancake date: Mon Nov 03 01:49:57 2008 +0100 files: src/code.c src/code.h src/config.c src/pas.c description: * Broken sleepy commit (!!!) - Breaks disassembler engine - Required to make asm.pseudo work - Some code refactoring and cleanup (needs more love) changeset: 586:ba135f20f067 user: pancake date: Mon Nov 03 00:19:15 2008 +0100 files: scripts/example.rb src/arch/x86/code.c src/cmds.c src/code.c src/code.h src/config.c src/pas.c description: * New asm.stackptr to trace stack usage in functions * Enhacements in pas_aop - Basic x86 parser - Initial skeleton for vm integration * Fix disassembler for x86 changeset: 585:7415d62e514a user: pancake date: Sat Nov 01 14:28:30 2008 +0100 files: global.h.acr src/Makefile.acr src/code.c src/code.h src/dbg/bp.c src/dbg/bp.h src/dbg/debug.c src/dbg/signal.c src/dbg/signals.h src/javasm/Makefile src/pas.c src/radare.h description: * Fix 'clean' for make build system * Remove warnings changeset: 584:ef0ced553722 user: pancake date: Sat Nov 01 13:32:12 2008 +0100 files: src/arch/m68k/m68k_disasm.c src/config.c src/plug/io/malloc.c src/print.c src/radare.c src/rasm/rasm.c src/search.c src/utils.c description: * Fix some NULL pointer issues reported by Saturn - Thanks Timo! changeset: 583:531634f7ad3f user: pancake date: Sat Nov 01 03:34:47 2008 +0100 files: gui/prefs.c src/analyze.c src/arch/csr/dis.c src/config.h src/cons.c src/dbg/bp.h src/dbg/debug.c src/dbg/debug.h src/dbg/mem.c src/flags.h src/radare.c src/radare.h description: * Fix some security bugs reported by Timo (Thanks!) * Fix some warnings changeset: 582:3a64702d664c user: pancake <@youterm.com> date: Fri Oct 31 17:38:44 2008 +0100 files: gui/Makefile src/plug/hack/Makefile src/rsc/Makefile description: * Fix install problems for make with DESTDIR and SHAREDIR - Thanks Timo! changeset: 581:79e031e8b859 user: pancake <@youterm.com> date: Fri Oct 31 17:28:34 2008 +0100 files: TODO gui/prefs.c src/arch/arm/aasm/aasm.h src/arch/arm/aasm/utils.c src/arch/csr/code.c src/arch/csr/dis.c src/arch/msil/demsil.c src/arch/x86/ollyasm/assembl.c src/arch/x86/ollyasm/disasm.h src/binparse.c src/cons.h src/dbg/arch/i386-bp.c src/dbg/debug.c src/dbg/mem.c src/dbg/mem.h src/dbg/system.c src/dbg/unix/procs.c src/grava.c src/hack.c src/main.c src/plug/hack/gtk-topbar.c src/plug/io/shm.c src/rabin.c src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/rabin.c src/radare.c src/radare.h src/rahash/rahash.c src/rasc/shellcodes.c src/rasm/main.c src/rasm/olly.c src/rasm/rasm.c src/rdb.c src/section.c src/utils.h description: * Huge de-warnification changeset: 580:c7fe4b698a6b user: pancake date: Thu Oct 30 11:39:35 2008 +0100 files: TODO src/arch/csr/dis.c src/code.c src/objects.mk src/pas.c src/plug/hack/Makefile description: * Initial working parsing for PAS * Lot of refactoring for splitting data+presentation for radis() * Build gtk-actions from 'make' changeset: 579:4b5add729b14 user: pancake date: Thu Oct 30 04:50:11 2008 +0100 files: TODO src/arch/arm/gnudisarm.c src/arch/csr/dis.c src/arch/csr/dis.h src/arch/x86/udis86/syn-intel.c src/cmds.c src/code.c src/code.h src/pas.c src/plug/hack/gtk-actions.c src/rabin/dietelf.c src/rsc/pool/bdf2rad src/wscript_build tests/Makefile description: * Fix radiff -rd -- binpatching works! (thx Nibble) * Initial pas code (parse asm string) - not yet working * Fix bdf2rad (Nibble) * Some refactoring for radis - Initial optimizations for udis_arch Use binary masks for visual options in disasm - Add one layer to render strings of opcodes in a buffer before printing to screen - Use it by default * Show time in tests changeset: 578:ba5b3056eeed user: pancake <@youterm.com> date: Wed Oct 29 18:58:36 2008 +0100 files: doc/radare.but src/config.c src/radare.c src/utils.c description: * Drop some eprintf noise - dbg.focus should be an integer for PID changeset: 577:d7138e6aabeb user: pancake <@youterm.com> date: Wed Oct 29 12:24:51 2008 +0100 files: src/cmds.c src/io.c src/plug/hack/mkruby.rb description: * 'b' without arguments shows block size * Fix file.insert (should fix radiff -r :D) * Another fix for make+mkruby.rb changeset: 576:625b9d0fba89 user: pancake <@youterm.com> date: Wed Oct 29 12:10:23 2008 +0100 files: TODO src/config.c src/plug/hack/ruby.c src/rabin/dietelf.c src/rabin/dietpe.c src/rabin/rabin.c src/rsc/pool/bdcolor src/visual.c wscript description: * rabin, dietpe - fix native get_strings * waf - fix ruby detection issue * ruby hack - fix wrong includes * radiff - fix bdcolor (wrong offsets) * core - deprecate asm.follow (use scr.seek instead) changeset: 575:4d8778d78c95 user: pancake date: Tue Oct 28 11:46:37 2008 +0100 files: src/Makefile.acr src/analyze.c src/arch/x86/udis86/syn-pseudo.c src/cmds.c src/code.c src/dbg/lib.c src/print.c src/rabin/dietpe.c src/rdb.c src/rdb.h src/socket.c src/utils.c src/utils.h description: * Cleaned up build with make - Some warnings less - Avoid dupped defs - Remove unused vars and add some casts * Better data Xrefs in 'af' (using aop.ref) changeset: 574:a8fa3d5a4c66 user: pancake date: Mon Oct 27 23:26:19 2008 +0100 files: src/plug/hack/chkruby.rb wscript description: * Add chkruby.rb for waf build to detect ruby - Works ala mkruby.rb :) changeset: 573:6c6b4fb22b4e user: pancake <@youterm.com> date: Mon Oct 27 18:57:50 2008 +0100 files: TODO doc/radare.but wscript description: * Add $$j $$f and $$r to the documentation * Fix install for ruby changeset: 572:c68642f46045 user: pancake <@youterm.com> date: Mon Oct 27 18:37:11 2008 +0100 files: src/plug/hack/ruby.c src/plug/hack/wscript_build src/rabin/dietmach0.c src/rabin/rabin.c wscript description: * Apply revenge unsynced patch for rabin-dietmach0 * Apply some fixups for the ruby build with waf * Apply nibble's patch fixing minor bugs in rabin changeset: 571:c6df65663bbd user: pancake date: Mon Oct 27 10:33:47 2008 +0100 files: src/cons.c src/cons.h src/plug/hack/mkruby.rb src/plug/hack/radare.rb src/plug/hack/ruby.c src/plug/hack/wscript_build src/radare.c description: * Fix a problem with radare_cmd_str - Export cons_noflush * Fixups for the ruby support - Enhaced API - Using IRB as shell - $r is a global variable now ($r=Radare.new()) - Needs install for waf changeset: 570:d8efa7169046 user: pancake date: Sun Oct 26 14:59:50 2008 +0100 files: src/dbg/darwin/debug.c src/dbg/darwin/procs.c src/plug/hack/Makefile src/plug/hack/mkruby.rb src/plug/hack/wscript_build description: * Fix build for OSX with make * Build ruby module using mkmf module - mkruby.rb does the magic - imported from waf and make changeset: 569:2d527c2fd754 user: pancake date: Sat Oct 25 13:03:31 2008 +0200 files: src/dbg/darwin/procs.c src/dbg/darwin/syscall.c src/dbg/objects.mk src/rabin/dietmach0.c src/rabin/rabin.c description: * Import revenge's patch for rabin/dietmach0 - Add some -r stuff * Theorically fix build for make+darwin changeset: 568:a3fbf977791e user: pancake date: Sat Oct 25 11:55:10 2008 +0200 files: waf wscript description: * Revert waf...stupid devels changeset: 567:99d1c9e26630 user: pancake <@youterm.com> date: Fri Oct 24 20:09:04 2008 +0200 files: Makefile.acr TODO config.mk.acr global.h.acr gui/Makefile src/arch/arm/aasm/Makefile src/arch/arm/aasm/aasm.c src/rabin/dietelf.c src/rabin/dietmach0_utils.c waf wscript description: * Buggy WAF update (sync with svn) aka 1.5.0 - New version is completely different from the API pov - Fixes build with make, but breaks all waf related GRR :( changeset: 566:2228e40407aa user: pancake <@youterm.com> date: Fri Oct 24 17:58:01 2008 +0200 files: src/rabin/dietpe.c src/rabin/rabin.c description: * rabin, dietelf (nibble) - minor bugs changeset: 565:0ba94e545fb9 user: pancake <@youterm.com> date: Fri Oct 24 17:50:04 2008 +0200 files: Makefile.acr global.h.acr gui/prefs.c src/Makefile.acr src/config.c src/dbg/debug.h src/dbg/signal.c src/dbg/win32/debug.c src/dbg/win32/signal.c src/grava.c src/javasm/Makefile src/plugin.c src/project.c src/rabin/Makefile src/rabin/aux.c src/rabin/dietelf.c src/rabin/dietmach0_utils.c src/rabin/dietpe.c src/rabin/javasm.c src/rabin/rabin.c src/radare.c src/rsc/Makefile src/rsc/main.c src/utils.c src/utils.h description: * Fix build for mingw32 changeset: 564:091c74cc768f user: pancake <@youterm.com> date: Fri Oct 24 17:01:56 2008 +0200 files: Makefile.acr TODO doc/radare.but man/rax.1 man/xc.1 src/Makefile.acr src/flags.c src/rax.c src/visual.c src/wscript_build src/xc.c description: * Reduce flag space * Rename 'xc' to 'rax' !!! - Sync documentation, manpages and build changeset: 563:267b1a610d84 user: pancake <@youterm.com> date: Fri Oct 24 16:19:17 2008 +0200 files: doc/radare.but src/rabin/dietelf.c src/rabin/rabin.c description: * dietelf - fix string's size issue * Fix halibut problem in doc changeset: 562:267689a095eb user: pancake <@youterm.com> date: Fri Oct 24 13:50:08 2008 +0200 files: TODO doc/radare.but src/analyze.c src/cmds.c src/flags.c src/rabin/rabin.c src/visual.c description: * Do not show 'fs' in rabin strings without -r * New 'ff' command for radare - Flag from (used as base delta for flagging) * Make rabin does not setup a huge block size while flagging strings * Added documentation - io_map (o command for mapping files) - $${eval-var} for get_offset - new ff command (flag from) - 'w' and 'a' keys in visual changeset: 561:aebfc2c43682 user: pancake <@youterm.com> date: Fri Oct 24 12:11:03 2008 +0200 files: src/rabin/aux.c src/rabin/aux.h src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf_static.h src/rabin/dietelf_types.h src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/dietpe_static.h src/rabin/dietpe_types.h src/rabin/pe.h src/rabin/rabin.c src/rabin/wscript_build src/utils.c description: * Added '$${...}' in get_offset for eval vars * rabin, dietpe, dietelf (nibble) - refactoring - full dietpe output - initial import of dietpe_get_strings - fix type issues changeset: 560:9835b6061e0c user: pancake date: Fri Oct 24 10:05:52 2008 +0200 files: src/cmds.c src/plugin.c src/plugin.h src/utils.c src/visual.c description: * Fix build for io_maps O:) - Use linked lists * '_' key in visual set block size to cursor changeset: 559:76fb591574a3 user: pancake date: Fri Oct 24 00:22:25 2008 +0200 files: TODO src/cmds.c src/plugin.c src/plugin.h src/visual.c description: * Initial work on io_maps changeset: 558:285a2d51f7ab user: pancake <@youterm.com> date: Thu Oct 23 13:36:26 2008 +0200 files: src/ira/ira-pseudo.pl src/rabin/dietelf.c src/rabin/dietelf_types.h src/rabin/dietpe.c src/rabin/dietpe_types.h src/rabin/rabin.c description: * Make ira-pseudo replace +=1 with ++ * Add patch from Nibble for rabin - fix data type issues - remove dietelf output for -Iv - add dietpe output for -S{r,v,vv} -e{r,v,vv} changeset: 557:e3852b46b4af user: pancake <@youterm.com> date: Wed Oct 22 13:46:24 2008 +0200 files: src/ira/ira-pseudo.pl src/ira/ira-to-c.pl src/ira/ira-x86.pl src/ira/test.x86-3.s src/ira/test.x86.s description: * IRA can now generate compilable C code from pseudo - Another test for x86 imported from objdump output - Need exporters for radare and objdump changeset: 556:c161b6ea362c user: pancake date: Wed Oct 22 07:17:42 2008 +0200 files: src/ira/Makefile src/ira/README src/ira/ira-clean.pl src/ira/ira-mips.pl src/ira/ira-pseudo.pl src/ira/ira-to-x86.pl src/ira/ira-x86.pl src/ira/test.mips.s src/ira/test.x86-2.s src/ira/test.x86.s src/rabin/rabin.c description: * Initial import of IRA - Intermediate Raw Assembly - Simple engine for multiarchitecture decompilation - Basic support for x86 and mips changeset: 555:2bee70d6526e user: pancake date: Wed Oct 22 01:59:56 2008 +0200 files: src/rabin/rabin.c src/rabin/rabin.h description: * Fix output for dietelf - Drop -a flag (included in -I) changeset: 554:4b8d277b6495 user: pancake <@youterm.com> date: Tue Oct 21 17:42:23 2008 +0200 files: TODO src/rabin/dietelf.c src/rabin/rabin.c description: * Fix rabin output (baddr+offset) changeset: 553:6e9b96495325 user: fluendo@cocoasink.fluendo.lan date: Tue Oct 21 16:48:03 2008 +0200 files: src/rabin/dietelf.c src/trace.c wscript description: * Fix big endian issues for dietelf - Drop small warn in trace.c changeset: 552:9f86bf3e6662 user: pancake <@youterm.com> date: Tue Oct 21 16:02:18 2008 +0200 files: TODO src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf_static.h src/rabin/rabin.c description: * Apply nibble patch for dietelf - rabin new output format - fix endian issue for elf parsing on big endian boxes changeset: 551:286d8adefc36 user: pancake <@youterm.com> date: Mon Oct 20 19:19:48 2008 +0200 files: src/config.c src/dbg/arch/powerpc-linux.h src/dbg/arch/powerpc.c src/dbg/unix/debug.c src/grava.c src/plug/hack/gtk-actions.c src/plug/hack/gtk-prefs.c src/plug/hack/wscript_build description: * Added gtk-actions to VG (buggy atm) * Fix GETREGS for powerpc (program counter is not there) - on ppc-linux ptrace-getregs swaps its arguments (LAME!) * Fix ag (some buggy refactoring for VG) - makes VG happy again - fix gtk-prefs array overflow changeset: 550:7bb147e2c8d7 user: pancake date: Mon Oct 20 00:34:37 2008 +0200 files: gui/main.c description: * Minor cleanup changeset: 549:5836450661fe user: pancake date: Mon Oct 20 00:34:08 2008 +0200 files: doc/radare.but src/rsc/pool/rfile-foreach description: * Fix rsc rfile-foreach * Doc for asm.section and asm.trace changeset: 548:f6cdbba12c8f user: pancake date: Mon Oct 20 00:29:42 2008 +0200 files: src/cmds.c src/config.c src/grava.c src/hack.c src/plug/hack/gtk-prefs.c src/plug/hack/gtk-topbar.c src/plug/hack/scriptedit.c src/radare.c src/rsc/pool/rfile src/visual.c description: * Added gui.* eval vars the visual GUI (new VG command) - gui.top, gui.left, gui.tabs.. - define the GUI by placing gui-hack plugins in a layout - initial steps for the plugin based gui :D - so many crashes atm, needs some work - added missing 'rfile' rsc script * Added ruby and radare script formats for scripteditor plugin * Added asm.section and asm.trace in gtk-prefs plugin changeset: 547:2253fb277201 user: pancake date: Sun Oct 19 13:28:01 2008 +0200 files: src/code.c src/flags.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf_static.h src/rabin/dietelf_types.h src/rabin/elf.h src/rabin/rabin.c src/rabin/rabin.h description: * dietelf patch from Nibble - more refactoring :) * Fix asm.section (nibble) changeset: 546:860deec95f35 user: pancake@bare date: Sat Oct 18 16:48:12 2008 +0200 files: src/config.c src/rabin/dietelf_types.h description: * Add missing .h * Fix unknown bug in config.c changeset: 545:0b536b2ad7c5 user: pancake@bare date: Sat Oct 18 16:40:12 2008 +0200 files: src/grava.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf_static.h src/rabin/dietpe.c src/rabin/rabin.c src/rabin/wscript_build wscript description: * asm_state_save/restore for grava.c -- buggy too O:) * Import Nibble's patch for dietELF - Major refactoring changeset: 544:009455ff354f user: pancake date: Sat Oct 18 12:33:49 2008 +0200 files: src/flags.c description: * Add 'fh' in help - fix minor warning changeset: 543:9bd2248e900b user: pancake date: Sat Oct 18 12:31:43 2008 +0200 files: src/analyze.c src/cmds.c src/code.c src/config.c src/flags.c src/flags.h src/rdb.c src/rdb.h tests/split-graph.c description: * Buggy commit - Includes a mostly working but buggy graph_split algorithm - Test case for it (tests/split-graph.c) - asm.section=true by default - flag_get_here_filter is used with "section_" to get the section name. - Usable from 'fh' flag here changeset: 542:3d2e63e82d52 user: pancake date: Sat Oct 18 01:56:59 2008 +0200 files: TODO src/arch/arm/code.c src/code.c src/dietline.c src/plug/hack/ruby.c src/plug/hack/wscript_build src/print.c src/print.h src/radare.c src/rasc/rasc.c src/utils.c wscript description: * Build ruby with wscript * Use x86-ascii nops for rasc instead of \x90 * pm and pe show double values (8 bytes) * Fix code analysis in arch_arm * Some fixups for the labels stuff * Fix a bug in pm limitting args to 3 changeset: 541:061124df49c2 user: pancake <@youterm.com> date: Fri Oct 17 20:18:56 2008 +0200 files: src/print.c description: * Fix damn stupid bug in zoom print mode changeset: 540:ffde8c7f05cc user: pancake <@youterm.com> date: Fri Oct 17 17:39:27 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf_static.h description: * dietelf - fix imports - add dietelf_type changeset: 539:fbb98f5961ac user: pancake <@youterm.com> date: Fri Oct 17 16:27:33 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietpe_types.h src/rabin/elf.h src/rabin/pe.h src/rabin/rabin.c description: * dietelf - clean up - fix address mask - add baddr to the -I output - s/asm.arch/asm.os/ changeset: 538:5f46e040fc4d user: fluendo@cocoasink.fluendo.lan date: Fri Oct 17 15:00:38 2008 +0200 files: src/dbg/arch/powerpc-linux.h src/dbg/arch/powerpc.c src/dbg/arch/powerpc.h src/dbg/libps2fd.h src/dbg/regs.h wscript description: * Initial working port of the debugger for linux-powerpc32 changeset: 537:d1723ef601df user: pancake <@youterm.com> date: Thu Oct 16 18:32:39 2008 +0200 files: doc/radare.but description: * Added documentation for the brainfuck debugger changeset: 536:d79c175cd98a user: pancake <@youterm.com> date: Thu Oct 16 16:45:44 2008 +0200 files: src/arch/bf/code.c src/plug/io/bfdbg.c description: * New commands for the brainfuck debugger: - Add !trace - Add !contsc (until read, write or trap) * Fix segfault in bfvm_peek(); changeset: 535:97874928bbff user: pancake <@youterm.com> date: Thu Oct 16 13:58:53 2008 +0200 files: scripts/hello.bf scripts/reto.bf src/arch/bf/code.c src/code.c src/plug/io/bfdbg.c src/rabin/dietelf.c description: * Brainfuck examples - Added hello.bf for testing the vm - Fixed reto.bf * Fix brainfuck disassembler (thx Gadix for testing+tips) - Fix limit of instruction reps to 256 instead of 32 - Fix >4 repctr bug (max inst len is 1024 now) - Identify 00 and FF as traps - Use add/sub instead of inc/dec when repctr>1 * Write support for virtual sections (input, screen, data) - Fix bfvm_dec(); - !reg eip 33 ; set eip to 33 in bf debugger - Added !cont ; to continue until address - Stop !cont in traps * Added minor dietelf patch from Nibble (thx!) changeset: 534:9a57aef86929 user: pancake date: Thu Oct 16 07:24:43 2008 +0200 files: src/objects.mk src/plug/io/bfdbg.c description: * Added input and screen buffers to the brainfuck debugger - peek and poke implemented - needs more registers - added sections screen and input changeset: 533:20f24a0400a4 user: pancake date: Thu Oct 16 07:00:15 2008 +0200 files: TODO src/Makefile.acr src/data.c src/plug/hack/radare.rb src/plug/io/bfdbg.c src/plug/io/wscript_build src/plugin.c src/plugin.h src/rabin/rabin.c src/radare.c src/visual.c vala/grava/renderer.vala description: * Initial import of the brainfuck debugger IO plugin - implemented a basic BF virtual machine with API - radare bfdbg://./helloworld.bf - Support step, stepover, get/set registers * Fix file.analyze with bf files * Better renderer for looping edges * Fix Vdc or Cc 30 segfault * Minor changes in the ruby api changeset: 532:29e351093852 user: pancake date: Thu Oct 16 03:08:08 2008 +0200 files: Makefile.acr gui/Makefile gui/sidebar.c gui/topbar.c gui/wscript_build man/hasher.1 man/rahash.1 scripts/reto.bf src/arch/bf/code.c src/objects.mk src/plug/hack/Makefile src/plug/hack/radare.rb src/plug/hack/ruby.c src/rabin/Makefile src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietmach0.h src/rabin/rabin.c src/rabin/rabin.h description: Nibble patch: * dietelf - add ELF_ADDR_MASK - fix symbol offsets for relocatable files * rabin - fix -xi -xz - -z and -zv look for strings in .rodata - -zvv look for strings in whole file pancake patch: * Fix build for acr/make - Added gtk-* targets * Add brainfuck fileformat autodetect for rabin - Code analysis now enables the graphs view to work - Needs some more love * Fix ruby plugin segfault and enhace api changeset: 531:d290611c9627 user: pancake <@youterm.com> date: Wed Oct 15 20:26:46 2008 +0200 files: src/arch/bf/code.c src/code.c src/code.h src/wscript_build description: * Initial import of the BrainFuck disassembler - Added some basic code analysis stuff for it changeset: 530:dbbb83ed629a user: pancake <@youterm.com> date: Wed Oct 15 18:02:51 2008 +0200 files: src/analyze.c src/cmds.c src/code.c src/code.h src/data.c src/data.h src/grava.c src/main.h src/rdb.c description: * Fix build.. Oops some love for data.h changeset: 529:96673de4bda1 user: pancake date: Wed Oct 15 07:16:19 2008 +0200 files: src/code.c src/data.c src/print.c src/rabin/rabin.c description: * Added dummy rabin -xi, -xz for imports and strings - using pC @@ sym and pC @@ imp commands - Nice PoC, but needs more love * New command 'pC' shows metadata (xrefs code/data basically) - Useful for string and function references changeset: 528:2333b011b3f9 user: pancake date: Wed Oct 15 06:15:44 2008 +0200 files: TODO doc/radare.but gui/main.c gui/sidebar.c src/analyze.c src/cmds.c src/code.c src/config.c src/data.c src/data.h src/flags.c src/flags.h src/plug/hack/gtk-prefs.c src/plug/hack/gtk-topbar.c src/plug/hack/wscript_build src/print.c src/print.h src/project.c src/rabin/dietelf.c src/radare.c src/utils.c src/visual.c src/wscript_build description: * Fix 'C.' with no arguments * more docu for pi, pf, pr, pz .. * Reimplement gnome topbar as a hack plugin * Enhace the code and data analysis * Added $$j, $$f, $$r (jump, fail and ref) - $$? for help * Added cfg.sections to use or not base address per seek * New command: Ci (metadata information) changeset: 527:799ed87e87d2 user: pancake <@youterm.com> date: Mon Oct 13 18:31:42 2008 +0200 files: src/dbg/arch/i386.c src/dbg/debug.c src/dbg/events.c src/dbg/unix/debug.c src/plug/hack/fj.c src/plug/hack/nj.c src/radare.c description: * Fix debugger for OpenBSD and NetBSD (waitpid+WUNTRACE required) * Minor code and warnings cleanup changeset: 526:5fb349afc7a3 user: pancake <@youterm.com> date: Mon Oct 13 11:01:10 2008 +0200 files: src/rabin/dietelf.c src/rabin/rabin.c description: * Import dietelf nibble's patch - fix got offset - code/syntax cleanup changeset: 525:047972100d1c user: pancake <@youterm.com> date: Fri Oct 10 13:41:00 2008 +0200 files: doc/radare.but description: * Documentation for nj and fj hacks - Some more fixups for the doc changeset: 524:f36e178ee0b7 user: pancake date: Fri Oct 10 06:24:24 2008 +0200 files: TODO doc/Makefile doc/radare.but src/cmds.c src/plug/hack/radare.py description: * Fix python api for hex() and so to use p8, p16... * Lot of new stuff for the book - $$ and $$$ explained - update pm to print arrays of structures - documentation for 'wo*' commands - xor,add,sub... - add doc for the yt command. 'yank to' - some info about xrefs - search hits command execution (cmd.hit) - added some tips and a real example :) - enlarge a bit the python scripting documentation * Make :? command show only the hex value of the expression changeset: 523:50aa300ed5cf user: pancake date: Fri Oct 10 05:05:03 2008 +0200 files: doc/Makefile doc/radare.but description: * Add full-featured html rendering for the book =) - doc/html/contents.html changeset: 522:c62e7b487377 user: pancake date: Fri Oct 10 04:42:50 2008 +0200 files: TODO src/analyze.c src/cmds.c src/dbg/debug.c src/main.c src/project.c src/radare.c src/undo.c description: * Comment syscalls properly in metadata - useful for static binaries * Fix dbg.bep with main - Now can be used with 'radare -s main -d rasc' - -s is a synonim for -e dbg.bep in debugger mode :) * Prompt user for dropping changes done on the file before exiting changeset: 521:9dce9f42acc4 user: pancake date: Fri Oct 10 04:09:24 2008 +0200 files: TODO src/cmds.c src/code.c src/code.h src/io.c src/print.c src/rabin/dietmach0_utils.c src/rabin/rabin.c src/visual.c description: * Add DATA_STRUCT linked to Cm - From visual with Vdm - Asks the user for the memory format string to define the structure in pm format (with arrays) * Move wX to wox - Lot of operations can now be done over the block - add, sub, shift right, shift left, mul, sub, and, or, xor * Some minor fixups - For pm command - added pm t (for time (unix timestamp in structures) - rabin -a in help..added -S working for dietmach0 (basic port) changeset: 520:edfd4d1b9610 user: pancake date: Fri Oct 10 02:00:34 2008 +0200 files: src/dbg/darwin/debug.c src/print.c src/rabin/dietmach0.c src/rabin/dietmach0.h src/rabin/dietmach0_utils.c src/rabin/rabin.c src/rabin/wscript_build description: * Initial import of revenge's diet-MACH-O parser - Tested on linux and osx (Thanks!) * Fix 'pm' without arguments changeset: 519:637e14ddc481 user: pancake date: Fri Oct 10 01:38:27 2008 +0200 files: src/print.c src/utils.c src/utils.h description: * Fix pm again O:) - Some stetic changes - Fix segfault when handling 1word strings * Add strsub_memcmp - Support for masking buffer comparisions - scr.filter now support '?' char for masking For example: V#i0x???\t...^C:wq changeset: 518:2e50f12d3961 user: pancake date: Fri Oct 10 01:19:03 2008 +0200 files: TODO src/code.c src/cons.c src/flags.c src/print.c src/radare.c src/radare.h src/utils.c src/visual.c description: * Fix '#' command in visual * Use cons_strcat when possible (minor optimization in disassembler) * Fix pm args handling - Fix set0word changeset: 517:af5853787975 user: pancake date: Fri Oct 10 00:42:09 2008 +0200 files: TODO src/cmds.c src/hack.c src/plug/hack/fj.c src/plug/hack/nj.c src/plug/hack/wscript_build src/plugin.c src/print.c src/radare.c src/utils.c src/utils.h src/visual.c description: * Rename yf to yt - yank to * Refactor negjmp and forcejmp hack plugins outside the core - Export some more symbols for core functions resolver for plugins * Make 'pm' be more pawaful - pm 3xiz addr len str - Allow to specify field names - Support for array of structures * cfg.analyze - Also analyze from entrypoint changeset: 516:72ecd91be379 user: pancake <@youterm.com> date: Thu Oct 09 20:42:39 2008 +0200 files: TODO src/cmds.c src/print.c src/rabin.c src/rabin/rabin.c src/radare.c src/radare.h src/visual.c description: * Add analyze verbosity * Remove 'm' in pro to 'yf'..needs some thinkage * move print_mem outside the print switch/case - make it work again (radare_move was broken) changeset: 515:646214aa04ac user: pancake <@youterm.com> date: Wed Oct 08 19:15:31 2008 +0200 files: TODO src/print.c src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/rabin.c description: * dietpe (nibble patch) - fix previous merge (import's count) - add section privileges macros changeset: 514:da2f263bfe1c user: pancake <@youterm.com> date: Wed Oct 08 14:48:16 2008 +0200 files: TODO doc/radare.but gui/prefs.c src/plug/hack/gtk-prefs.c src/plug/hack/wscript_build description: * Documentation added for 'rabin -r' - Binary patching * Added new gtk plugin > H gtk-prefs ; (extracted from the gui) changeset: 513:62135d37fdbe user: pancake <@youterm.com> date: Wed Oct 08 14:26:07 2008 +0200 files: TODO doc/radare.but src/analyze.c src/cmds.c src/code.h src/print.h src/rabin/dietpe.c description: * Add documentation for cfg.datefmt * Fix build for rabin (oops) * Initial mockup of .ad* command - Needs much more love and tests changeset: 512:b9b6c920c607 user: pancake <@youterm.com> date: Wed Oct 08 11:27:46 2008 +0200 files: doc/radare.but src/rabin/dietpe.c src/rabin/dietpe_static.h src/rabin/pe.h src/rabin/rabin.c description: * rabin / dietpe - refactoring - section privileges resolution changeset: 511:ac996a614ade user: pancake <@youterm.com> date: Tue Oct 07 19:13:07 2008 +0200 files: TODO doc/radare.but src/arch/x86/code.c src/dbg/bp.c src/dbg/bp.h src/dbg/debug.c src/dbg/debug.h src/dbg/unix/debug.c src/radare.c src/radiff/bindiff src/radiff/bytediff.c src/radiff/main.c src/rsc/pool/bdcolor src/rsc/pool/bdf2rad src/rsc/pool/bindiff src/utils.c src/utils.h tests/chk/debug.sh tests/chk/flags.sh tests/chk/one-byte.sh tests/chk/radiff-test.sh description: * Add documentation for sections command 'S' - Also document sS one * Added !bpt for breakpoint traces - Not yet working, but mostly defined * radiff -r renamed to -p (to diff program analysis) - radiff -r now shows radare commands to stdout. - Added test script for radiff patching with radare $ radiff -rd /bin/true /bin/false | radare -nvw /bin/true - this command will patch /bin/true to act as a /bin/false - move bindiff to rsc again - added bdf2rad for it * Added test for [1:0x0] expression changeset: 510:479145944d81 user: pancake date: Tue Oct 07 05:33:22 2008 +0200 files: src/arch/x86/code.c src/grava.c vala/grava/edge.vala vala/grava/graph.vala vala/grava/renderer.vala vala/grava/widget.vala description: * Enhace the graph interface with some keybindings - u = undo node selection (Store selection history) - : = seek to eip - . = seek to selected node - s/S = step , stepover - F9 = continue - t/f = seek to true or false node - b/B - set/unset breakpoint on selected node - hjkl/arrows = move around - better colorization using beige changeset: 509:cc2cf4298a8c user: pancake date: Tue Oct 07 02:39:59 2008 +0200 files: TODO doc/radare.but src/cmds.c src/dietline.c src/dietline.h src/hist.c src/rabin/dietpe.c src/rabin/dietpe_static.h src/rabin/pe.h src/radare.c src/radare.h description: * Added documentation for asm.objdump - Updated doc for seek and write commands * Implemented a dummy basic labeling implementation for scripting in dietline.c. It is ATM only working without readline. * Import Nibble's patch for dietPE - take into account delay-load imports changeset: 508:febec1532828 user: pancake <@youterm.com> date: Mon Oct 06 19:22:38 2008 +0200 files: src/grava.c src/utils.c vala/grava/node.vala vala/grava/renderer.vala vala/grava/widget.vala description: * New colors and so for the grava - Added minimize button instead of full clickable title - Autofit nodes while hiding the body - Added dummy popup menu * Make get_pointer work with multiple sizes - Also supports cfg.bigendian - 1,2,4,8 - Accessible with > ? [4:0x8048000] > ? [2:0x8048000] * Added autocompletable hexadecimal addresses prefixed with '.' [0x804800]> s ..33 ; seeks to 0x804833 changeset: 507:2921d30907e1 user: pancake date: Mon Oct 06 17:20:18 2008 +0200 files: gui/toolbar.c src/analyze.c src/rdb.c vala/grava/renderer.vala description: * Dummy train travel patch changeset: 506:dfda4a2773a6 user: pancake <@youterm.com> date: Mon Oct 06 13:35:15 2008 +0200 files: src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/pe.h src/rabin/rabin.c description: * dietpe patches from Nibble - class, machine and subsystem strings - dll and endianness identification - stripped objects information changeset: 505:c010a8cb3113 user: pancake <@youterm.com> date: Mon Oct 06 12:21:38 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf64.c src/rabin/dietelf64.h src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/dietpe_static.h src/rabin/dietpe_types.h src/rabin/pe.h src/rabin/rabin.c description: * Fix some BSD issues in dietelf * dietPE updates from Nibble - Show RVA - Fix offsets for symbols changeset: 504:88b1c6abe301 user: pancake <@youterm.com> date: Fri Oct 03 17:27:02 2008 +0200 files: src/grava.c vala/grava/node.vala vala/grava/renderer.vala vala/grava/widget.vala description: * Implement toggleable body in graphs - Fix Node.add_call to be uint64 - More grab_focus triggers changeset: 503:bde079e9cd2a user: pancake <@youterm.com> date: Fri Oct 03 16:48:40 2008 +0200 files: src/arch/arm/gnu/arm-dis.c src/cmds.c src/config.c src/grava.c vala/grava/graph.vala vala/grava/main.vala vala/grava/widget.vala description: * Drop \t from the gnu disassember for ARM - Ugly bitches! * Added shift+ciontrol modifiers for Grava - Zooms and Rotates the graph (Yay! :P) * Added command 'ag.' to export a graphviz code graph - Added dummy graph.layout=graphviz changeset: 502:b4f878bb875d user: pancake date: Thu Oct 02 20:21:49 2008 +0200 files: TODO src/config.c src/rasc/wscript_build src/visual.c description: * Add cmd.vprompt2 and cmd.vprompt3 * Fix build for nonsysproxy changeset: 501:d077677063e8 user: pancake date: Thu Oct 02 20:14:34 2008 +0200 files: src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/dietpe_static.h src/rabin/dietpe_types.h src/rabin/pe.h src/rabin/rabin.c description: * dietpe rewrite (import Nibble's patch) - info - sections - exports - imports * integration of dietpe with rabin * fix rabin -z for unknown file formats changeset: 500:51183444dc30 user: pancake date: Thu Oct 02 20:11:49 2008 +0200 files: src/cmds.c src/plug/io/sysproxy.c src/plug/io/wscript_build src/plugin.c src/project.c src/rasc/rpc.c src/rasc/sysproxy.c src/rasc/wscript_build src/wscript_build wscript description: * 'o' command with no arguments return opened file * Make --with-sysproxy for waf work * Make section_list mark where you are located ala !maps? changeset: 499:bb22ebcaa332 user: pancake date: Thu Oct 02 04:30:28 2008 +0200 files: TODO src/analyze.c src/arch/x86/code.c src/code.c src/code.h src/objects.mk src/plug/hack/wscript_build src/rabin/dietelf.c src/radare.c src/radare.h src/section.c src/utils.c description: * Make code analyze use 4096 as block size (avoid buggy analisis) * Fix problems with data types. - folders are now usable again \o/ - all data conversions too - needs some code cleanup (too spaguetti O:) * Build scriptedit amb gtk-hello plugins with waf - Fix build for make * Rabin: does not show section 0 aka null changeset: 498:6f428e1e48d6 user: pancake date: Thu Oct 02 03:15:21 2008 +0200 files: src/analyze.c src/cmds.c src/cmds.h src/config.c src/io.c src/project.c src/rabin/dietelf.c src/radare.c src/radare.h src/section.c src/section.h src/utils.c src/utils.h src/wscript_build description: * New command 'S' to manage sections - Change file.baddr depending on seek > S ; list sections\n"); > S* ; list sections (in radare commands\n"); > S= ; list sections (in visual)\n"); > S 4096 0x80000 rwx section_text @ 0x8048000 ; adds new section\n"); > S 4096 0x80000 ; 4KB of section at current seek with base 0x.\n"); > S 10K @ 0x300 ; create 10K section at 0x300\n"); > S -0x300 ; remove this section definition\n"); > Sc rwx _text ; add comment to the current section\n"); > Sb 0x100000 ; change base address\n"); > St 0x500 ; set end of section at this address\n"); > Sf 0x100 ; set from address of the current section\n"); * sS - seek to section index - Fixes in the seek command for undo history and relative seeks - Use undo push in '>' and '<' commands * Fix 64 bit bug in af (fixed function sizes) - Added get0word() and set0word() in utils.c changeset: 497:49b755c4d122 user: pancake <@youterm.com> date: Tue Sep 30 17:12:25 2008 +0200 files: TODO src/arch/sparc/code.c src/arch/sparc/gnudisparc.c description: * Fix sparc disassembler changeset: 496:19ddd5b38a6d user: pancake date: Tue Sep 30 19:01:53 2008 -0400 files: src/analyze.c src/arch/mips/code.c src/cmds.c src/code.c src/visual.c description: * More fixups for the mips code analysis * Fix lines in visual mode - do not analyze more lines than screen height * Added 'x' in visual to 'xrefs here' for code and data xrefs * Rename sd to sX to fit with CX * Fix endian issues while disassembling in MIPS - Needs more love for arm, powerpc and sparc NOW changeset: 495:565eec0a602f user: pancake date: Tue Sep 30 16:56:44 2008 -0400 files: src/arch/mips/code.c src/arch/mips/gnudismips.c src/arch/sparc/gnudisparc.c src/dbg/debug.c src/rsc/pool/syms-pe-flag description: * Fix !stepbp for mips - Handle some more branch instructions - Fix branch disassembly for mips (%x -> %llx) bfd_vma oops - Have some endian problems between code analysis and disassembly * Fix recursive forkbomb with syms-pe-flag (thx esteve :) changeset: 494:023225af51b6 user: pancake date: Tue Sep 30 05:19:32 2008 +0200 files: TODO src/analyze.c src/cmds.c src/code.c src/code.h src/dbg/mem.c src/dbg/system.c src/dietline.c src/flags.c src/grava.c src/rabin/dietelf.c src/rabin/rabin.c src/radare.c src/radare.h src/rdb.c src/rsc/pool/maps src/trace.c src/undo.c src/undo.h src/utils.h src/visual.c vala/grava/default_layout.vala vala/grava/graph.vala vala/grava/layout.vala vala/grava/node.vala description: * Visual mode now handles shift+arrow keys for selecting bytes * Added arch.aop = objdump - uses asm.objdump to disassemble - keeps previous asm.arch for code analysis * Remove depth limit for graphs - Make the graph nodes be freely moved by the user * Fix file.analyze invalid commands problems * Rename 'R' to 'g' command (graph management) - New 'gc' similar to 'ac' but using graph information - 'ga' alias for 'ac @ addr' - 'gs' save graph to disk (dummy TODO) * Added radare_cmdf() * New undo all and undo reset commands for 'undo write history' - ua = undo all write changes - ur = redo all write changes * Do not use '[' or ']' for flag names! * Remove !lib (for >1.0) * New seek commands for code analysis - sc N : seek to call number N (like in visual) - sx N : seek to xrefs N - sd N : seek to data reference N * Added ?x command to act like ? but only shows in hexa - Used in the debugger view to measure the stack size * Make dietline compile alone changeset: 493:bb9e52faa880 user: pancake <@youterm.com> date: Mon Sep 29 16:44:23 2008 +0200 files: doc/Makefile doc/radare.but description: * Lot of fixups for the book - added file.analyze in documentation - Refactor print modes as sub-entries for 'print' - Initial explanation for scripting (rsc, lua, python) - greets++ changeset: 492:c527ce30124e user: pancake <@youterm.com> date: Mon Sep 29 13:40:10 2008 +0200 files: doc/Makefile doc/radare.but src/plug/io/socket.c src/rabin/rabin.c src/socket.c src/utils.c description: * Added Nibble's patch to fix the PE identification * Fix documentation for flag intersections * Add documentation for socket:// plugin - Fix socket_ready() in socket.c (nonblocking yeah!) - add documentation for radapy - added immunity debugger client example * Also scape '\n' \r' and '\e' in strings (useful for writing) changeset: 491:3759777f06f7 user: pancake date: Mon Sep 29 04:31:17 2008 +0200 files: doc/radare.but description: * Oops merge rabin doc of nibble again :O * Add doc for :pd and sn, sb - cosmetic fix in bochs-python doc changeset: 490:5e9f1196ec5f user: pancake date: Mon Sep 29 04:18:34 2008 +0200 files: doc/radare.but src/cmds.c src/code.c src/flags.c src/flags.h src/main.c src/project.c description: * Implement flag-interpolation (fi) - Useful for searching header-footer data blocks - Added example in documentation * Make -p -d work (project load+debugger) changeset: 489:bbdfe0cfd686 user: pancake date: Mon Sep 29 03:38:47 2008 +0200 files: TODO src/code.c src/project.c src/utils.c description: * Better output for :pd * Properly fix the C* command for project. (portable solution?) * Added $$ and $$$ for here and opcode size offset aliases - s $$ + $$$ changeset: 488:8a04934e7662 user: pancake date: Mon Sep 29 03:18:16 2008 +0200 files: src/analyze.c src/cmds.c src/project.c src/radare.c src/radiff/rdbdiff.c src/rdb.c src/rdb.h description: * Some minor buggy fixups for radiff -r - Needs much more love :" * Added 'sn' and 'sb' seek commands - sn : seek to next opcode - sb : seek to opcode branch * Added doc in the book for the project command - Optimized flag space storage - Uses cons_flush() now :? changeset: 487:b743cd4d7518 user: pancake date: Mon Sep 29 02:23:35 2008 +0200 files: TODO doc/radare.but src/analyze.c src/cmds.c src/config.c src/cons.c src/flags.c src/main.c src/project.c src/rabin/dietelf.c src/radare.c src/radiff/Makefile src/radiff/main.c src/radiff/rdbdiff_main.c src/rdb.c src/rdb.h description: * Make the project flag be powerful :) - Now it is possible to store/restore metadata from files - Independently from the debugger or disk file - Project files are loaded also from radiff - Unification of formats for metadata is important :) changeset: 486:cc76f1ffd881 user: pancake date: Sun Sep 28 22:44:42 2008 +0200 files: TODO doc/radare.but scripts/radapy-bochs.py scripts/radapy.py scripts/radapy_bochs.py src/arch/x86/code.c src/code/syscall.c src/radiff/README description: * Add documentation for radare + Ero Carrera's python-bochs - Working and usable implementation * Lot of new debugger commands. - !step, stepo, mem, regs, fpregs, cregs, reg (get/set), bp changeset: 485:a71f73517884 user: pancake date: Fri Sep 26 21:57:59 2008 +0200 files: scripts/radapy-bochs.py scripts/radapy.py src/code/syscall-darwin.c src/code/syscall-freebsd.c src/code/syscall-linux.c src/code/syscall-netbsd.c src/code/syscall.c src/code/syscall.h src/dbg/procs.c description: * Initial import of the working radare python bochs interface - Yeah! Thanks ero for this awesome python-bochs integration! * Initial refactor for non-debug code module - brbrbr, needs to rewrite so much... changeset: 484:f187c6742821 user: pancake <@youterm.com> date: Fri Sep 26 14:42:42 2008 +0200 files: TODO doc/radare.but src/binparse.c src/cmds.c src/search.c description: * Fix and add documentation for the '/.' command - New token file format - Support for binary masks from file - Needs cleanup..old weird code must die changeset: 483:ca8a9dfb3901 user: pancake@fluendo-build date: Thu Sep 25 23:54:31 2008 +0200 files: src/code.h src/cons.c src/cons.h src/dbg/arch/x86_64-bp.c src/dbg/arch/x86_64.c src/dbg/arch/x86_64.h src/dbg/lib.c description: * Fix build for x86-64. Minor Oops :) changeset: 482:c5d065546e98 user: pancake <@youterm.com> date: Thu Sep 25 13:28:14 2008 +0200 files: TODO doc/radare.but scripts/pydare-example.py scripts/pydare.py scripts/radapy-example.py scripts/radapy.py src/analyze.c src/cons.c src/cons.h src/dbg/bp.c src/hack.c src/io.c src/rabin/dietmach0.c src/rabin/rabin.c src/rdb.c src/utils.h src/visual.c description: * Added book documentation for disassembly - searchs options + multiple keywords + binary masks - rasc and used for shellcode builder * pydare renamed to radapy * Some code cleanup and indentation fixup changeset: 481:d440c1090ff8 user: pancake date: Wed Sep 24 15:56:15 2008 +0200 files: TODO src/kradare/dtdumper/Changelog src/kradare/dtdumper/Makefile src/kradare/dtdumper/README src/kradare/dtdumper/dtdumper.c description: * Add dtdumper in kradare - Just for inspiration... $ radare -u /dev/kmem && seek 0xc0105bc0 [0xC0105BC0]> :pd 2 push dword 0xffffff48 jmp 0xc0105d6c changeset: 480:f9dc6d21a697 user: pancake date: Wed Sep 24 15:03:58 2008 +0200 files: scripts/pydare-example.py scripts/pydare.py scripts/rapyl-example.py scripts/rapyl.py src/config.c src/cons.c description: * rapyl renamed to pydare - Added fun_open hook * Added nicer scr.pal. eval tree - easier color palette configuration - support strings like (e scr.pal.prompt = red) changeset: 479:8d5b22517308 user: pancake date: Wed Sep 24 14:30:31 2008 +0200 files: TODO scripts/rapyl-example.py scripts/rapyl.py src/analyze.c src/cmds.c src/code.h src/config.c src/cons.c src/environ.c src/plug/io/remote.c src/print.c src/radare.c src/radare.h src/utils.c src/utils.h src/visual.c description: * Make the ` concat char work again \o/ * Remote IO plugin is now for 64 bits - Added htonq and ntohq in utils * Make rapyl work as a module (python remote) - Needs a new name O:) - Added hooks for commands - Show client IP address - Added rapyl-example.py - Now with 64 bit support * Show bytes in analyze - Dummy syscall commenter - needs vm+asm.os syscall tables * Fix problems with user defined scr.width - Some unused code removed - Split cons_print_real from cons_print changeset: 478:a0d68460b01a user: pancake date: Wed Sep 24 03:27:40 2008 +0200 files: src/analyze.c src/binparse.c src/cmds.c src/dbg/darwin/debug.c src/rabin/Makefile src/rabin/dietmach0.c src/rabin/dietmach0.h src/rabin/dietmach0_errors.h src/rabin/dietmach0_utils.c src/rabin/dietpe.c src/rabin/rabin.c src/rabin/wscript_build src/radare.c description: * Initial import of the revenge's dietmacho - Only for make (needs fix to build on !osx) * Optimize old_task for single pid debugging on osx (thx rev) * Fixed data reference comments * Added patch from Nibble - remove the flag "entry" - fix PE automagically identification - dietpe initial make over :P changeset: 477:b4e3f9f04321 user: pancake date: Wed Sep 24 02:57:29 2008 +0200 files: TODO src/analyze.c src/arch/x86/code.c src/cmds.c src/code.h src/dietline.c src/environ.c src/plug/io/malloc.c src/radare.c src/rasc/rasc.c description: * Fix nonverbose dietline bug (rasm -d affected) * Fix malloc:// + file.write=true segfault * Added radare_systemf for formatted system - Fix build O:) * Make rasm -E start with 'A' and do it sequentialy by 4 to 4 repeated bytes * Added data references for x86 code analysis - Differenciate values to references changeset: 476:eef3720585c5 user: pancake <@youterm.com> date: Tue Sep 23 20:45:40 2008 +0200 files: scripts/rapyl.py description: * Update for 32/64 bit at python-remote (thx Michal) changeset: 475:483a58b058a2 user: pancake <@youterm.com> date: Tue Sep 23 19:37:10 2008 +0200 files: TODO description: * Define TODO for 1.0 changeset: 474:83c1ee895f75 user: pancake <@youterm.com> date: Tue Sep 23 17:54:37 2008 +0200 files: TODO scripts/rapyl.py src/cmds.c src/dbg/darwin/debug.c src/plug/hack/wscript_build src/plug/io/remote.c src/rabin/rabin.c src/radare.c src/utils.h src/visual.c wscript description: * 'Fix' the stepping bug in the OSX debugger (thx revenge!) * Added initial working version of the python-remote server * Add lua-wscript build fix (thx Nibble) * Added htonq for 64 bit network endianness - Must be used for the remote protocol - Added radare_systemf() for format systems changeset: 473:471f18f8159c user: pedro@dhcp-206.fluendo.lan date: Tue Sep 23 11:36:50 2008 +0200 files: src/dbg/darwin/syscall.c description: * Oops. add missing syscall handler for osx debugger changeset: 472:51f4719f436d user: pedro@dhcp-206.fluendo.lan date: Mon Sep 22 14:20:54 2008 +0200 files: doc/xtra/osx-xnu-syscall.h src/code.c src/config.c src/dbg/darwin/debug.c src/dbg/unix/debug.c src/rasc/shellcodes.c src/search.c description: * Fixed some syscall doc for osx (BSD/XNU) - Stuff moved to darwin/syscall - Fix build for OSX * Added search.align to only get hits in aligned addresses changeset: 471:73ac14b01de6 user: pancake date: Mon Sep 22 10:36:17 2008 +0200 files: scripts/rapyl.py src/arch/x86/code.c src/dbg/debug.c src/dbg/unix/debug.c src/rabin/rabin.c src/visual.c description: * Added rapyl (python interface for radare remote) * Some x86-stack related code analysis ++ * Minor experimental changes == 1.0 beta == changeset: 470:c776c88c320b user: pancake <@youterm.com> date: Fri Sep 19 14:06:15 2008 +0200 files: README src/cmds.c src/config.c src/dbg/arch/i386.c description: * Update README for rasm and rahash * Make bigendian eval sync with config.endian changeset: 469:b0b6e79fcf15 user: pancake <@youterm.com> date: Wed Sep 17 17:32:18 2008 +0200 files: doc/radare.but doc/xtra/mips src/analyze.c src/code.c description: * Add some documentation for 'af' report * Added sparc+mips opcode documentation (doc/xtra) * Invalid read to stderr and use 0x for hexa in xrefs changeset: 468:fd930371625c user: pancake date: Wed Sep 17 19:00:00 2008 -0400 files: src/dbg/arch/i386.c src/dbg/arch/mips.h src/dbg/arch/mips64.c src/dbg/debug.c src/dbg/libps2fd.h src/dbg/unix/debug.c src/plug/hack/wscript_build wscript description: * Fix build for mips64 - debug_fork() depends on system,..not arch - Implement CPU_ARG0,... for mips - is_soft_stepoverable readded to mips * Fix build when no python found - Added --without-python flag changeset: 467:94ceb8caa0e7 user: pancake <@youterm.com> date: Wed Sep 17 16:12:35 2008 +0200 files: TODO gui/grsc/Shell gui/main.c gui/menubar.c src/cmds.c src/io.c src/radare.h src/utils.h description: * Make the GUI loop when exiting nested radare - Makes Shell be inside a while loop - Use ag instead of old pG * Add 'wX' command to write using a xor key on current block changeset: 466:858171ea6331 user: pancake <@youterm.com> date: Wed Sep 17 14:19:01 2008 +0200 files: TODO src/analyze.c src/arch/java/code.c src/arch/x86/code.c src/cmds.c src/code.c src/code.h src/plug/hack/wscript_build src/print.c src/rabin/rabin.c src/visual.c wscript description: * 'af' now outputs a function report - report label, size, blocks, framesize, ncalls, xrefs, args, vars, offset - can be used for function identification (flirt) - af* is now outputting radare cmds - Some minor enhacements in code analysis for x86 and java * Fix build of lua plugin for ubuntu (-llua5.1) - Added --without-lua - Back to rabin for elf imports (huh?) changeset: 465:efaff6f6a8e7 user: pancake date: Wed Sep 17 05:03:53 2008 +0200 files: TODO doc/radare.but src/analyze.c src/plug/hack/ruby.c src/plug/hack/wscript_build wscript description: * Add some rasm documentation * FIx another anoying bug with negative opcodes in analyze * Fix build of lua plugin - Copy radare.rb changeset: 464:39a1fe789d13 user: pancake date: Wed Sep 17 04:32:33 2008 +0200 files: src/analyze.c src/flags.c description: * Show labels for xref calls as comments in 'af' * Split flags with tabs, more readable changeset: 463:2af0cdadb01d user: pancake date: Wed Sep 17 04:28:14 2008 +0200 files: TODO doc/radare.but src/analyze.c src/cmds.c src/code.c src/dbg/arch/arch.h src/dbg/arch/i386-bp.c src/dbg/arch/mips64-bp.c src/dbg/arch/powerpc-bp.c src/dbg/arch/x86_64-bp.c src/dbg/bp.c src/dbg/debug.c src/dbg/debug.h src/rabin/dietelf.c src/rabin/rabin.c src/radare.c src/search.c src/visual.c description: * Revert dietelf import to use objdump (imports fixed now) * Make af add xrefs for symbols and functions * Fix problems with @@ and recursivity for function analysis * Show flag name of the offsets with C* metadata * Lot of refactoring for debugging to use u64 * Add search.from and search.to * Make F10 (visual contu) work again changeset: 462:f0df5e7e4496 user: pancake date: Wed Sep 17 02:44:43 2008 +0200 files: TODO configure configure.acr doc/radare.but src/analyze.c src/cmds.c src/code.c src/code.h src/config.c src/dbg/arch/i386-bp.c src/dbg/arch/i386.c src/dbg/debug.c src/dbg/debug.h src/dbg/mem.c src/dbg/system.c src/dbg/unix/debug.c src/dbg/unix/procs.c src/javasm/Makefile src/plug/hack/Makefile src/plug/hack/ruby.c src/plug/hack/wscript_build src/print.c src/rdb.h src/search.c src/trace.c description: * Add dbg.focus to ignore events from non selected PIDs - Added !fork command to the debugger to for the process (needs some pulishment...) .. attachto child and restore code there - Remove some dead code * .!maps* is now setting up zoom.from and zoom.to - Useful for viewing debugging traces graphically * Zoom overview (pO) have str|code|traces * Doc for zoom.from and zoom.to * Also added new search.from and search.to vars * Make 'af' mark xrefs via AOP_TYPE_CALL - C* now lists Cx too * Add RUBY to acr - Compiles with ./configure && make changeset: 461:71774eb0d187 user: pancake date: Tue Sep 16 23:20:12 2008 +0200 files: doc/radare.but src/dbg/arch/arch.h src/dbg/arch/arm.c src/dbg/arch/i386.c src/dbg/arch/mips64.c src/dbg/arch/powerpc.c src/dbg/arch/x86_64.c src/dbg/bp.c src/dbg/bp.h src/dbg/debug.c src/dbg/debug.h src/dbg/parser.c src/dbg/parser.h src/dbg/unix/debug.c src/print.c src/radare.h src/trace.c src/utils.c src/utils.h src/visual.c description: * Add zoom.byte 'code' and 'traces' modes - zoom out with pO to get a full file overview - Added trace_get_between() - Fix some warnings * Fix some char * -> const char * * Implement arch_ret() for mips64 - Also implement arch_is_stepoverable for mips * Add get_offset32() to be global instead of per-cpu changeset: 460:a6ae34f79305 user: pancake <@youterm.com> date: Tue Sep 16 20:31:30 2008 +0200 files: TODO doc/radare.but src/dbg/bp.c src/dbg/bp.h src/dbg/debug.c src/dbg/debug.h src/radare.c description: * Add a per-breakpoint hit counter - Needs some love with conditional expressions * Add some minor doc for rasm * Handle ^C in repeat commands (234890234x can be stopped now) - Null commands are not executed changeset: 459:297e12f79a2d user: pancake <@youterm.com> date: Tue Sep 16 14:21:28 2008 +0200 files: TODO doc/fortunes doc/radare.but src/cmds.c src/utils.c description: * Add documentation for expressions - Also for comparisions and XC - with some nice examples * Add negated equality comparision (!=) - Fix a bug in equality. now seems everything ok changeset: 458:fbb08649b68e user: pancake <@youterm.com> date: Tue Sep 16 12:36:41 2008 +0200 files: TODO src/cmds.c src/dbg/open.c src/dbg/parser.c src/radare.c src/utils.c src/utils.h description: * Fix cmd parsing - '@' and '>' can now be used 'pr 20K @ esp > file' - '?' now supports conditional expressions > ? eip == 0x8048050 > ?? !step ; run step if condition matches > ??? ; show result of last conditional - !wp must use this (reduce code!) * Fixes a heap bug in dbg/open when resolving file path changeset: 457:f5ffc9602cbe parent: 454:a1d52653d259 parent: 456:446ddb3c4634 user: pancake date: Tue Sep 16 01:26:13 2008 +0200 files: TODO src/dbg/debug.c src/dbg/debug.h src/dbg/watchpoint.c src/dbg/watchpoint.h description: * Merge local and remote branches changeset: 456:446ddb3c4634 user: pancake <@youterm.com> date: Fri Sep 12 21:14:31 2008 +0200 files: TODO doc/radare.but description: * Documentation for 'rsc spcc', gradare and fpregs in the book - Some minor tips in TODO changeset: 455:094b21456655 parent: 453:67da729f281c user: pancake <@youterm.com> date: Fri Sep 12 19:17:21 2008 +0200 files: Makefile.acr TODO doc/radare.but src/Makefile.acr src/arch/x86/code.c src/config.c src/dbg/debug.c src/dbg/debug.h src/dbg/objects.mk src/dbg/open.c src/dbg/parser.c src/dbg/system.c src/dbg/watchpoint.c src/dbg/watchpoint.h src/dbg/wp.c src/dbg/wp.h src/main.c src/objects.mk src/plug/hack/radare.lua src/plug/hack/radare.rb src/plug/hack/ruby.c src/rabin/Makefile src/radare.c src/rahash/Makefile description: * Initial import of the Ruby plugin - Minor fix of the lua api for breakpoints * Documentation and fixups for !wp and !contwp - Added cmd.wp and dbg.wptrace - Needs breakpoint detection * Fix config.file path after resolving it for the debugger - radare -d ls (no need to specify full path to 'ls') * Remove dbg/watchpoint.* (deprecated) * Fix build issues of acr/gmake changeset: 454:a1d52653d259 user: pancake date: Tue Sep 16 01:20:48 2008 +0200 files: TODO src/cmds.c src/dbg/debug.c src/dbg/debug.h src/dbg/parser.h src/utils.c src/utils.h description: * Initial implementation of the comparable math expressions - Added support for conditional execution - Help in '??' command. Example session: > ? 0x4A13C005 = eip > ?? !jmp eip+2 ; skip conditional if eip = 0x4A13C005 * Needs some pulishment. changeset: 453:67da729f281c user: pancake@bare date: Thu Sep 11 02:28:57 2008 +0200 files: doc/radare.but src/radare.c description: * Major reorganization of the book - Added documentation for waf - block size, hw regs, breakpoints * Fixups for radare load with -i and so changeset: 452:5a29780dbabf user: pancake <@youterm.com> date: Wed Sep 10 13:57:45 2008 +0200 files: doc/radare.but src/analyze.c src/code.c src/rsc/pool/spcc description: * Documenation for the code and data analysis commands in The Book * Fixups in the core for the code_line_init (no analysis inside DATA_FUN) - Pretty printer for functions and flags changeset: 451:d80a454489bc user: pancake date: Wed Sep 10 10:26:18 2008 +0200 files: src/analyze.c src/code.c description: * Fix function clousures by substracting last opcode size * Add asm.syntax=olly for arch-x86 (RET=invalid instruction?) changeset: 450:d97f32069dfa user: pancake date: Wed Sep 10 05:54:12 2008 +0200 files: src/code.c description: * Fix some bugs in udis() for reladdr+size+traces fit with functions - Some code cleanup done changeset: 449:1fcd6dd9d89d parent: 448:b3941e49770c parent: 447:f6f6202b22f9 user: pancake date: Wed Sep 10 05:39:01 2008 +0200 files: src/cmds.c description: * Re-Merge of python2.5 null string fix commit changeset: 448:b3941e49770c parent: 444:b0feecfdcb49 user: pancake date: Wed Sep 10 05:36:03 2008 +0200 files: TODO src/analyze.c src/cmds.c src/code.h src/dbg/debug.c src/dbg/unix/debug.c src/radare.c src/visual.c description: * Implement b+ and b- commands to use a relative new size * Split analyze_function into a separate function - new 'aF' command acts as a recursive 'af' (analyze function) - Supports recursivity - Do not analyze already analyzed code - No need to dup .af in visual 'df' * Disable debug-read ops with negative sizes (huge) changeset: 447:f6f6202b22f9 user: pancake <@youterm.com> date: Tue Sep 09 19:56:35 2008 +0200 files: src/cmds.c src/plug/hack/python.c src/plug/hack/radare.py description: * Fix segfault with null strings for python 2.5 - add radare.cmd() in python api changeset: 446:769973a5fdde parent: 445:1521497b9d37 parent: 443:276491042712 user: pancake <@youterm.com> date: Tue Sep 09 16:33:05 2008 +0200 files: src/cmds.c src/utils.c description: * Stupid merge changeset: 445:1521497b9d37 parent: 441:c23cb58abd26 user: pancake <@youterm.com> date: Tue Sep 09 16:32:44 2008 +0200 files: src/cmds.c src/io.c src/utils.c src/utils.h description: * Fix 'wv' command using the drop-endian command - new 'drop_endian' for 32 and 64 bit values in utils.c - register more undo_write change events changeset: 444:b0feecfdcb49 user: pancake date: Wed Sep 10 04:39:55 2008 +0200 files: TODO src/analyze.c src/arch/arm/code.c src/arch/arm/gnudisarm.c src/arch/x86/code.c src/cmds.c src/code.c src/code.h src/config.c src/print.c src/rabin/dietelf.c src/rabin/rabin.c src/rabin/rabin.h src/visual.c description: * Make 'df' in visual and '.af' work happily - analyze function code using arch_aop and sets comments for opcodes accessing local vars, gets the stack increments and identify the size of the function. - Rabin shows function sizes correctly now :D - Disassembly functions are pretty-printed in asciiart \|/ - Colorize functions in p% bar in magenta * Some fixups in the ARM side - Fix endian bug (needs more test) and lot of cleanup - Fix some branch analysis - Make rabin identify raw ARM firmwares (heading branch) - Identify 'bx lr' as AOP_RET changeset: 443:276491042712 user: pancake date: Tue Sep 09 10:45:44 2008 +0200 files: TODO src/analyze.c src/arch/x86/code.c src/cmds.c src/code.c src/code.h src/print.c src/visual.c wscript description: * Make stack analysis be done by 'af' - not in realtime...yet * Fix bgcolor in p% - fix range (1 byte bug) * Add CF as DATA_FUN changeset: 442:d671bf2a367a user: pancake date: Tue Sep 09 00:53:01 2008 +0200 files: src/code.c src/code.h src/print.c src/utils.c description: * Fix issues with lines and disassembly base when using file.baddr * Fix mod by 0 * Add data_get_between - Initial work on colorized progressbar changeset: 441:c23cb58abd26 user: pancake <@youterm.com> date: Mon Sep 08 19:55:28 2008 +0200 files: src/dbg/arch/arm.h src/dbg/arch/i386.h src/dbg/arch/mips.h src/dbg/arch/powerpc.h src/dbg/arch/x86_64.h src/dbg/lib.c description: * Initial pseudo-register defines changeset: 440:f988f9cea700 user: pancake <@youterm.com> date: Mon Sep 08 19:08:01 2008 +0200 files: TODO doc/radare.but src/analyze.c src/cmds.c src/code.c src/dbg/debug.c src/dbg/open.c src/dbg/unix/syscall.c src/print.c description: * !contsc now accepts syscall name as argument - !contsc? lists all available syscalls - Split the code in some helper functions to manage syscalls - Needs some more work to make it fully portable as standard debug.os api * Fix file.baddr problems in code_lines_init() - Makes on-disk binary load happier * Make debug_open be happy with program name as file name - Walks around $PATH to find the proper path * Documentation for 'pm' and !regs save/restore @ TheBook changeset: 439:8f91b64375bf user: pancake <@youterm.com> date: Mon Sep 08 17:49:44 2008 +0200 files: TODO doc/radare.but src/cmds.c src/config.c src/cons.c src/flags.c src/plug/hack/python.c src/plug/hack/radare.py src/plug/hack/wscript_build src/plugin.c src/search.c src/visual.c wscript description: * Some documentation about code analysis * Fix python plugin to work with python 2.5 - Build with waf - Fix analyze_opcode() parse by __str_to_hash helper * Integrate radare_search_seek_hit with '/' cmd changeset: 438:ec2b61146268 user: pancake <@youterm.com> date: Mon Sep 08 14:43:01 2008 +0200 files: TODO doc/radare.but src/arch/arm/gnudisarm.c src/print.c src/rahash/rahash.c src/utils.h description: * Fixes in print format documentation * Make rahash happy with -L * Documentation for rahash * Minor fixup in arm disasm (needs love for file.baddr) changeset: 437:3373dea66b9f user: pancake date: Mon Sep 08 12:06:43 2008 +0200 files: doc/radare.but src/cmds.c src/rahash/rahash.c description: * # command accepts numeric length arguments (not yet working) * minor aesthetic changes changeset: 436:136b6591f29b user: pancake date: Sat Sep 06 05:25:57 2008 +0200 files: TODO doc/radare.but src/cmds.c src/dbg/arch/i386.c src/dbg/debug.h src/dbg/signal.c src/dbg/system.c src/print.c description: * pX renamed to p8, pw to p16, pW to p32, pq to p64 - a space is required to give the block size * Now the block size can temporally resize the current block * Add few initial doc about networking in radare * Fix 'wf' command (input+2) * Fix arch_set_sighandler for x86 - working again with !signal - !sig is an alias for !signal - signal name parsing is less strict now - ignore case and accepts substrings * Drop '!inject' debugger command (deprecated) changeset: 435:ff253b39fe39 user: pancake date: Sat Sep 06 02:49:29 2008 +0200 files: TODO doc/radare.but gui/prefs.c src/arch/arm/gnudisarm.c src/arch/mips/code.c src/arch/mips/gnudismips.c src/arch/sparc/gnudisparc.c src/cmds.c src/code.c src/config.c src/dbg/arch/arm-bp.c src/dbg/arch/mips64-bp.c src/dbg/arch/powerpc-bp.c src/plug/hack/radare.lua src/plug/hack/radare.py src/print.c src/project.c src/rabin/rabin.c src/utils.c description: * Rename cfg.endian to cfg.bigendian everywhere * Import the Gerardo changes in the book (Thanks :D) - More examples - Some explanations fixed - Document some print modes (hexa and zoom) - Better flag spaces doc and fixed resize - Fix minor typo in 'uw' command - Document 'c'ompare command - Some docu about event handling in debugger * Some oops for the debugger noted in TODO * acr+gmake should die changeset: 434:970c539e3299 user: pancake date: Sat Sep 06 01:49:56 2008 +0200 files: TODO doc/radare.but src/cmds.c src/hasher/Makefile src/hasher/crc16.c src/hasher/crc32.c src/hasher/crc32.h src/hasher/crca.c src/hasher/entropy.c src/hasher/hamdist.c src/hasher/hash.c src/hasher/hash.h src/hasher/hasher.c src/hasher/md4.c src/hasher/md5.h src/hasher/md5c.c src/hasher/sha1.c src/hasher/sha1.h src/hasher/sha2.c src/hasher/sha2.h src/hasher/wscript_build src/print.c src/radiff/wscript_build src/rahash/Makefile src/rahash/crc16.c src/rahash/crc32.c src/rahash/crc32.h src/rahash/crca.c src/rahash/entropy.c src/rahash/hamdist.c src/rahash/hash.c src/rahash/hash.h src/rahash/md4.c src/rahash/md5.h src/rahash/md5c.c src/rahash/rahash.c src/rahash/sha1.c src/rahash/sha1.h src/rahash/sha2.c src/rahash/sha2.h src/rahash/wscript_build src/rdb.c src/rsc/pool/bin2txt src/rsc/pool/bin2xml src/visual.c src/wscript_build description: * Add 'n' and 'N' keys in visual mode are now used to seek between the hit0_# flags * Add documentation for memory management in debugger - Also document the basic of thread and processes * Rename hasher to rahash changeset: 433:79da13b42f26 user: pedro@dhcp-206.fluendo.lan date: Thu Sep 04 19:50:24 2008 +0200 files: src/dbg/darwin/debug.c description: * Avoid getting locked when cannot step changeset: 432:56d70468f369 user: pancake <@youterm.com> date: Wed Sep 03 19:30:59 2008 +0200 files: src/dbg/mem.c description: * Fix !maps range with >= and <= changeset: 431:42cae4734f9a user: pedro@dhcp-206.fluendo.lan date: Wed Sep 03 12:49:17 2008 +0200 files: doc/radare.but src/arch/m68k/m68k_disasm.h src/dbg/arch/powerpc.c src/dbg/bp.c src/dbg/darwin/debug.c description: * Fix build of m68k_disasm (after fixing a small warning) - fix port to osx86 - fix issue about print_syscall * Add printing some more documentation - Fix undo/redo documentation changeset: 430:fbe1dbae05f2 user: pancake date: Wed Sep 03 05:12:41 2008 +0200 files: TODO src/arch/m68k/m68k_disasm.h src/cmds.c src/cmds.h src/rabin/rabin.c src/radare.h src/undo.c description: * Make 'u'ndo command act only on write history - The 's' command is now able to handle the seek history > s- : undo seek > s+ : redo seek > s* : list all seeks > s! : reset seek history - Add help for command 's' --> 's?' * undo_list now outputs radare commands - history list can be flagged * Fix entry vs entrypoint problems changeset: 429:5f217553b224 user: pancake date: Wed Sep 03 04:22:46 2008 +0200 files: TODO src/cmds.c src/dbg/arch/i386.c src/dbg/bp.c src/dbg/debug.h src/dbg/lib.c src/dbg/system.c src/dbg/wscript_build src/flags.c description: * New debugger command '!lib' to load libraries on target process - new file lib.c - uses uselib syscall on linux - should use dlopen on bsd from libc * Fix 'fs?' command (no need for space) * Remove breakpoint debugging printfs * Fix dbg.hwbp when using !bp and F2 from visual changeset: 428:f427ff79a8e0 user: asdfsafd@asdf-safds-imac.desnet.org date: Wed Sep 03 03:42:11 2008 +0200 files: TODO src/code.c src/config.c src/dbg/arch/mips64-bp.c src/dbg/arch/powerpc-bp.c src/dbg/arch/powerpc-darwin.h src/dbg/arch/powerpc.c src/dbg/arch/powerpc.h src/dbg/darwin/debug.c src/dbg/debug.c src/dbg/regs.h src/dbg/thread.c src/rabin/rabin.c wscript description: * Initial semi-working port of radare debugger to OSX-powerpc - Added CPU string 'Power Macintosh' - read+write memory is working - process control unusable - registers not fully implemented - fix osx getregs..on 10.5 does not checks this variable..curious * Fix debug_registers with rad output - Flag space "regs" is now stored and restored * Fixes on rabin for MACH-O using otool * Fix asm.arch=powerpc with cfg.endian changeset: 427:962444034d7e user: pancake <@youterm.com> date: Tue Sep 02 20:05:34 2008 +0200 files: doc/radare.but description: * Add documentation for touch trace in the book - Fix some minor indentation problems changeset: 426:799ec1ce419c user: pancake <@youterm.com> date: Tue Sep 02 19:39:33 2008 +0200 files: TODO doc/radare.but gui/main.c src/dbg/arch/arm.c src/dbg/arch/i386.c src/dbg/arch/mips64.c src/dbg/arch/powerpc.c src/dbg/darwin/debug.c description: * Fix Courier font size for the book - Add 'search' related documentation * gradare have scr.color=true * Implement vm_protect for OSX - Called from !mp - Required to write (not like ptrace) - Fixed the write command - plus soft breakpoints ;) - Added unix_prot_to_darwin helper changeset: 425:d2dde2e7a763 user: pancake date: Tue Sep 02 00:34:53 2008 +0200 files: gui/wscript_build src/dbg/arch/arm-bp.c description: * Fix MAEMO -> _MAEMO_ and minor arm build problem changeset: 424:6df8a61d0deb user: pancake date: Tue Sep 02 00:15:56 2008 +0200 files: gui/wscript_build src/dbg/arch/x86_64.h wscript description: * Drop inlines from x86-64.h * Add hildon-1 when --with-maemo in waf configure changeset: 423:4b9cf50a1477 user: pancake date: Tue Sep 02 00:13:07 2008 +0200 files: TODO doc/radare.but gui/grsc/Config/Configure gui/grsc/Config/ToggleColor gui/grsc/Debugger/AttachOrLoad gui/grsc/Debugger/Breakpoint gui/grsc/Debugger/Continue gui/grsc/Debugger/ContinueUserCode gui/grsc/Debugger/Detach gui/grsc/Debugger/Maps gui/grsc/Debugger/Registers gui/grsc/Debugger/SetRegister gui/grsc/Debugger/Status gui/grsc/Debugger/Step gui/grsc/Debugger/StepOver gui/grsc/Debugger/StepUserCode gui/grsc/Debugger/Stop gui/grsc/Disassembly/syntax-att gui/grsc/Disassembly/syntax-intel gui/grsc/Disassembly/syntax-pseudo gui/grsc/Flags/list gui/grsc/Flags/seek gui/grsc/Flags/set gui/grsc/Movement/SeekTo gui/grsc/Movement/down gui/grsc/Movement/next-byte gui/grsc/Movement/prev-byte gui/grsc/Movement/up gui/grsc/Search/hex-pairs gui/grsc/Search/string gui/grsc/Visual/height-grow gui/grsc/Visual/height-shrink gui/grsc/Visual/toggle-color gui/grsc/Visual/toggle-cursor gui/grsc/Visual/toggle-zoom gui/grsc/Visual/width-grow gui/grsc/Visual/width-shrink gui/main.c src/config.c src/dbg/arch/arm-bp.c src/dbg/arch/i386-bp.c src/dbg/arch/mips64-bp.c src/dbg/arch/x86_64-bp.c src/dbg/bp.c src/dbg/debug.c src/dbg/mem.c src/dbg/mem.h src/dbg/system.c src/dbg/unix/debug.c src/main.c src/plug/hack/radare.py src/rdb.c src/rsc/Makefile src/rsc/main.c src/rsc/miss.pl src/rsc/pool/CafeBabe.sh src/rsc/pool/Display src/rsc/pool/add src/rsc/pool/adict src/rsc/pool/asm src/rsc/pool/asmcolor src/rsc/pool/bdcolor src/rsc/pool/bin2tab src/rsc/pool/bin2txt src/rsc/pool/bin2xml src/rsc/pool/boomerang src/rsc/pool/bytediff src/rsc/pool/core src/rsc/pool/dasm src/rsc/pool/dbg-report src/rsc/pool/dwarf-addr src/rsc/pool/dwarf-lines src/rsc/pool/elf-base-addr src/rsc/pool/elf-dump-header src/rsc/pool/elf-entry-point src/rsc/pool/elf-flag-header src/rsc/pool/elf-prg-maps src/rsc/pool/elf-quad-word-shell src/rsc/pool/elf-trace src/rsc/pool/fds src/rsc/pool/ffftoneg src/rsc/pool/findrawsyms src/rsc/pool/flag src/rsc/pool/flag-kallsyms src/rsc/pool/flag-sections src/rsc/pool/gdl2gml src/rsc/pool/gokolu src/rsc/pool/gtkdialog src/rsc/pool/idc2rdb src/rsc/pool/list src/rsc/pool/make_symbolmap.sh src/rsc/pool/maps src/rsc/pool/monitor src/rsc/pool/move src/rsc/pool/net-icmp src/rsc/pool/net-tcp src/rsc/pool/net-udp src/rsc/pool/objdiff src/rsc/pool/objdump-output-beatifier.pl src/rsc/pool/path src/rsc/pool/read src/rsc/pool/rfile-foreach src/rsc/pool/search-asm src/rsc/pool/signsrch src/rsc/pool/spcc src/rsc/pool/spcc-fe src/rsc/pool/start2bin src/rsc/pool/strings-flag src/rsc/pool/strings-pe-flag src/rsc/pool/symbytediff src/rsc/pool/symcalls src/rsc/pool/symdiff src/rsc/pool/syms src/rsc/pool/syms-dbg-flag src/rsc/pool/syms-disk src/rsc/pool/syms-dump src/rsc/pool/syms-extract src/rsc/pool/syms-flag src/rsc/pool/syms-pe-flag src/rsc/pool/syms-xrefs src/rsc/pool/syscall-flag src/rsc/pool/tab2asm src/rsc/pool/tab2gml src/rsc/pool/waiter src/rsc/pool/write src/rsc/pool/xtrace src/rsc/rsc.acr src/rsc/wscript_build wscript description: * Notes in the book about ida2rdb.idc IDA script * Fix gradare build and install with waf - Drop -c when callig radare from the gui - Fix install of grsc scripts * Rename dbg.bptype to boolean dbg.hwbp * Add arch_bpsize() - Make soft breakpoints act as hardware ones - Added function to restore program counter after the trap * Drop inlines in x86-64 * '!maps?' only shows the current map at seek * Add trace_* API for python bindings changeset: 422:f8fdd8389260 user: pancake <@youterm.com> date: Mon Sep 01 19:57:20 2008 +0200 files: TODO doc/radare.but src/cmds.c src/rasm/examples/segment-perms.S src/rdb.c src/trace.c description: * More food for the book - Notes for code graph diffing * Add 'at-' command to reset the tracing info * Add intel page selector permission checker program in assembly - From OpenRCE forums (https://www.openrce.org/forums/posts/901) * Fix u64 bug in trace_range - Add trace_reset changeset: 421:b183467f0f15 user: pancake date: Mon Sep 01 01:21:52 2008 +0200 files: TODO doc/radare.but src/cmds.c src/trace.c description: * Add initial documentation of the debugger into the book * Add 'at*' and 'at?' and 'at ' * Show counter in address traces changeset: 420:447cf6febfaf user: pancake date: Sun Aug 31 16:11:40 2008 +0200 files: src/arch/arm/code.c src/arch/csr/code.c src/arch/java/code.c src/arch/m68k/code.c src/arch/mips/code.c src/arch/msil/code.c src/arch/sparc/code.c src/arch/x86/code.c src/cmds.c src/code.h src/radare.h src/trace.c description: * arch_aop returns opcode size if aop ptr is NULL - All arch/code.c sync'd * Make trace_show() show address-ranges - trace_add stores the opcode size now - Quite nicer viewer of the executed code changeset: 419:5450400a6470 user: pancake date: Sat Aug 30 21:53:40 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietpe.c src/rabin/dietpe.h src/rabin/pe.h src/rabin/rabin.c src/rabin/wscript_build description: * Import Nibble's patch for rabin - Adds initial diet-PE support changeset: 418:dd169a36d317 user: pancake date: Sat Aug 30 13:17:05 2008 +0200 files: dist/maemo/Makefile gui/wscript_build description: * Oops. missing wscript for gui/ - Fixups for the beta maemo-deb pkg changeset: 417:3666f9abef75 user: pancake date: Sat Aug 30 13:10:33 2008 +0200 files: dist/maemo/Makefile doc/radare.but gui/main.h src/wscript_build wscript description: * Fix build for GnuLinuxARM (scratchbox) - Fix maemo build with waf * Also build gradare changeset: 416:5c7bef1671a5 user: pancake <@youterm.com> date: Fri Aug 29 20:04:14 2008 +0200 files: TODO src/cmds.c src/config.c src/flags.c src/visual.c description: * New commands \o/ - 'at' - analyze opcode traces - 'fm' - move a flag to the current flagspace - 'wb' - circulary write the current block * Set dbg.bptype=soft for arm, mips and darwin * Some TODO reorganization changeset: 415:060400590550 user: pancake <@youterm.com> date: Fri Aug 29 17:01:04 2008 +0200 files: TODO doc/radare.but src/dbg/darwin/weasel.h description: * Fix the book (invalid tags used) * Remove noisy weasel.h changeset: 414:75f049aab3a5 user: pedro@dhcp-206.fluendo.lan date: Fri Aug 29 16:34:49 2008 +0200 files: TODO doc/radare.but src/arch/x86/udis86/syn-pseudo.c src/dbg/arch/i386-darwin.h src/dbg/darwin/debug.c description: * More stuff for the book * Enhacements on the OSX side - 1 step is possible now! (not more than one lul!) - continuation without events is also possible - setregs is now fixed ('!reg eax = 0x33' works) * Do not comment 1 byte ascii values when they are 0 (udis86) changeset: 413:e542b2447af0 user: pedro@dhcp-206.fluendo.lan date: Fri Aug 29 13:24:43 2008 +0200 files: TODO doc/radare.but src/dbg/darwin/debug.c src/dbg/debug.c src/dbg/signal.c src/dbg/thread.h src/rsc/pool/maps description: * Integrate darwin maps in debugger core - Fix MACH rwx to UNIX rwx (reverse order) - Fix darwin_setregs - Make !th work in darwin (fills the thread list) - gets 'eip' of each thread, but not yet the state - remove some debuggin' printfs - make the dispatch_wait on darwin be dummy (not yet working) * More food for the book (disassembly doc++) * Do not oops when no /proc in rsc maps changeset: 412:81d4417e8155 user: pancake date: Fri Aug 29 01:20:23 2008 +0200 files: doc/radare.but src/code.c src/flags.c src/rsc/Makefile src/rsc/main.c src/rsc/miss.pl src/rsc/pool/idc2rdb src/rsc/rsc.acr src/rsc/wscript_build src/utils.c src/utils.h wscript description: * Some more random words in the book * Fix 'fc' command - Only visible in disassebly - Documented in the book - exportize the 'nullstr' and 'nullstr_c' strings * Minor fix to idc2rdc + doc * Fix chmod +x of waf for rsc pool changeset: 411:f203969504db user: pedro@dhcp-206.fluendo.lan date: Thu Aug 28 17:15:52 2008 +0200 files: src/dbg/arch/i386-darwin.h src/dbg/arch/i386.c src/dbg/darwin/debug.c src/rabin/rabin.c description: * OSX Debugger enhacements - Yeah. now i can has read teh mem and regs - Also !maps are working but not integrated - a bit scratchy but mostly working - needs a code cleanup and process execution control (continue,step,..) * Make rabin -L work happy with 64 bits changeset: 410:13852081aa49 user: pancake <@youterm.com> date: Thu Aug 28 16:05:19 2008 +0200 files: src/rsc/pool/syscall-flag wscript description: * Fix PREFIX in waf for installation - Avoid --destdir problems..must use --prefix * Fix syscall-flag hashbang changeset: 409:a8f03609e3d5 user: pancake <@youterm.com> date: Thu Aug 28 14:23:57 2008 +0200 files: src/analyze.c wscript description: * Some cleanup in graph.split - stills buggy * chmod +x all rsc scripts changeset: 408:904251c82a12 user: pancake <@youterm.com> date: Thu Aug 28 13:28:02 2008 +0200 files: src/javasm/main.c src/rabin/README src/rabin/javasm.c src/rabin/rabin.c src/radare.c description: * Fix -r flag of javasm - Make .class works again in radare * Some advances for rabin - Get entrypoint for MACH-O files changeset: 407:6e6c1ea6d8f2 user: pancake <@youterm.com> date: Thu Aug 28 12:46:39 2008 +0200 files: Makefile.acr configure configure.acr doc/code-injection doc/elf-tutorial doc/java global.h.acr libexec/CafeBabe.sh libexec/Display libexec/Makefile libexec/add libexec/adict libexec/asm libexec/asmcolor libexec/bdcolor libexec/bin2tab libexec/bin2txt libexec/bin2xml libexec/boomerang libexec/bytediff libexec/core libexec/dasm libexec/dbg-report libexec/dwarf-addr libexec/dwarf-lines libexec/elf-base-addr libexec/elf-dump-header libexec/elf-entry-point libexec/elf-flag-header libexec/elf-prg-maps libexec/elf-quad-word-shell libexec/elf-trace libexec/fds libexec/ffftoneg libexec/findrawsyms libexec/flag libexec/flag-kallsyms libexec/flag-sections libexec/gdl2gml libexec/gokolu libexec/gtkdialog libexec/idc2rdb libexec/list libexec/make_symbolmap.sh libexec/maps libexec/miss.pl libexec/monitor libexec/move libexec/net-icmp libexec/net-tcp libexec/net-udp libexec/objdiff libexec/objdump-output-beatifier.pl libexec/path libexec/read libexec/rfile-foreach libexec/search-asm libexec/signsrch libexec/spcc libexec/spcc-fe libexec/start2bin libexec/strings-flag libexec/strings-pe-flag libexec/symbytediff libexec/symcalls libexec/symdiff libexec/syms libexec/syms-dbg-flag libexec/syms-disk libexec/syms-dump libexec/syms-extract libexec/syms-flag libexec/syms-pe-flag libexec/syms-xrefs libexec/syscall-flag libexec/tab2asm libexec/tab2gml libexec/waiter libexec/write libexec/xtrace src/Makefile.acr src/rasm/examples/README src/rsc.acr src/rsc/Makefile src/rsc/main.c src/rsc/miss.pl src/rsc/pool/CafeBabe.sh src/rsc/pool/Display src/rsc/pool/add src/rsc/pool/adict src/rsc/pool/asm src/rsc/pool/asmcolor src/rsc/pool/bdcolor src/rsc/pool/bin2tab src/rsc/pool/bin2txt src/rsc/pool/bin2xml src/rsc/pool/boomerang src/rsc/pool/bytediff src/rsc/pool/core src/rsc/pool/dasm src/rsc/pool/dbg-report src/rsc/pool/dwarf-addr src/rsc/pool/dwarf-lines src/rsc/pool/elf-base-addr src/rsc/pool/elf-dump-header src/rsc/pool/elf-entry-point src/rsc/pool/elf-flag-header src/rsc/pool/elf-prg-maps src/rsc/pool/elf-quad-word-shell src/rsc/pool/elf-trace src/rsc/pool/fds src/rsc/pool/ffftoneg src/rsc/pool/findrawsyms src/rsc/pool/flag src/rsc/pool/flag-kallsyms src/rsc/pool/flag-sections src/rsc/pool/gdl2gml src/rsc/pool/gokolu src/rsc/pool/gtkdialog src/rsc/pool/idc2rdb src/rsc/pool/list src/rsc/pool/make_symbolmap.sh src/rsc/pool/maps src/rsc/pool/monitor src/rsc/pool/move src/rsc/pool/net-icmp src/rsc/pool/net-tcp src/rsc/pool/net-udp src/rsc/pool/objdiff src/rsc/pool/objdump-output-beatifier.pl src/rsc/pool/path src/rsc/pool/read src/rsc/pool/rfile-foreach src/rsc/pool/search-asm src/rsc/pool/signsrch src/rsc/pool/spcc src/rsc/pool/spcc-fe src/rsc/pool/start2bin src/rsc/pool/strings-flag src/rsc/pool/strings-pe-flag src/rsc/pool/symbytediff src/rsc/pool/symcalls src/rsc/pool/symdiff src/rsc/pool/syms src/rsc/pool/syms-dbg-flag src/rsc/pool/syms-disk src/rsc/pool/syms-dump src/rsc/pool/syms-extract src/rsc/pool/syms-flag src/rsc/pool/syms-pe-flag src/rsc/pool/syms-xrefs src/rsc/pool/syscall-flag src/rsc/pool/tab2asm src/rsc/pool/tab2gml src/rsc/pool/waiter src/rsc/pool/write src/rsc/pool/xtrace src/rsc/rsc.acr src/rsc/wscript_build src/wscript_build wscript description: * Refactoring for RSC - Rewrite of rsc in C (drop perl dependency) - Move rsc into src/rsc - Move libexec into src/rsc - Sync waf and makefiles * Fix waf install - add documentation - some doc cleanup - add rsc scripts changeset: 406:b1bc11347256 user: pedro@dhcp-206.fluendo.lan date: Wed Aug 27 16:57:58 2008 +0200 files: doc/xtra/osx doc/xtra/osx-xnu-syscall.h src/dbg/darwin/debug.c src/dbg/darwin/signal.c src/dbg/darwin/weasel.c src/dbg/darwin/weasel.c.unused src/dbg/libps2fd.c src/dbg/open.c src/dbg/unix/debug.c src/dbg/wscript_build src/radare.c src/rasm/x86.c wscript description: * Initial commit from the OSX side - It is not yet working..well currently is making OSX crash if tried to debug radare with gdb. - Added some documentation from uninformed - Fix darwin build with waf changeset: 405:22e6035f14b8 user: pancake@unknown date: Mon Aug 25 20:08:56 2008 +0200 files: src/arch/csr/dis.h src/arch/x86/udis86/opcmap.c src/code.c src/hasher/wscript_build src/rasm/wscript_build wscript description: * Port to SunOS-sun4u (ultra-sparc) - No debugger support yet - Some SunStudio build fixups - Some symbol renaming... needs some static-izifying changeset: 404:46b6c6aeb73e user: pancake <@youterm.com> date: Mon Aug 25 18:30:43 2008 +0200 files: AUTHORS src/dbg/arch/i386-bsd.h src/dbg/arch/i386-bsd64.h src/dbg/arch/i386-darwin.h src/dbg/arch/i386-linux.h src/dbg/debug.c description: * Fix build on linux (oops from solaris) changeset: 403:63c3859a0fd2 user: pancake@localhost date: Mon Aug 25 18:09:54 2008 +0200 files: src/arch/arm/disarm.c src/arch/x86/udis86/syn-intel.c src/dbg/arch/i386-solaris.h src/dbg/debug.c src/dbg/debug.h src/dbg/unix/debug.c description: * More updates in the solaris-sunstudio front - convert missing scapped e's - getregs works..but fine? - read memory is working properly! - avoid some (null) string with sun's libc - use pmap in debug_maps() -- needs to be native changeset: 402:31294d89873f user: pancake@localhost date: Mon Aug 25 16:33:30 2008 +0200 files: src/arch/arm/disarm.c src/arch/arm/gnu/arm-dis.c src/code.c src/cons.c src/cons.h src/dbg/arch/arm.c src/dbg/arch/arm.h src/dbg/arch/i386-bp.c src/dbg/arch/i386.c src/dbg/arch/i386.h src/dbg/arch/mips64.c src/dbg/arch/powerpc.c src/dbg/arch/x86_64.c src/dbg/dosdebug.c src/dbg/mem.c src/dbg/parser.c src/dbg/regs.h src/dbg/system.c src/dbg/thread.c src/dbg/unix/debug.c src/dietline.c src/hasher/hasher.c src/plug/hack/hello.c src/plug/io/gdbx.c src/print.c src/print.h src/utils.c src/visual.c waf description: * Update WAF to svn (adds broken support for sunstudio) * Fix build of radare for OpenSolaris-SunStudio-x86 - \e -> \x1b everywhere! - fix some gcc-isms - using memcpy to avoid casting problems changeset: 401:7109930fce75 user: pancake@localhost date: Mon Aug 25 14:20:59 2008 +0200 files: doc/xtra/solaris-sys-syscall.h src/arch/x86/udis86/opcmap.c src/dbg/arch/i386-bsd.h src/dbg/arch/i386-bsd64.h src/dbg/arch/i386-darwin.h src/dbg/arch/i386-linux.h src/dbg/arch/i386-linux64.h src/dbg/arch/i386-solaris.h src/dbg/arch/i386-w32.h src/dbg/arch/i386.c src/dbg/arch/i386.h src/dbg/debug.c src/dbg/libps2fd.h src/dbg/os.h src/dbg/regs.h src/dbg/unix/fd.c wscript description: * Initial compilation of x86-opensolaris debugger - Split i386.h into multiple system-dependant ones - No dup2 on solaris - add solaris-syscall documentation - add snippy regs.h for solaris - some refactorized vars to avoid solaris colisions - handle i86pc as i386 by waf changeset: 400:628119572e92 user: pancake <@youterm.com> date: Mon Aug 25 12:37:36 2008 +0200 files: src/arch/x86/ollyasm/asmserv.c src/arch/x86/ollyasm/assembl.c src/dbg/signals.h src/rabin/wscript_build src/wscript_build description: * Fix build for olly asm/disasm (prev commit oops) * Fix build for NetBSD and maybe other BSDs using waf - Do not link against libdl on bsd changeset: 399:f438c74725e0 user: pancake <@youterm.com> date: Mon Aug 25 12:52:34 2008 +0200 files: INSTALL src/arch/x86/ollyasm/disasm.c src/arch/x86/ollyasm/disasm.h src/config.c src/dbg/arch/i386-bp.c src/dbg/bp.h src/dbg/libps2fd.h src/flags.c src/visual.c description: * Final notes on INSTALL using waf * Fix olly/disasm.h warnings * Initial work on multi-arch/multi-type breakpoints * Handle \r in Vt and Ve and include them in Vhelp changeset: 398:82c05557c79e user: pancake date: Mon Aug 25 10:05:26 2008 +0200 files: INSTALL README src/plug/io/wscript_build src/plugin.h src/wscript_build wscript description: * Split README into INSTALL * Fix ewf IO plugin waf build - Clean a lil warning :) changeset: 397:3e9e4cfb05ad user: pancake <@youterm.com> date: Fri Aug 22 19:30:45 2008 +0200 files: src/dbg/darwin/debug.c src/dbg/debug.c src/trace.c src/visual.c description: * Some offline fixups for the osx dbg port - not yet working, but just getting some doc.. * Integrate traces with TouchTrace changeset: 396:f90aaa55a419 user: pancake@localhost date: Fri Aug 22 19:14:40 2008 +0200 files: doc/xtra/opensolaris src/cmds.c src/utils.c src/utils.h description: * Fix segfault in (info) for solaris - Added strget to handle (null) strings * Added basic opensolaris debugging information - ptrace(4) and proc(4) changeset: 395:bbfbfaa610f8 user: pancake@localhost date: Fri Aug 22 18:38:13 2008 +0200 files: src/plug/io/wscript_build src/rasm/wscript_build src/wscript_build wscript description: * Fix build for OpenSolaris/GCC - Fix non-debugger build (-lsocket -lnsl - No debugger for solaris yet - Export 'OS' env changeset: 394:30f9bf1f4e18 user: pancake <@youterm.com> date: Fri Aug 22 17:37:04 2008 +0200 files: src/rasm/main.c src/rasm/wscript_build src/wscript_build wscript description: * Refixups for waf build - rasm is happy again - fixups for gui/nongui configuration changeset: 393:fd2bc72e72a5 user: pancake date: Fri Aug 22 17:57:07 2008 -0400 files: src/Makefile.acr src/arch/csr/dis.c src/dbg/arch/mips64.c src/dbg/debug.c src/hack.c src/plugin.c src/wscript_build description: * Fix build for non-GTK - Fix also the HAVE_READLINE problem * Fix warning in csr disassembler * Fix 'eip' alias for MIPS64 * Remove sleep(2) in stepbp (nicer mips experience) * #ifdef -> #if HAVE_VALAC changeset: 392:b62bdbc0eecc user: pancake <@youterm.com> date: Fri Aug 22 14:05:01 2008 +0200 files: src/Makefile.acr src/cmds.c src/grava.c src/hack.c src/plugin.c src/print.c src/wscript_build vala/wscript_build description: * Yeah. finally with gtk+vala+waf working together - Rename VALA into HAVE_VALAC - Needs to split better these checks to work without vte and so - Build grava as a statclib - Make radare look for includes in the vala build dir changeset: 391:60f777670767 user: pancake <@youterm.com> date: Fri Aug 22 12:51:55 2008 +0200 files: wscript description: * Re-add vala to waf ... lets work on.. changeset: 390:afb790407e43 user: pancake <@youterm.com> date: Thu Aug 21 18:03:42 2008 +0200 files: src/cmds.c src/search.c description: * /a renamed to /A - /a handled by radare_search_asm() - not yet implemented. just a stub changeset: 389:2dc84f1bca26 user: pancake@fluendo-build date: Thu Aug 21 17:04:16 2008 +0200 files: src/dbg/arch/x86_64-hack.c src/dbg/arch/x86_64.c src/dbg/wscript_build src/wscript_build wscript description: * WAF advances - Fix build for non-readline - Fix build on x86-64 with debugger - Properly copy the src/ut.c (tmp hack) changeset: 388:12057db6805b user: pancake <@youterm.com> date: Thu Aug 21 14:16:18 2008 +0200 files: TODO src/dbg/arch/i386.c src/dbg/arch/x86_64.c src/dbg/debug.c src/dbg/debug.h src/dbg/system.c src/dbg/unix/debug.c src/rasc/wscript_build src/rasm/wscript_build src/wscript_build vala/api/core.vala vala/grava/wscript_build vala/wscript_build wscript description: * Initial implementation of !tt dbg cmd - tt stands for TouchTrace - swap breakpoint area for fast tracing - Only x86 atm. Only tested in Linux - Needs integration with the optracer - Thanks Gadix for the idea! > !tt Usage: !tt [size] @ [base_address] Touch trace a section of N bytes starting at seek * Make waf-debugger support non-i386 - add rasc and rasm to the waf-build! - some advances in the vala-waf integration - add --prefix, not synced with --destdir for installation - make --without-gui work - check for libewf - show better report * Fix 'extern' stuff for vala core api * Use u64 in x86-64 instead of addr_t (grr) changeset: 387:8d84b804dc3b user: pancake date: Wed Aug 20 23:53:46 2008 +0200 files: vala/wscript_build wscript description: * Some advances in the waf-vala front changeset: 386:a3f018bcfa26 user: pancake <@youterm.com> date: Wed Aug 20 20:10:29 2008 +0200 files: gui/menubar.c src/rasc/rasc.c description: * Include global.h for the gui and rasc - They need VERSION! changeset: 385:0d859cae53a2 user: pancake <@youterm.com> date: Wed Aug 20 18:42:33 2008 +0200 files: TODO src/radare.c src/wscript_build wscript description: * Some fixups for -v for dietline - Needs more work (do not echo the user input!) - Some cfg.verbose weirdness fixed * Make waf handle libreadline properly - Fixed --without-readline - Show debugger+readline report at the end of waf conf changeset: 384:995e84e9bdc9 user: pancake <@youterm.com> date: Wed Aug 20 18:03:04 2008 +0200 files: config.mk.acr src/arch/x86/instcount.c src/arch/x86/instcount.c.to-be-removed src/dbg/arch/i386-bp.c src/dbg/arch/i386-hack.c src/dbg/arch/i386.c src/dbg/arch/i386.h src/dbg/debug.c src/dbg/libps2fd.h src/dbg/lseek.c src/dbg/regs.h src/dbg/signal.h src/dbg/signals.h src/dbg/unix/debug.c src/dbg/unix/signal.c src/dbg/wscript_build src/hasher/wscript_build src/plug/io/debug.c src/plug/io/wscript_build src/wscript_build description: * More build fixups for waf - Now the build is possible on GNU/Linux/x86-32bits - Detect unused sources and build libdebugger instead of linking all together - Comment -out some unused code - Fix signal.h weirdness -> signals.h changeset: 383:8b54308b341a user: pancake <@youterm.com> date: Wed Aug 20 15:12:19 2008 +0200 files: global.h.acr libexec/asm src/Makefile.acr src/javasm/main.c src/javasm/wscript_build src/plug/hack/Makefile src/plug/hack/python.c src/plug/io/malloc.c src/plug/io/shm.c src/plug/io/wscript_build src/rabin/Makefile src/rabin/wscript_build src/rasm/main.c src/rasm/rasm.c src/wscript_build waf wscript description: * Make 'rasm' happy with -a rsc - Make 'rsc asm' use SYNTAX=intel by default - add 'olly' as available arch in help - fix performance bug parsing arches * Import waf-svn script at root - Fix some structural build problems - Make it use global.h - Fix python plugin build on ubuntu - Fix some warnings - add --with-maemo and --with-sysproxy $ ./waf configure --without-debugger $ ./waf changeset: 382:a9e4b161a22d user: pancake@fluendo-build date: Wed Aug 20 13:25:43 2008 +0200 files: TODO src/cmds.c src/code.c src/code.h src/dbg/open.c src/radare.c description: * Fix 64 bit problems with data_t list head - Thanks elektranox and valgrind! * Fix ps.pid == 0 fuzzy problem (thanks sha0) * Avoid showing debug interface when read errors changeset: 381:2412d1722daf user: pancake <@youterm.com> date: Mon Aug 18 19:26:48 2008 +0200 files: configure configure.acr doc/Makefile doc/radare.but global.h.acr src/Makefile.acr src/main.h src/radare.h description: * Make ACR check for python - Create global.h from .acr (less cflags) - This will ease the waf port * More food for the book changeset: 380:71cb3e025f8e user: pancake date: Mon Aug 18 01:01:22 2008 +0200 files: TODO doc/radare.but description: * More food for the book changeset: 379:160e0f5e4cbe user: pancake date: Sat Aug 16 13:33:23 2008 +0200 files: TODO doc/radare.but src/main.c description: * Initial import of *the book* in halibut format * Fix core long help message -d depends on debugger -i support python and perl (not only lua) changeset: 378:06697833761b user: pancake date: Tue Aug 12 15:34:44 2008 +0200 files: TODO libexec/idc2rdb src/config.c src/dbg/unix/syscall.c src/io.c src/plugin.c src/rabin/dietelf.c src/rabin/rabin.c description: * Initial import of 'asm.os' eval var - Used to specify the syscall table used by !contsc - Handled by rabin -rI or file.id if enabled from the core - OS indendent (analyze netbsd bins from linux or so) * Fix stupid memaligned bug while seeking near the eof * Rabin integration more clean - Do not use objdump anymore changeset: 377:198c5b300fac user: pancake date: Mon Aug 11 19:10:42 2008 +0200 files: libexec/Makefile src/dbg/unix/syscall.c src/hasher/wscript_build src/plug/hack/wscript_build src/plug/io/wscript_build src/rabin/wscript_build src/radiff/wscript_build src/utils.c src/wscript_build wscript description: * Update some wscript...needs to be rewriten i think.. * Implement syscalls_freebsd_x86 for !contsc - Must be used for code analysis * Ugly hack to fix the problem with utils.c/strsub changeset: 376:45fa6bb0f961 user: pancake date: Sun Aug 10 20:36:57 2008 +0200 files: TODO configure configure.acr src/cmds.c src/io.c src/main.c description: * Update acr version * Support cursor mode for :wa (inline assembly in visual mode) changeset: 375:5373007ae164 user: pancake date: Sun Aug 10 17:02:40 2008 +0200 files: src/cmds.c src/dietline.c src/flags.c src/print.c src/radare.c description: * Some indentation fixups * Oops with px outside visual mode * Make rad_readline work inside dietline changeset: 374:a3d0f56590f1 user: pancake date: Sun Aug 10 16:53:53 2008 +0200 files: TODO description: * Oops.. continuation of the old commit * Enhacements in the python api - Remove all _at commands (replaced by an optional 'addr' arg) * Fix '&&' when using !! -> history storage is b0rken * Split radare_nullcmd() for null commands changeset: 373:0f4021084262 user: pancake date: Sun Aug 10 16:48:51 2008 +0200 files: TODO src/config.c src/dbg/debug.c src/dbg/system.c src/flags.c src/plug/hack/radare.py src/rabin/rabin.c src/radare.c src/visual.c description: * Use dbg.dwarf only when necessary - Fix a segfault in rabin (big oops O:) - rabin -rI sets dbg.dwarf depending on stripped ELF * Make !dall handle ^C and properly finish at 0xffffffff - Must be used to get mapped regions when no !maps working * Add flag_show function and make flag_grep work with '*' and changeset: 372:2ca2c4859669 user: pancake date: Sat Aug 09 21:50:55 2008 +0200 files: TODO libexec/Makefile libexec/list src/dbg/debug.c src/dbg/debug.h src/dbg/system.c description: * Initial implementation of the !dall command that dumps all readable pages from memory of the current process to disk. Useful when no !maps :) * Properly install rsc files in libexec using DESTDIR - Do not try to install radaredbg * Cleaner rsc list (no output when no symbols found or error encountered) * Add some ideas and notify some bugs in TODO file changeset: 371:25a5a23d02cc user: pancake date: Sat Aug 09 03:16:43 2008 +0200 files: TODO src/config.c src/dbg/unix/debug.c src/main.c src/rasm/olly.c src/rasm/rasm.c description: * Use hardware breakpoints on *bsd by default * Fix build for freebsd (no fktrace huh!) * Remove -c flag from the core (use -e scr.color=1!!) * Make rasm -d work happy with asm.arch changeset: 370:193acce36bfa user: pancake date: Thu Aug 07 19:44:59 2008 +0200 files: TODO src/cmds.c src/plug/hack/radare.py src/radare.c description: * Refactoring of the TODO * Move filetype check for scriptin to radare_interpret - Calls .py, .pl or .lua if available changeset: 369:66e71374da15 user: pancake date: Thu Aug 07 19:18:42 2008 +0200 files: TODO src/dbg/arch/i386.h src/plug/hack/Makefile src/plug/hack/lua.c src/plug/hack/perl.c src/visual.c description: * Avoid redupped offsetof (fixes stupid cygwin bug?) * Note that perl hack plugin is broken * Some code cleanup in the lua plugin * Reduce code in visual (data type conversion more handful) - Avoids dupped code in 'V<' changeset: 368:b5cef903ffa4 user: pancake date: Thu Aug 07 18:51:04 2008 +0200 files: doc/xtra/asm-unistd.h doc/xtra/linux-sys-syscall.h libexec/radaredbg libexec/symbytediff libexec/syms-dump scripts/inject/inj.py scripts/inject/mprotect.S src/plug/hack/radare.py src/radiff/Makefile src/radiff/main.c src/radiff/radiff.c description: * Add rsc symbytediff - Fix syms-dump rsc script - Removed rsc radaredbg * Initial work on the python-based code injector * Enhacements on the python API - Variable argument for address - Some auto documentation in progress (pydoc radare) - Added some 'slurp' helpers * Added -s and -S in radiff to call symdiff and symbytediff - Rename radiff.c to main.c - Renamed asm-unistd.h to linux-sys-syscall.h * Added snippet shellcode to change the stack perms changeset: 367:43c3627f778b parent: 365:7244558534db parent: 366:56dc2975a54a user: pancake date: Tue Aug 05 11:56:09 2008 +0200 files: src/code.c src/plug/hack/radare.py src/radare.c description: * Merge head and local branch * Some minor data type fixups in the python api changeset: 366:56dc2975a54a parent: 364:16ea54942096 user: pancake <@youterm.com> date: Thu Jul 31 17:21:58 2008 +0200 files: Makefile.acr src/code.c src/main.c src/radare.c description: * Oops. no sudo in makefile * Workaround for file.baddr + strings * Add 'help_message_short' and handle it with -d with no args == 0.9.9 == changeset: 365:7244558534db user: pancake date: Tue Aug 05 11:51:34 2008 +0200 files: scripts/example.py src/code.c src/flags.c src/plug/hack/radare.py src/rabin/rabin.c src/radare.c src/visual.c description: * Enhacements in the Python API - add hex2bin and bin2hex helpers - str2hash autodetects integers, hex and strings - simplify python example code (thx sha0) * Cleaner flag grep output * Properly setup asm.arch=intel64 with dietelf * Use python and perl hacks when calling radare -i {.py|.pl} * Data type range fixup for non-folders changeset: 364:16ea54942096 user: pancake date: Thu Jul 31 05:06:04 2008 +0200 files: scripts/example.py description: * Initial import of the radare/python Hello World changeset: 363:f17c5d8fec5e user: pancake date: Thu Jul 31 05:02:05 2008 +0200 files: Makefile.acr libexec/Makefile libexec/symdiff src/environ.c src/plug/hack/python.c src/plug/hack/radare.lua src/plug/hack/radare.py description: * Initial import of the python API for radare - import 'radare' and 'r' - from radare import * * properly setup EDITOR with cfg.editor * Initial import of Nibble's symdiff - Accessible with rsc - Uses rabin and perl to disassemble the different symbols between two binaries changeset: 362:ba75c80daabb user: pancake date: Thu Jul 31 01:39:32 2008 +0200 files: src/environ.c src/rabin.c src/rabin/dietelf.c src/rabin/rabin.c src/rabin/rabin.h description: * Do not set file.baddr in debugger (uses $DEBUG in rabin) * SHow verbose sections in rabin/dietelf changeset: 361:d45cbdda5a90 user: pancake <@youterm.com> date: Wed Jul 30 18:14:59 2008 +0200 files: libexec/strings-pe-flag src/arch/msil/code.c src/arch/msil/demsil.c src/arch/msil/demsil.h src/arch/sparc/code.c src/code.c src/code.h src/objects.mk description: * Initial import of the MSIL disassembler - Accessible with asm.arch = msil - Code from: http://ntcore.com/Files/disasmsil.htm - Highly unixified and some refactorization (MS STYLE SUCKS) - TODO: No assembler, code analysis, debugger or rabin integration yet changeset: 360:3cdfba093017 parent: 359:376a388fce53 parent: 358:a442a47e6a5c user: pancake <@youterm.com> date: Wed Jul 30 17:04:47 2008 +0200 description: * Stupid branch merge changeset: 359:376a388fce53 parent: 357:91c49f305004 user: pancake <@youterm.com> date: Wed Jul 30 17:04:19 2008 +0200 files: libexec/strings-pe-flag libexec/syms-pe-flag libexec/syscall-flag src/rabin.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/javasm.c src/rabin/rabin.c src/radare.c description: * Reduce rabin code on the core (externalized) - Use .!!rabin instead (Thanks nibble!) - identify ELF asm.arch from the core - also for file.type - Fixups for the rsc -rabin related scripts * Better javasm -r support changeset: 358:a442a47e6a5c user: pancake@flutes.fluendo.lan date: Wed Jul 30 12:49:36 2008 +0200 files: src/dbg/arch/x86_64.c description: * Fix register colorization on 64 bits * Show rN regs in x86-64 for color output changeset: 357:91c49f305004 user: pancake date: Wed Jul 30 05:22:36 2008 +0200 files: Makefile.acr TODO src/Makefile.acr src/arch/java/javasm.c src/objects.mk src/rabin.c src/rabin/Makefile src/rabin/javasm.c src/rabin/rabin.c src/wscript_build description: * Move javasm from arch/java to rabin/ * Fix disassembly and constant pool access - Nicer string and method resolution - Fix javasm -r * Call javasm -rc from rabin when class is identified - Imports constant pool and symbols disk offsets - Add some work with -rI and -rt (-rt must be removed for -rvI ?) changeset: 356:a5ecb987262c user: pancake date: Wed Jul 30 04:15:19 2008 +0200 files: TODO src/code.c src/config.c src/main.c src/project.c src/rabin.c src/rabin/dietelf.c src/radare.c description: * Proper manager of project files - radare -P renamed to -p - sets file.project - uses dir.project (defaults to ~/.radare/rdb/) - handle 'close' event for project - register 'entrypoint' in symbol flag space changeset: 355:cde783c12660 user: pancake date: Wed Jul 30 03:42:09 2008 +0200 files: libexec/maps src/dbg/mem.c src/dietline.c description: * Fix rsc maps * Removed noisy debug in dietline * Make .!maps* handle map_%s_end - useful for iterating on maps on scripting changeset: 354:e03a0ac7b85c user: pancake date: Wed Jul 30 03:32:43 2008 +0200 files: TODO doc/fortunes libexec/flag-sections libexec/strings-flag libexec/syms libexec/syms-dbg-flag src/dbg/debug.c src/dbg/debug.h src/dbg/system.c src/dietline.c src/rabin/dietelf.c description: * Fix bug in history with readline * Update rsc scripts to match current rabin - Fix -rios to -ris in src/dbg - flag entrypoint as symbol with rabin * !regs !set and !get commands merged into !reg - Supports !regs and !regs like before - !reg eax -> shows value of register - !reg eax=33 -> set value for register changeset: 353:632c35cac6e3 user: pancake date: Wed Jul 30 02:58:58 2008 +0200 files: TODO src/cmds.c src/io.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c src/rabin/rabin.h src/rdb.c src/undo.c src/undo.h description: * Implement undo_write capabilities - Supports set/unset all changes done on the binary by the user - Accessible with 'uw' command - Does not yet supports deltifying * Add native support for library listing in rabin (ldd like) - Better output for dietelf's rabin - Remove -o flag in rabin (no more 'other' symbols) changeset: 352:3c257a198797 user: pancake <@youterm.com> date: Tue Jul 29 20:14:20 2008 +0200 files: src/config.c description: * oops in config var type changeset: 351:9573cab0974b user: pancake <@youterm.com> date: Tue Jul 29 20:13:27 2008 +0200 files: TODO doc/fortunes src/analyze.c src/binparse.c src/cmds.c src/code.h src/config.c src/cons.c src/dbg/debug.c src/dbg/debug.h src/dbg/mem.c src/dbg/parser.c src/dbg/parser.h src/dbg/unix/fd.c src/dbg/unix/procs.c src/main.h src/plugin.c src/print.c src/rabin/dietelf.c src/radare.c src/stripstr.c src/visual.c description: * Some more fixups for TCC compilation - Fixes some stupid errors * Fix endianness in dietelf * Some new deltified fortune messages changeset: 350:80ff41f49cbf user: pancake <@youterm.com> date: Tue Jul 29 18:27:43 2008 +0200 files: TODO src/rabin/Makefile src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/dietelf64.c src/rabin/dietelf64.h src/rabin/rabin.c src/rasc/rasc.c description: * Add super-magic patch from Nibble adding elf64 bit support to rabin - Yay! (needs some deltifying of the 'other' symbols) * Make rasc not print \x00 values in enums (-E) changeset: 349:eff2f428a61c user: pancake <@youterm.com> date: Mon Jul 28 14:04:07 2008 +0200 files: TODO src/dbg/debug.c src/rabin/dietelf.c src/rabin/rabin.c src/radare.c description: * radare calls rabin -rios directly without syms-dbg-flag * Import MACH-O rsc into rabin using system() * Refixups for exports in dietelf for BSD * Do not rad_readlinit_init unnecesarily changeset: 348:51244d17cfd3 user: pancake <@youterm.com> date: Mon Jul 28 12:09:05 2008 +0200 files: src/dietline.c src/print.c src/radare.c description: * Fix stupid readline bug * Fix background color when no color is used * Fix endianness for pW (thanks sha0) changeset: 347:cd4dbec7e6a4 user: pancake date: Sun Jul 27 17:03:28 2008 +0200 files: libexec/bdcolor src/rabin/dietelf.h src/rabin/elf.h src/radare.c description: * Import Nibble patch - Fixups for bdcolor output filtering - Import own elf.h into rabin for portable dietelf * Fix compilation build for TinyCC (not linking yet) changeset: 346:5eb93e66f13a user: pancake date: Sat Jul 26 21:28:04 2008 +0200 files: src/visual.c description: * Fix gradare problem with graphs (ag) changeset: 345:260f192c6f32 user: pancake date: Sat Jul 26 21:20:57 2008 +0200 files: TODO src/code.c src/dietline.c src/flags.c src/hist.c src/radare.c description: * Move some readline stuff into dietline - Everything should be wrapped there * Some code cleanup * Another fixup for file.baddr changeset: 344:173dcfbf0ade user: pancake date: Sat Jul 26 21:08:36 2008 +0200 files: TODO doc/fortunes src/code.c src/print.c src/rabin/dietelf.c description: * Fix most of the problems with file.baddr * Make dietelf work with no-bss ELFs * Fix screen height in visual mode (again) changeset: 343:fa7059690930 user: pancake@bare date: Fri Jul 25 21:40:11 2008 +0200 files: src/code.c src/grava.c src/rasm/main.c src/rasm/rasm.c description: * Refix pD * SUpport rasm -d - * Refix count hexpair length changeset: 342:39c9000cbda6 user: pancake@bare date: Fri Jul 25 21:30:08 2008 +0200 files: TODO src/code.c src/rasm/main.c src/rasm/rasm.c description: * Make 'rasm' a bit more smarter - Calculate the correct number of bytes - If opcode is '-' act as a shell (read from stdin) - Dont always show the helpline * Fix 'pD ' calculating the correct length of bytes - Should fix problems with graph nodes - Fixes 'rasm -d' out of bytes problem changeset: 341:cdd86fad9e00 user: pancake <@youterm.com> date: Fri Jul 25 18:14:48 2008 +0200 files: src/rasc/shellcodes.c description: * Added sparc/ia64/linux/solaris shellcodes into 'rasc' changeset: 340:0ca0ead4b8e4 user: pancake <@youterm.com> date: Fri Jul 25 17:18:19 2008 +0200 files: src/dbg/arch/i386.h description: * Fix build for BSD/32bits changeset: 339:3a428ebc0d87 parent: 338:bae3eb28b52c parent: 337:6f8181f1118e user: pancake <@youterm.com> date: Fri Jul 25 17:22:41 2008 +0200 description: * Merge OpenBSD/x86-64/amd64 branch changeset: 338:bae3eb28b52c parent: 335:50ccd40148f8 user: pancake <@youterm.com> date: Fri Jul 25 17:22:01 2008 +0200 files: doc/xtra/sparc-hello.S libexec/bdcolor src/dbg/Makefile src/dbg/arch/i386.h src/dbg/arch/x86_64.c src/dbg/arch/x86_64.h src/dbg/objects.mk src/dbg/unix/debug.c src/radiff/bdiff/bdiff.cpp description: * Add sparc-linux hello world in doc/xtra/*.S * Fix rsc bdcolor script (Thanks Nibble!) - Avoid dupped offsets. * Fix build of C++ bdiff on BSD (need sys/param.h) * Initial port to OpenBSD/x86-64 (aka amd64) - Adds support for the new r8-r15 registers - Show these registers - There is no LWPINFO for OpenBSD (only Net + Free) - Fix !set for rax, rbx,... instead of eax, ... - Restricted ktrace on openbsd (no fktrace..needs reimplement) - contfork can be done in openbsd with PT_SET_EVENT_MASK changeset: 337:6f8181f1118e user: pancake date: Fri Jul 25 03:12:03 2008 +0200 files: src/cmds.c src/code.c src/hack.c src/print.c description: * Fix some config.baddr related problems * minor cleanup changeset: 336:941b54c94047 user: pancake date: Fri Jul 25 02:20:20 2008 +0200 files: TODO configure configure.acr src/cons.c src/print.c src/visual.c description: * Initial support for background color in console - colorize in blue the flagged bytes - Added cons_w32 and cons_html outputs for it * Up to 0.9.9 :) changeset: 335:50ccd40148f8 user: pancake <@youterm.com> date: Thu Jul 24 20:27:14 2008 +0200 files: src/grava.c description: * Set scr.seek for graphs changeset: 334:b1c9e1e6c83e user: pancake <@youterm.com> date: Thu Jul 24 17:45:08 2008 +0200 files: TODO src/config.c src/visual.c description: * Add cfg.editor to 'vi' by default - Used by the new '#' edit_screen_filter Visual command - Allows to easily edit the visual filter changeset: 333:e3cbda5655bb user: pancake <@youterm.com> date: Thu Jul 24 17:14:39 2008 +0200 files: TODO src/analyze.c src/arch/x86/code.c src/code.h src/rabin/dietelf.c src/rabin/dietelf.h description: * Import Nibble's patch for rabin to support sparc/mips and big endian - Properly resolves the imports (not like objdump) on !x86 arches - fixes the endianness problems (needs to be checked in big endian host but should work) - ATM only for x86, mips and sparc * Move stack operations to AOP_STACK enum namespace changeset: 332:87e695024dfd user: pancake date: Thu Jul 24 04:39:26 2008 +0200 files: src/analyze.c src/dbg/debug.c src/dbg/debug.h src/dbg/system.c src/dbg/unix/debug.c src/plugin.c src/plugin.h description: * Fix a misstake between local vars and function arguments - Can be disabled with asm.comments=false * Added initial support for debug_msg and debug_msg_set - Accessible with !msg returns the last event * Minor cleanup changeset: 331:2e3941881884 user: pancake date: Thu Jul 24 04:04:22 2008 +0200 files: TODO src/analyze.c src/arch/x86/code.c src/code.h src/dbg/debug.c src/dbg/system.c src/dbg/unix/debug.c src/environ.c src/plug/io/ewf.c src/plug/io/posix.c src/plugin.c src/plugin.h src/rasm/main.c description: * Fix IO plugin layer weirdness - Should fix the 64 bit segfaults for posix io * Implement !run - Allows to change the program arguments inside the debugger - Reloads the program - Uses debug_loaduri() * Verbose output for wait_pid unix events - Explanation for the 'nop' steps - We have to store this info accessible with !msg or so (last debugger message, like C perror()) * Add experimental on code-stack analysis - Autodetects accesses to local vars and program arguments - Calculates stack size - Quite dumb atm. Needs more love - Adds comments with metadata like 'var???' or 'arg???' - Added new 'code' attribute 'stackop' - Gives information about push/pop/get/set/incstack/decstack/... to the code analyzer - Added initial support for x86 * Notified bugs in x86 assembler and disassembler :( changeset: 330:ee32d021ab00 user: pancake <@youterm.com> date: Wed Jul 23 20:09:49 2008 +0200 files: TODO src/dbg/system.c src/dbg/unix/fd.c src/main.c src/readline.c src/utils.c src/visual.c description: * Do not use color in dbg help when no scr.color enabled * Fix '!fd -' to close file descriptors - Show detailed information about them (type and permissions) - FIFO, SOCKET, CHARACTER, FILE - read/write perms * Fix weird flag autocompletion bug * Fix memcpy_loop function and 'w' in visual select to properly fill with circular source buffer on dest memory changeset: 329:43aa2be26feb user: pancake date: Mon Jul 21 18:21:12 2008 +0200 files: TODO src/code.c src/rabin/dietelf.c src/rabin/rabin.c description: * Fix some file.baddr issues in code.c. Needs more work * Make rabin -I output nicer changeset: 328:9ccf2ff28ef3 user: pancake <@youterm.com> date: Mon Jul 21 12:41:16 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c src/rabin/rabin.h description: * Added -I flag (show binary info) that shows info about - File type or ELF class - Data encoding - OS, Machine name * Added "ELF64 not yet supported" error message changeset: 327:4c30a78c8660 user: pancake <@youterm.com> date: Sun Jul 20 18:33:51 2008 +0200 files: src/cons.h src/visual.c description: * Fix build for non-libreadline changeset: 326:7b96008476a7 user: pancake date: Sun Jul 20 18:34:47 2008 +0200 files: Makefile.acr TODO src/dbg/unix/syscall.c src/rabin.c src/rabin/rabin.c src/rabin/rabin.h tests/chk/flags.sh description: * Moar random fix for x86-64 * Make rabin in core identify and handle powerpc mach-o files - big endian by default * Fix test and bindiff install changeset: 325:096201efab48 user: pancake date: Sun Jul 20 18:03:56 2008 +0200 files: src/dbg/arch/i386.h src/dbg/arch/x86_64.c tests/Makefile tests/chk/flags.sh description: * Refixes for x86-64 debugger * Initial import of the testsuite for radare - We need more tests to ensure we break nothing between releases - Contrib tests are welcome :) changeset: 324:945deeadad7a user: pancake date: Sun Jul 20 17:12:21 2008 +0200 files: Makefile.acr configure src/dbg/arch/x86_64.c src/plug/hack/radare.lua description: * Oops for previous commit - Fix install-script perms - install bindiff * Add Radare.Search.replace(from,to,delta) in radare.lua changeset: 323:93e07bb17c12 user: pancake date: Sun Jul 20 16:43:56 2008 +0200 files: configure gui/grsc/Config/Configure gui/grsc/Config/ToggleColor src/dbg/arch/x86_64.c src/grava.c src/hasher/sha2.h vala/grava/graph.vala description: * Fix INSTALL_SCRIPT file perms (ACR fix) * Fix x86-64 debugger build (thx elektranox) - Add contsc for x86-64 * Add global string table for graphs changeset: 322:447891eab453 user: pancake date: Sat Jul 19 23:52:02 2008 +0200 files: ChangeLog src/code.c src/objects.mk description: * Fix build * Fix x86 offset disassembly (oops) === 0.9.8 === changeset: 321:3bf039d212b9 tag: tip user: pancake date: Sat Jul 19 22:38:05 2008 +0200 files: ChangeLog TODO description: * Up release version to 0.9.8 - Update ChangeLog file changeset: 320:e639079b9c5f tag: tip user: pancake date: Sat Jul 19 22:34:01 2008 +0200 files: TODO src/code.c src/objects.mk src/plug/io/malloc.c src/plug/io/mmap.c src/plugin.c src/plugin.h src/radare.c src/rasm/Makefile src/rasm/main.c src/rasm/olly.c src/rasm/rasm.c src/rasm/rasm.h src/rasm/x86.c description: * Add 'olly' architecture for 'rasm' - Default over x86 * Add native rasm -d using system+radare * New IO module 'malloc' - Allocates N bytes and zeroes the buffer > radare malloc://1024 - Useful for scripting with volatile data changeset: 319:593830857604 user: pancake date: Sat Jul 19 21:19:34 2008 +0200 files: TODO dist/maemo/Makefile gui/Makefile libexec/Makefile src/rasm/main.c src/rsc.acr description: * Fix paths (/usr/libexec is outdated in FHS ?!?) - Moved to $prefix/share/radare/rsc - Moved to $prefix/share/radare/gradare - Adapt rsc and gradare for these new paths * Make 'rasm' show -d in short help changeset: 318:3ded3354d9a1 user: pancake date: Sat Jul 19 21:03:03 2008 +0200 files: TODO src/code.c src/code.h src/config.c src/cons.c src/flags.c src/visual.c description: * Add support for arrow keys in Vt and Ve - Add '+' and '-' keys for numeric config variables in Ve * Fix weird bugs in handling data types and disassembly - Now disassembly for udis86 is fixed again - needs huge refactoring and cleanup - Handle ranged data types and show offset - Optimize the data type handling code changeset: 317:717088cd19a4 user: pancake <@youterm.com> date: Fri Jul 18 20:17:49 2008 +0200 files: TODO dist/maemo/Makefile src/cmds.c src/dbg/arch/arm.c description: * Apply wF with comments patch from Nibble - Cleanup TODO * Fix build for ARM (maemo) changeset: 316:b7cd46d2f684 user: pancake <@youterm.com> date: Fri Jul 18 19:28:12 2008 +0200 files: src/code.c src/dbg/lseek.c src/rabin/dietelf.c description: * Import bugfixing patch from Nibble for 098 deadline - Fix segfault while removing comments - Avoid dupped comments * Fix flag @ 0 problem (only bugs the debugger) changeset: 315:78e793716c64 user: pancake <@youterm.com> date: Fri Jul 18 16:28:40 2008 +0200 files: TODO src/code.c src/config.c src/flags.c description: * Support to toggle bool vars in Ve - Can edit strings too (use 'space' or 'e' key) - 'q' is up menu level + exit now * Some minor unimplemented enhacements (R) changeset: 314:30108342f243 user: pancake <@youterm.com> date: Fri Jul 18 14:15:56 2008 +0200 files: Makefile.acr TODO src/arch/x86/code.c src/cmds.c src/code.c src/config.c src/cons.c src/rabin/dietelf.c src/rabin/dietelf.h src/utils.c src/visual.c description: * Add DESTDIR in makefile (helpy for rpmbuild) * Define dead line for 0.9.8 in TODO - Bugfixing now! * Fix bizarre disassembly bug - drop myinc - first opcode was trashing the rest of deltas * Add 'Ve' for visual eval configuration - Works like 'Vt' * Add strccmp and strccpy to copy until a separator char * s/exit/return/g in dietelf (nibble) - Add some more checks changeset: 313:050a335ff2f0 user: pancake <@youterm.com> date: Fri Jul 18 12:19:41 2008 +0200 files: libexec/strings-flag libexec/syms-dbg-flag src/flags.c src/rabin/dietelf.c src/rabin/dietelf.h description: * Do not split strings flag spaces * Make cmd.vprompt happy with Vt mode - Avoid infinite loops in Vt - Add scrolling in flagspace selector * Fix base address for strings in rabin - Now they work fine inside the debugger * Split symbols by imports, exports and others - Thx nibble ^^ changeset: 312:cfaaf19639b8 user: pancake date: Fri Jul 18 04:41:54 2008 +0200 files: TODO src/flags.c src/rabin/dietelf.c src/search.c src/visual.c description: * Add ':' in Visual 't' mode - Add 'p' and 'P' to rotate print formats - use cons_ instead of direct ansi * Flag search when searching changeset: 311:85816b6642fa user: pancake date: Fri Jul 18 04:22:57 2008 +0200 files: TODO src/arch/x86/ollyasm/disasm.h src/flags.c src/objects.mk src/rabin/dietelf.c src/rasm/Makefile src/rasm/x86.c src/visual.c description: * Bind 't' in visual to walk into flag spaces and flags easily - flags_visual_menu() - Must do the same for the config - Must support creation and deletion of flags * Make ollydbg assembler work with rasm changeset: 310:77a49e4c4093 user: pancake <@youterm.com> date: Thu Jul 17 18:59:35 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c description: - Import rabin patch from Nibble * auxilar function in dietelf prefixed with aux_ * added dietelf_list_strings() to dietelf which list strings in all non-executable sections * -z flag in rabin now uses dietelf_list_strings changeset: 309:b23fe0c26edf user: pancake <@youterm.com> date: Thu Jul 17 17:12:48 2008 +0200 files: TODO doc/fortunes man/bindiff.1 man/hasher.1 man/radare.1 man/radiff.1 man/rasm.1 man/rsc.1 man/xc.1 man/xrefs.1 src/arch/x86/ollyasm/Makefile src/arch/x86/ollyasm/README src/arch/x86/ollyasm/asmserv.c src/arch/x86/ollyasm/assembl.c src/arch/x86/ollyasm/disasm.c src/arch/x86/ollyasm/disasm.h src/arch/x86/ollyasm/gpl.txt src/arch/x86/ollyasm/main.c src/arch/x86/ollyasm/readme.htm src/rasm/Makefile src/rasm/main.c src/rasm/rasm.c src/rasm/rasm.h src/rasm/x86.c description: * Initial import of the Olly's assembler/disassembler - Will be good to have until the GAS merge - Should be used from inside 'rasm' - Coz it's GPL :) * Add '-d' to 'rasm' to disassemble an hexpair list of bytes changeset: 308:71b734f19269 user: pancake date: Thu Jul 17 06:23:50 2008 +0200 files: src/code.c src/visual.c description: * Fix the really anoying problem with foldering - Now is usable again \o/ - Nicer output for folders. - Fix some metadata problems (correct jump address and so) - Fix segfault while changing a folder changeset: 307:b6a50a8e450e user: pancake date: Thu Jul 17 05:16:35 2008 +0200 files: TODO gui/main.c gui/menubar.c gui/toolbar.c src/arch/x86/udis86/syn-att.c src/arch/x86/udis86/syn-intel.c src/code.c description: * Fix negative values in x86 disassembly for syn-intel and syn-att - Merged code from syn-pseudo * Fix 'seek' base address for the disassembler - Big oops. But needs check - Fit .db 'Cd' bytes in screen width * Remember project_file after save_as - Smarter code! Clean some warns - Add 'edit script' menu entry in the GUI changeset: 306:1a7c1398dc55 user: pancake date: Thu Jul 17 04:24:09 2008 +0200 files: gui/main.c gui/main.h gui/menubar.c src/rabin/rabin.c src/radare.c src/radare.h src/stripstr.c description: * Fix 'open/save project' menu entries in gradare - Add new 'save project as' * Add a functional version of rabin -z - runs echo /s | radare -e file.id -nv $FILE - some cleanup of the stripstr functions to not depend on core changeset: 305:782b8d4a00a8 user: pancake date: Thu Jul 17 02:46:43 2008 +0200 files: src/cmds.c src/dbg/arch/mips64.c src/hasher/wscript_build src/wscript_build wscript description: * Fix build for mips64 - Add automatic 64bit packed registers and show them nicely with !fpregs * Make redefined flags quite * Add 'hasher' for the waf build - Some testing with boolean configure flags :/ changeset: 304:6328b67412a9 user: pancake <@youterm.com> date: Wed Jul 16 17:31:38 2008 +0200 files: TODO libexec/flag-sections libexec/syms libexec/syms-dbg-flag man/rabin.1 src/flags.c src/rabin/dietelf.c src/rabin/rabin.c src/rabin/rabin.h src/radare.c src/radare.h src/stripstr.c description: * Use rabin from the core thru 'rsc syms'. Thx nibble - Demonstrates that loading 500 symbols from 'evolution' can be done in less than a fraction of a second :) * Update rabin manpage * Add dummy '-z' for showing strings of a binary - Not yet working..just to form the idea.. - Must work with '-x' (get xrefs of strings) - Must handle string length and do it for Cs changeset: 303:3e43c0d38783 user: pancake <@youterm.com> date: Wed Jul 16 13:56:44 2008 +0200 files: src/arch/ppc/vdappc.c src/code.c src/plug/io/shm.c vala/grava/widget.vala description: * Fix build for valac 0.3.5 - Declare 'extern' functions in C * Remove vdappc.c (unused file) * Cleanup some more warnings changeset: 302:55264559130a parent: 301:d74c2d922520 parent: 300:38177ada5e94 user: pancake <@youterm.com> date: Wed Jul 16 13:46:35 2008 +0200 files: src/arch/csr/dis.c src/config.c src/cons.c src/dietline.h src/hasher/entropy.c src/plug/hack/radare.lua src/plug/io/gxemul.c src/plug/io/mmap.c src/plug/io/socket.c src/print.c src/rabin.c src/rabin/dietelf.c src/rabin/dietelf.h src/readline.c description: * Oops merge waf branch * Unexpected warnaton changeset: 301:d74c2d922520 parent: 299:a38bd009ca45 user: pancake <@youterm.com> date: Wed Jul 16 13:30:22 2008 +0200 files: src/arch/m68k/Makefile src/arch/m68k/vda68k.c src/arch/mips/vm.c src/arch/x86/cpuid.c src/dbg/wscript_build src/plug/hack/radare.lua src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c src/rabin/rabin.h src/rabin/wscript_build src/radiff/bytediff.c src/radiff/wscript_build src/rasm/main.c src/rasm/wscript_build src/utils.c src/wscript_build wscript description: * First *basic* build using waf - No debugger, removed some unused stuff - Some workarounds for -DRADARE_CORE * radare.lua: Add Radare.asm(str) * Import dietelf patch from Nibble to support 'other' symbols - Added dietelf_list_others() to dietelf - Added -o (other symbols) flag to rabin (sym_oth_ prefix with -r) - dietelf_get_base_addr, dietelf_get_entry_addr use dietelf_bin_t as parameter changeset: 300:38177ada5e94 user: pancake date: Wed Jul 16 03:42:27 2008 +0200 files: libexec/Makefile libexec/asmcolor src/plug/io/pcap.c description: * Add dummy broken and experimental pcapio plugin * Add asmcolor script for mips and intel - Useful to trace register usage changeset: 299:a38bd009ca45 user: pancake <@youterm.com> date: Tue Jul 15 17:45:28 2008 +0200 files: Makefile.acr TODO man/bug.1 scripts/pushpop.lua src/bug src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c description: * More enhacements for dietelf from Nibble - Code cleanup and refactoring * Add dbg_call and dbg_jmp * Remove 'bug' - Cleanup of TODO for 0.9.8 changeset: 298:243165c6f95c user: pancake <@youterm.com> date: Tue Jul 15 14:18:48 2008 +0200 files: src/plug/hack/wscript_build src/plug/io/haret.c src/plug/io/wscript_build src/rabin/dietelf.c src/radiff/wscript_build src/wscript_build wscript description: * More advances in the waf front - Adopt 1.4.3 changes * Import more Nibble updates for dietelf - Filter flag names changeset: 297:e6ad80b734a9 user: pancake <@youterm.com> date: Tue Jul 15 13:12:29 2008 +0200 files: src/analyze.c src/arch/arm/code.c src/arch/ppc/Makefile src/binparse.c src/bytepat.c src/cmds.c src/code.c src/config.c src/cons.c src/dietline.c src/environ.c src/flags.c src/flags.h src/hack.c src/print.c src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c src/radare.c src/radare.h src/rdb.c src/readline.c src/search.c src/socket.c src/utils.h src/visual.c src/wscript_build src/xrefs.c vala/wscript_build wscript description: * Import latest Nibble's changes on dietelf - Adds support for exported symbols on non-stripped bins - Code cleanup - Shows and flags block sizes for each symbol * Warnatooon!!1 - Should fix any bugs * Moar advances in the waf port changeset: 296:e30b7bd41782 user: pancake <@youterm.com> date: Tue Jul 15 12:23:54 2008 +0200 files: scripts/pushpop.lua src/cmds.c src/dbg/debug.c src/dbg/debug.h src/dbg/system.c src/plug/io/wscript_build src/rabin/dietelf.c src/wscript_build src/xrefs.c wscript description: * Add dbg_push_reg and dbg_pop_reg lua functions * Add 'bf' command (block size like flag size) - Useful to fit block size to symbol sizes or so - 'b?' shows help message * Fix !get command * Enhacements for rabin's dietelf. Thx Nibble! - Properly fixes the BSD problem (+0x1000) * More advances in the waf front. Stills incomplete changeset: 295:2a862bd1585d user: pancake date: Tue Jul 15 01:28:26 2008 +0200 files: scripts/pushpop.lua src/cmds.c src/dbg/arch/i386.c src/dbg/debug.c src/dbg/win32/memdump.c src/dbg/wscript_build src/wscript_build wscript description: * Add push/pop emulated for the debugger in Lua * Rename 'wd to 'wv' - add support for endian - add support for 4-8 bytes (32-64 addresses) - support for get_math expressions > wv eax @ esp * !set skips '=' char - supports get_math > !set esp = esp -4 * add memdump for w32 from metasploit * Initial non-working port to waf changeset: 294:4919f81e01ce user: pancake <@youterm.com> date: Mon Jul 14 13:50:03 2008 +0200 files: TODO src/rabin/dietelf.c src/rabin/rabin.c src/rabin/rabin.h description: * Initial integration of rabin with xrefs - '-x' show xrefs for each symbol - maybe we need a flag to only 'grep' one symbol - needs radare output format and avoid system() - '-E' flag renamed to '-s' changeset: 293:96a841610bc2 user: pancake <@youterm.com> date: Mon Jul 14 12:48:20 2008 +0200 files: README TODO man/hasher.1 man/rabin.1 man/rasc.1 man/rasm.1 man/rsc.1 man/xc.1 man/xrefs.1 src/rasm/x86.c src/visual.c description: * Fixups in manpages, TODO and README * Fix 'call ' and add 'jmp ' in rasm * Remove user keybindings in visual (buggy) changeset: 292:c6d9e8b50054 user: pancake <@youterm.com> date: Mon Jul 14 11:46:35 2008 +0200 files: src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/rabin.c description: * Merge last dietelf patches - More code cleanup - Handle get_entry - Fixed support for BSD (stills a workaround) - Section perms are 'wax' and not 'rwx' - Initial support for exports changeset: 291:aae347e3b97b user: pancake <@youterm.com> date: Mon Jul 14 00:15:17 2008 +0200 files: src/rabin/Makefile src/rabin/dietelf.c src/rabin/dietelf.h src/rabin/elf.c src/rabin/rabin.c description: * Integrate Nibble's dietelf with rabin - Used for listing imports and sections (-i, -S) - Fixes the problems with netbsd - support for '-r' (radare output format for dietelf changeset: 290:52f632e2b9b4 user: pancake <@youterm.com> date: Sun Jul 13 04:59:17 2008 +0200 files: src/rabin/elf.c description: * Add initial source for the ELF parser. thx Nibble! - Not yet integrated with rabin - Actually just lists sections in rad and human modes - plt resolution only for x86/linux - no exports implemented yet - Needs more work changeset: 289:e4c7f1ac8538 user: pancake <@youterm.com> date: Fri Jul 11 19:03:50 2008 +0200 files: src/dbg/arch/arm.c src/dbg/arch/mips64.c src/dbg/unix/syscall.c src/rabin/rabin.c description: * Fix build on mips/arm * Make rabin be happy with output on w32 entrypoint changeset: 288:0b7d2e0dd53d user: pancake date: Wed Jul 09 10:38:51 2008 +0200 files: TODO libexec/Makefile libexec/fds libexec/strings-flag src/analyze.c src/arch/x86/udis86/test.c src/code.c src/code.h src/dbg/arch/i386.c description: * Initial import of 'rsc fds [pid]' - Show FDs used by a process-id (lsof,fstat frontend) * strings-flag filters '&' and ';' chars now * Fix code analysis and x86 intel disassembly problems with data_size() - User defined data types makes the code disassembly to be aligned - Fix a segfault in data_add - data_count -> data_size * Some code cleanup and indent * Make !fd work again on BSD changeset: 287:2281797346a4 user: pancake date: Wed Jul 09 02:47:09 2008 +0200 files: src/code.c src/config.c src/cons.c src/cons.h src/print.c description: * Add cons_lines int symbols from cons.c - Controls screen height - Fix HEXB and udis * Show flags before data types changeset: 286:919670e8ecc6 user: pancake date: Wed Jul 09 01:22:59 2008 +0200 files: libexec/strings-flag libexec/syms src/environ.c src/utils.c description: * Make string-flag not hang * Fix really weird bug in get_math - The debugger got crazy after some usage - Fix a valgrind warn in environ.c * Use objdump again .. nm is not that good changeset: 285:a28b85618e90 user: pancake@localhost.my.domain date: Fri Jul 04 04:30:58 2008 +0000 files: TODO libexec/syms-dbg-flag man/radare.1 src/config.c src/dbg/arch/i386.c src/dbg/arch/x86_64.c src/dbg/debug.c src/io.c src/rabin/rabin.c description: * Update TODO for next release * Fix dupped '-c' help in radare manpage * Use rabin -re $target in syms-dbg-flag to get entrypoint - Make rabin use the '-r' flag to output in radare format * Add file.insertblock (needs implementation O:) * Add 'ebp' for !get command - Make it work before starting to debug - initialize WS(regs) after forking - Add missing rsp and rbp 64 bit registers changeset: 284:687c8cb61b46 user: pancake@localhost.my.domain date: Fri Jul 04 03:54:30 2008 +0000 files: libexec/elf-base-addr libexec/flag libexec/flag-sections libexec/syms libexec/syms-dbg-flag libexec/syms-flag src/analyze.c src/code.c description: * Fix .text relocation issues while working with ELF objects - Thanks thij for the bug reports! :D - Fix elf-base-addr to return .text base if object (.o) - Make 'rsc flag' always use syms-dbg-flag instead of conditional - syms-dbg-flag now works for on-disk-files - make flag-sections be consistent with objects - Make 'syms' work with 'nm' instead of objdump (quite faster :) - Make syms-flag and syms-dbg-flag cleaner * Fix code analysis and flagging in disassembly print mode while using file.baddr - Now the lines of jumps in code works fine on files - Also the flags outside the debugger changeset: 283:e6efbd311dd2 user: pancake date: Thu Jul 03 23:29:04 2008 +0200 files: src/dbg/debug.c src/dbg/win32/debug.c src/plug/io/mmap.c src/plug/io/shm.c src/xrefs.c description: * Fix build for w32 * Make the xrefs work in 64 bit - needs test and rewrite to work inside the core changeset: 282:60a41272215d user: pancake <@youterm.com> date: Thu Jul 03 13:13:14 2008 +0200 files: scripts/mmx2ls2f.pl src/dbg/arch/i386.c description: * Fix sign problem with register flags * Add mmx2ls2f.pl -> perl script to convert MMX code into MIPS Loongson2F changeset: 281:15a5d14d0c58 user: ora8@localhost date: Thu Jul 03 03:52:35 2008 +0200 files: TODO src/config.c src/dbg/arch/arch.h src/dbg/arch/i386.c src/dbg/arch/i386.h src/dbg/debug.c src/dbg/debug.h src/dbg/events.c src/dbg/system.c src/dbg/unix/debug.c src/dbg/unix/syscall.c src/dbg/win32/debug.c description: * Add dbg.forks and dbg.controlc - not yet working - dbg.controlc is working only in w32 * Fixups for !contfork * Lot of fixups in the fork+threading handling - needs more work and unit tests - thanks th0rpe for the patches * Verbose output for event handling in debugger changeset: 280:bdcaafc0538b user: pancake date: Wed Jul 02 23:25:32 2008 +0200 files: src/radare.c description: * Comment out an XXX code that makes some rsc fail on !w32 changeset: 279:1a91099a1dfe user: pancake <@youterm.com> date: Tue Jul 01 13:46:39 2008 +0200 files: configure configure.acr libexec/Makefile libexec/signsrch description: * Added signsrch rsc script - Depends on signsrch from: - http://aluigi.altervista.org/mytoolz.htm * valac 0.3.4 is mandatory now changeset: 278:b9d5a2c4339e user: asdfsafd@asdf-safds-imac.desnet.org date: Tue Jul 01 11:14:19 2008 +0200 files: libexec/syms-dbg-flag src/arch/arm/aasm/Makefile src/io.c src/rabin/rabin.c description: * Fix build for darwin-osx10.4-powerpc * Fix rabin and syms-dbg-flag for mach-o sym exports - Identify big endian machos changeset: 277:861e82e8a684 user: pancake date: Tue Jul 01 04:39:29 2008 +0200 files: src/objects.mk src/plug/io/mmap.c src/plug/io/posix.c src/plugin.c src/plugin.h description: * Initial import of the mmap:// IO plugin - Supports multi-user interaction on a single file in realtime - Nice to experiment on IO optimizations changeset: 276:8ecc78b491a4 user: pancake date: Tue Jul 01 02:59:09 2008 +0200 files: TODO src/cmds.c src/config.h src/utils.h src/visual.c src/xrefs.c description: * Make the cursor scroll in visual - / and * work in cursor mode too * Oops for xrefs on linux fixed changeset: 275:3de2ecca802c user: pancake@flap.desnet.org date: Tue Jul 01 02:24:12 2008 +0000 files: TODO inject/README inject/shellcode.s scripts/inject/Makefile scripts/inject/dump-text.lua scripts/inject/inj.lua scripts/inject/shellcode.s src/cmds.c src/code.h src/dbg/mem.c src/io.c src/plug/hack/hello.c src/plug/io/posix.c src/plugin.c src/plugin.h src/radare.c src/radare.h src/rdb.h src/utils.h src/visual.c src/xrefs.c description: * New command 'ax' to invoke 'xrefs' - Initial support for xrefs in debugger - Dumps current section to disk and run xrefs - Added support for multiple architectures - Fixes the bsize limitation in radare_dump - Makes 'b' command accept math oops! * Some fixes in xrefs for segmentation faults (unchecked return values) - New flag '-b' to define base address (0x8048000 f.ex) * New command 'af' analyze function - Tries to identify the origin and destination of a function - Looks for farest code block without following calls * Some examples of code injection and section dumping - Implemented in lua scripts * Fix segfault in plugin list (ugly hack) changeset: 274:cff5c4e43285 user: pancake@flap.desnet.org date: Mon Jun 30 23:17:22 2008 +0000 files: src/dbg/debug.c src/dbg/thread.c src/dbg/unix/debug.c description: * Add freebsd LWP thread list support - Add bsd specific LWPINFO ptrace support - Both accessible with !th command changeset: 273:53ae349611fc user: pancake@flap.desnet.org date: Mon Jun 30 22:41:18 2008 +0000 files: TODO libexec/maps src/objects.mk src/plug/io/shm.c src/plugin.c src/plugin.h src/radare.c description: * Use sysctl in rsc map on fbsd * Initial import of the shm:// IO plugin - Allows to access to shared memory regions * Load rsc maps if dbg.maps enabled - Some fixups on the fbsd forking side - Stills buggy :O changeset: 272:4ea5c7f518eb user: erg0t@flap date: Mon Jun 30 00:51:57 2008 +0000 files: src/cmds.c src/dbg/system.c src/radare.c description: * Wrap system() calls using execv(sh,-c,cmd) - Fixes the segmentation fault bug of FreeBSD - Thanks erg0t for the tip changeset: 271:bcee72a34969 user: pancake@flap.lan date: Sun Jun 29 03:35:36 2008 +0000 files: src/Makefile.acr src/arch/x86/udis86/syn-pseudo.c src/code.c src/dbg/debug.c src/flags.h src/hasher/hasher.c src/plug/hack/Makefile src/radare.c src/utils.h description: * Fix make clean for hack plugins * Fix build and freebsd warnings changeset: 270:c7cb686af8dc user: pancake@flap.lan date: Sun Jun 29 03:07:57 2008 +0000 files: gui/menubar.c libexec/flag-sections src/arch/arm/gnudisarm.c src/config.c src/cons.c src/cons.h src/dbg/arch/x86_64-bp.c src/dbg/arch/x86_64.c src/dbg/debug.c src/dbg/unix/debug.c src/dbg/unix/syscall.c src/flags.h src/plug/hack/Makefile src/plugin.c src/radare.c src/radiff/bytediff.c src/radiff/rdbdiff.c src/readline.c src/socket.c src/utils.h src/visual.c description: * More fixups for x86-64 (thx elektranox) - Fix flag-sections s/-/_/g - Remove some warnings - fix some formatting issues changeset: 269:135c34e14e08 user: pancake date: Sun Jun 29 02:06:40 2008 +0200 files: src/dbg/arch/x86_64-bp.c src/dbg/arch/x86_64.c src/dbg/arch/x86_64.h description: * Apply elektranox patches for x86-64 changeset: 268:44d9d8ffee39 user: pancake date: Sun Jun 29 02:03:00 2008 +0200 files: src/cons.c src/dbg/arch/x86_64.c src/project.c src/radare.c src/radare.h description: * Fix the yesno issue (Thanks whats!) - Fix project_save problem * Some x86-64 issues changeset: 267:2669fb00001c user: pancake date: Sat Jun 28 23:32:25 2008 +0200 files: TODO src/analyze.c src/cmds.c src/config.c src/dbg/arch/arm.c src/dbg/arch/i386.c src/dbg/bp.c src/dbg/debug.c src/dbg/open.c src/dbg/regs.h src/dbg/unix/debug.c src/dbg/unix/procs.c src/dbg/watchpoint.c src/kradare/Makefile src/kradare/README src/kradare/kdebug src/kradare/kradare.c src/rdb.c src/rdb.h description: * Fill blk->type field - show bytes and type in 'ab' command * Add dbg.threads (not working) * Make arch_pc() receive a pid as argument - Show program counter for each process (!pid) * Initial import of kradare - A highly experimental kernel module for linux - Thanks sha0 for the contrib changeset: 266:26c927f9c64b user: pancake date: Sat Jun 28 20:24:06 2008 +0200 files: TODO src/cmds.c src/config.c src/dbg/mem.c src/radare.c description: * Major cleanup of the TODO file * Add dbg.sections=true - Loads rsc flag-sections - Add a special flag space for 'maps' and 'sections' - Remove flag verbosity changeset: 265:7144952f0b96 user: pancake date: Sat Jun 28 19:52:56 2008 +0200 files: libexec/Makefile libexec/spcc libexec/spcc-fe src/analyze.c src/cmds.c src/config.c src/print.c description: * Initial import of 'spcc-fe' structure parser frontend - Used from the new 'as' command. - 'as' stands for analyze structure - Uses the new dir.spcc to store all structures - Fixes some problems with rsc spcc * Fix minor bug in config changeset: 264:af6cb4818acc user: pancake date: Sat Jun 28 18:52:58 2008 +0200 files: src/print.c src/radare.c description: * Implementation of the '@@' for-each syntax for radare commands > fs regs && pz @@ * > pd 20 @@ 100 200 0x3433+44 0x804859 * Print command renames - pa -> ps (asm->shellcode) - ps -> pa (string->ascii) - pS -> pA (takes more sense) changeset: 263:56f40ad7f73b user: pancake date: Sat Jun 28 18:05:25 2008 +0200 files: TODO libexec/core libexec/flag-sections libexec/strings-flag libexec/syms-dbg-flag libexec/syms-flag src/arch/x86/code.c src/cmds.c src/config.c src/config.h src/cons.c src/cons.h src/dbg/README src/dbg/debug.c src/dietline.c src/flags.c src/flags.h src/grava.c src/radare.c src/radiff/bytediff.c src/radiff/radiff.c src/radiff/rdbdiff_main.c src/utils.c src/utils.h description: * Initial implementation of 'fs' flag spaces - Allows to split the flag space with names - 'regs', 'symbols', 'strings', and more to come! - 'fs *' to unselect all flagspaces - 'fs -name' to remove a flag space - Adapt rsc scripts for it * Some code cleanup and some bugs fixed in radiff - Fix rare possible bugs in config * Use 'gcore' when possible in rsc core changeset: 262:62b6de7db84a user: pancake@flap.desnet.org date: Fri Jun 27 04:20:41 2008 +0000 files: libexec/xtrace src/config.c src/vm.c description: * Enhace rsc xtrace to only trace userland addresses * Some debugging and enforcement to catch bugs :/ changeset: 261:e7105c463f9a user: pancake@flap.desnet.org date: Fri Jun 27 03:26:34 2008 +0000 files: libexec/core src/dbg/arch/i386.c src/dbg/debug.c src/main.h src/utils.c vala/grava/node.vala vala/grava/widget.vala description: * Use 'gcore' on FreeBSD for 'rsc core' * Fix build for FreeBSD 7.0 - arch_mprotect seems to partially work * Fix vala issue with 0.3.4 changeset: 260:aa11a31b3b63 user: pancake <@youterm.com> date: Thu Jun 26 13:50:53 2008 +0200 files: TODO doc/xtra/freebsd-sys-syscall.h libexec/strings-flag libusbsniff/libusbsniff.c src/config.c src/cons.c src/cons.h src/dbg/arch/i386.c src/dbg/arch/x86_64.c src/plugin.c src/rabin.c src/radare.h src/rdb.c src/readline.c src/search.c src/socket.c src/visual.c description: * More code cleanup - Rename BSD to __BSD__ - fix some warnings - remove some unused code * Fix ^C when search and cmd.hit is defined * Fix for bsd arch_syscall on x86 - add some notes * Prefix all strings with 'str_' * Fix bulk_write signature for libusbsniff changeset: 259:3b83a4860a8e user: pancake date: Thu Jun 26 01:13:50 2008 +0200 files: TODO libusbsniff/hexdump.c src/analyze.c src/arch/arm/aasm/aasm.c src/arch/arm/gnu/arm-dis.c src/arch/arm/gnudisarm.c src/arch/mips/gnudismips.c src/arch/mips/vm.c src/arch/ppc/code.c src/arch/ppc/ppc_disasm.c src/arch/sparc/sparc-opc.c src/arch/x86/code.c src/arch/x86/udis86/syn-pseudo.c src/config.c src/cons.h src/dbg/arch/i386-debug.h src/dbg/arch/i386.c src/dbg/debug.c src/dbg/debug.h src/dbg/unix/procs.c src/dietline.h src/flags.c src/flags.h src/main.c src/plug/io/socket.c src/radare.c src/rasm/main.c src/utils.h description: * Apply antiwarning patch from 'whatsup'. Thanks! changeset: 258:9c1fd83aa6a3 user: pancake date: Wed Jun 25 23:46:10 2008 +0200 files: libexec/Makefile libexec/flag-kallsyms src/analyze.c src/arch/m68k/code.c src/binparse.c src/binparse.h src/code.c src/code.h src/config.c src/cons.c src/environ.c src/grava.c src/objects.mk src/plug/hack/scriptedit.c src/print.c src/udis.c src/visual.c description: * Add rsc flag-kallsyms to flag kernel symbols * Some code reorganization and optimization + cleanup for the udis->code disassembling stuff - Faster disassemblying (needs more cleanup) - Added a pseudo-m68k code analyzer (empty) - gotoxy -> cons_gotoxy changeset: 257:1f70c3cdcd8a user: pancake date: Wed Jun 25 00:59:53 2008 +0200 files: TODO doc/xtra/segdump.S doc/xtra/segint.S src/analyze.c src/grava.c src/hack.c src/io.c src/utils.c vala/grava/widget.vala description: * Added segdump and segint - x86 segment register dumper - vdso syscall example using %gs * Fixed the problem in hexstr2binstr endian problem while starting the string with '0x' * Use F10 in gradare for fullscreen on desktops - Remove scrollbars in grava window * Quit GTK main loop after calling a gui plugin === 0.9.7 === changeset: 256:b2a723657f8e user: pancake date: Sat Jun 21 14:26:40 2008 +0200 files: ChangeLog TODO configure configure.acr description: * 0.9.7 released - Update development version to 0.9.8 - Update ChangeLog changeset: 255:0af245f7d644 tag: tip user: pancake date: Sat Jun 21 14:13:19 2008 +0200 files: TODO libexec/waiter libusbsniff/libusbsniff.c src/plug/hack/Makefile src/plug/hack/luaedit.c src/plug/hack/python.c src/plug/hack/scriptedit.c description: * Initial import of 'rsc waiter' - Pools /proc looking for childs of a PID or process name with a certain name * Fix build of python.so * Rename luaedit to scriptedit - The graphical widget script editor now allows to choose between: - lua, python and perl - Support keybindings for saving, opening and executing * Fix signature of libusbsniff's usb_bulk_write changeset: 254:e63bc134cf66 user: pancake date: Sat Jun 21 00:42:16 2008 +0200 files: src/dbg/close.c src/dbg/debug.c src/radare.c src/visual.c description: * Fix build for mingw32 - Fix scr.height problem changeset: 253:473040969044 user: pancake date: Sat Jun 21 00:32:21 2008 +0200 files: TODO src/cmds.c src/dbg/close.c src/dbg/debug.c src/dbg/objects.mk src/dbg/procs.c src/dbg/system.c src/dbg/unix/debug.c src/dbg/unix/procs.c src/radare.c src/utils.c description: * Support to 'escape' pipes '|' in radare_cmd - Add \| and \& operators for get_math for ORs and ANDs * Add dbg/unix/procs.c - Cleanup of dbg/procs.c * Cleanup implementation of !pid command - Supports argument to switch between threads or processes - Allows to stop/continue/kill a process - Show process running status after the pid changeset: 252:a6b3dc160ec0 parent: 251:95d22110520d parent: 250:c6769b1ea485 user: pancake <@youterm.com> date: Fri Jun 20 15:59:22 2008 +0200 description: * Merge! changeset: 251:95d22110520d parent: 249:cb371d9d1529 user: pancake <@youterm.com> date: Fri Jun 20 15:58:47 2008 +0200 files: config.mk.acr configure doc/fortunes scripts/lua/posix/Makefile description: * Fix lua-posix build problem * Fix ACR problems with BSD's sed * Add one more line in doc/fortunes changeset: 250:c6769b1ea485 user: pancake date: Thu Jun 19 22:42:01 2008 -0400 files: src/arch/mips/mips-dis.c src/arch/mips/vm.c src/config.c src/dbg/arch/mips64.c src/dbg/bp.c src/utils.c src/vm.c description: * loongson2f follows the old abi? is gdb buggy again? - needs testing. but now !set and vm regs are working fine * Fix segfault issue in breakpoint after stepping on mips * Add shifting and modulus on get_math/utils.c * Add 'vm_get_reg' to resolve reg indexes from reg names changeset: 249:cb371d9d1529 user: asdfsafd@asdf-safds-imac.desnet.org date: Tue Jun 17 05:35:04 2008 +0200 files: src/cmds.c src/config.c src/hasher/hash.c src/hasher/hash.h src/hasher/hasher.c description: * Fix segfault hash_xorpair on big endian * Fix typo in help msg (value -> data) * Graph now are more deeper! changeset: 248:030abb64b056 user: pancake date: Tue Jun 17 05:03:55 2008 +0200 files: src/dbg/arch/i386-bp.c src/dbg/bp.c src/dbg/debug.c src/print.c description: * Remove the printf debugging messages * Make the stepover work again (bps are nice again) changeset: 247:67f83bee82b6 user: pancake date: Tue Jun 17 04:49:30 2008 +0200 files: src/arch/arm/aasm/Makefile src/config.c src/radare.c src/visual.c description: * Fix build for non-debugger platforms (osx-ppc) --without-debugger changeset: 246:e09ea5c15f3d user: pancake date: Tue Jun 17 04:46:00 2008 +0200 files: src/dbg/arch/i386-bp.c src/dbg/bp.c src/dbg/debug.c src/print.c vala/grava/shape.vala description: * Fix the problems with breakpoints - Now hw and sw are ok for cont_until - take it as example if something fails - XXX: Lot of noisy debugging printfs * Add 'X' to 'pm' and '*' be a repeater of the last type changeset: 245:506cc9cb7016 user: pancake date: Mon Jun 16 09:52:44 2008 +0200 files: src/config.c src/plug/hack/radare.lua vala/grava/Makefile vala/grava/node.vala vala/grava/renderer.vala description: * Set refblocks to false by default * Fix radare.lua (Oops: syntax error) * Add Shape.vala (CIRCLE, RECTANGLE) - add circle() method changeset: 244:89f306896ce5 user: pancake date: Sun Jun 15 14:35:22 2008 +0200 files: src/analyze.c src/arch/x86/code.c src/cmds.c src/config.c src/rdb.c src/rdb.h src/udis.c vala/grava/widget.vala description: * Fix ref for aop.type == PUSH on x86 - Properly handle aop.ref in code analysis - Add graph.refblocks to split the graph by references too - useful to follow calls of pushed pointers - Show ref in analyze opcode (ao) * Nicer node dragging (no zoom yet..but much better) changeset: 243:755ada1fd502 user: pancake date: Sun Jun 15 04:22:37 2008 +0200 files: src/bytepat.c src/objects.mk src/plug/io/socket.c src/plugin.c src/plugin.h description: * Initial import of the byte pattern search engine - looks for N repeated series of bytes - Accessible with '/p ' command - Thanks esteve! * Fix plugin stupid bug. Needs refactor. but now is ok changeset: 242:c799398fa034 user: pancake date: Sun Jun 15 03:06:45 2008 +0200 files: TODO src/cmds.c src/code.h src/dbg/arch/i386.c src/dbg/debug.c src/objects.mk src/udis.c vala/Makefile description: * Inconsistent commit - Stub for /p to search patterns - Some minor fixups changeset: 241:a08da5f3e1dc user: pancake date: Sun Jun 15 01:24:49 2008 +0200 files: src/cmds.c src/dbg/objects.mk src/plug/io/remote.c src/plugin.c src/radare.c src/radiff/Makefile src/radiff/bytediff.c src/radiff/radiff.c src/rasm/x86.c description: * Add bytediff in C (Thanks esteve!) * Fix 'rasm 'mov eax,0'' * Fix build * Prperly fix euros changeset: 240:e0949c094b46 user: pancake date: Sun Jun 15 00:28:30 2008 +0200 files: TODO gui/sidebar.c libexec/syms src/analyze.c src/cmds.c src/dbg/objects.mk src/grava.c src/vm.c vala/api/config.vala vala/api/core.vala vala/api/disassembler.vala vala/api/io.vala vala/api/project.vala vala/api/utils.vala vala/grava/default_layout.vala vala/grava/widget.vala vala/list.vala description: * Fix grava node move with mouse (no zoom yet) - Add zoom buttons to GUI - Update graph after after adding breakpoints - Add 'sparc' in gui arch combo * Back to use objdump * Some fixups in native vala gui frontend build changeset: 239:336b8056cf4c user: pancake date: Sat Jun 14 18:28:45 2008 +0200 files: TODO src/arch/mips/code.c src/arch/mips/mips-dis.c src/arch/mips/vm.c src/arch/x86/vm.c src/cmds.c src/code.h src/config.c src/dbg/arch/i386-bp.c src/dbg/arch/mips64-bp.c src/grava.c src/objects.mk src/plug/hack/radare.lua src/rdb.c src/rdb.h src/readline.c src/udis.c src/utils.c src/visual.c src/vm.c description: * Initial implementation of the 'av' command - Analyzes the emulation of N opcodes from current seek - calls vm_emulate from vm.c > av 3 @ eip * Initial import of the mips vm code - hooked from asm.arch=mips * Initial buggy implementation of the xrefs manager - Cx and CX commands to add and remove xrefs (code (x), data (X)) * Fix some command autocompletions in readline.c * Resolve 'here' string in get_offset as config.seek * Theorically fix a breakpoint issue on mips64 (needs test) changeset: 238:acff1c4d9daa user: pancake date: Sat Jun 14 15:24:59 2008 +0200 files: TODO doc/fortunes src/arch/x86/code.c src/arch/x86/vm.c src/cmds.c src/code.h src/grava.c src/objects.mk src/plug/hack/radare.lua src/radare.c src/rdb.c src/vm.c description: * Initial implementation of the multi-arch virtual machine - Allows to emulate register changes while disassembling or debugging - Register Jump/Call/interrupt vector prediction - Single interface for register name resolution - add arch/x86/vm.c - ATM is very basic interface * Initial integration of the x86 code analyzer with the vm * Make the 'ab' command accessible from the radare lua api - code_block = Radare.Analyze.block(0x8049430) print("Number of calls: "..code_block['n_calls']) * 'm'ove command shows help before checking file.write changeset: 237:9c728b23728f user: panda@panda0 date: Fri Jun 13 01:36:52 2008 -0700 files: TODO src/analyze.c src/arch/x86/code.c src/cmds.c src/dbg/arch/i386.c src/dbg/bp.c src/radare.h src/rdb.c src/rdb.h description: * Fix lot of code analysis issues related to long vs u64 addresses - New command 'ab' analyze block * Fix x86 call address for arch_aop * Make the arch_syscall work on FreeBSD/x86 (should work on others bsds) - Needs at least one step to launch a syscall changeset: 236:ea43b2b4b366 user: pancake date: Fri Jun 13 03:04:09 2008 +0200 files: TODO doc/fortunes src/binparse.c src/binparse.h src/rabin/rabin.c src/search.c description: * Fix the search engine ancient bug - Ow yeah changeset: 235:d355955084cd user: pancake <@youterm.com> date: Wed Jun 11 20:12:19 2008 +0200 files: gui/main.c gui/toolbar.c src/config.c src/dbg/arch/i386.c src/dbg/debug.c description: * Show MMX registers in the linux/x86 debugger * Add child.stdio to change stdin,stdout,stderr to another terminal - use O_NOCTTY if the target file already exists $ radare -e child.stdio=/dev/pts/4 -d /bin/ls - inspired in the 'tty' command of gdb * Fix build of the GUI for maemo changeset: 234:a92447e06459 user: pancake date: Wed Jun 11 18:32:41 2008 -0400 files: TODO libexec/syms src/arch/mips/gnudismips.c src/udis.c description: * Add big endian support to the MIPS disassembler * Reorganize TODO file * Use readelf instead of objdump in rsc syms (much faster!) * Handle "x86" asm.arch like "intel" or "intel32" changeset: 233:9168f876e44f user: pancake date: Wed Jun 11 04:24:18 2008 +0200 files: scripts/anal.lua src/arch/mips/code.c src/code.h src/plug/hack/radare.lua src/udis.c description: * Some more opcodes handled by the mips code analyzer - add LOAD and STORE opcode types in code.h * Initial implementation of the Radare.Analyze API - Add anal.lua as an example of use * Fix the disassembler offset in internal buffer changeset: 232:3c736aee5271 user: pancake date: Wed Jun 11 03:53:10 2008 +0200 files: src/print.c src/udis.c description: * Optimize and enhace is_cursor - Make it detect if the cursor is 'inside' a opcode - Cursor can be '*' or '>' now changeset: 231:ccd34e6e8eba user: pancake date: Wed Jun 11 03:42:12 2008 +0200 files: TODO config.mk.acr configure configure.acr scripts/lua/posix/Makefile scripts/lua/posix/modemuncher.c scripts/lua/posix/posix.c src/arch/x86/code.c src/cmds.c src/dbg/arch/arch.h src/dbg/arch/i386.c src/plug/hack/Makefile src/print.c src/udis.c src/utils.c description: * Add LANG_LUA checks from ACR 0.7 - Use it for proper building the lua plugin - --includedir and --libdir setup cflags and ldflags now * Import luaposix plugin * Add 'wF' command to write from an hexpair based file * Make nonverbose disassembly happy with non-x86 - Make ao command work better - Better asm.arch parser changeset: 230:5c0880d44a02 user: pancake <@youterm.com> date: Tue Jun 10 17:11:05 2008 +0200 files: TODO scripts/vozme.lua src/arch/mips/code.c src/arch/x86/udis86/syn-pseudo.c src/cons.c src/dbg/arch/arm.c src/dbg/arch/i386-bp.c src/dbg/bp.c src/dbg/debug.c src/dbg/unix/syscall.c src/visual.c description: * Fix breakpoints again! - just ignore bp event if we're stepping * Do not show dupped info in asm.syntax=pseudo * Make arch_print_syscall be built on arm * if inc > bs then inc = bs (Thanks thij!) * add mips code analysis documentation in mips/code.c changeset: 229:7d827eac99cc user: pancake date: Tue Jun 10 05:10:46 2008 +0200 files: src/analyze.c src/arch/x86/code.c src/cmds.c src/cmds.h src/code.h src/config.c src/config.h src/grava.c src/print.c src/udis.c description: * Make 'q!' command quit without prompting * Modularize udis_arch_opcode (needs more work) - Some refactoring work on the code analyzer engine - Enhacements for x86-code-analysis - config.arch for faster fun * Move code analysis print functions to a new command called 'a'nalyze - pG is now called ag ; generates graph - pC is now called ac ; code (deprecated) - pA is now called ad ; data (deprecated) - 'ao' analyzes a opcode showing the attributes index = 0 opcode = mov eax, esp size = 2 type = move bytes = 89 e0 base = 0xb7f8b8c0 jump = 0x00000000 fail = 0x00000000 - very useful for code analysis and scripting !WARNING! old print commands will be deprecated! * Previous commit fixes a segfault with dietlint and ^W changeset: 228:92bb11fa2257 user: pancake date: Tue Jun 10 03:42:35 2008 +0200 files: TODO scripts/opcleaner.lua scripts/vozme.lua src/cmds.c src/config.c src/config.h src/dietline.c src/plug/hack/radare.lua src/radare.c description: * Fix pipes '>' in the shell \o/ * Enhacements on the radare lua api - Config.verbose( level ) new method - make radare_init get a bool argument to init or reinit * Add 'ereset' (aka 'er' command to eval reset) * New script to read (using vozme) the opcodes - Uses the new api for Config.restore changeset: 227:1dc80c54a6c6 user: pancake date: Fri Jun 06 02:56:01 2008 +0200 files: libexec/Makefile libexec/elf-prg-maps libexec/flag-sections src/analyze.c src/config.c src/flags.c src/print.c description: * Add rsc elf-prg-maps - To flag all the program maps of an ELF file using readelf - Handles note sections useful for core files * Fix pA print mode to analyze the whole block size - Add cfg.analdepth to make the pA analyze in more levels * Fix \n problem in 'fg' (flag grep) command changeset: 226:d72e8221dcd5 parent: 222:fc5fd1ec5b91 parent: 225:a3228b563a64 user: pancake date: Fri Jun 06 00:50:20 2008 +0200 description: * Merge lua branch changeset: 225:a3228b563a64 parent: 224:3d6c63721278 parent: 223:32412dc54941 user: pancake <@youterm.com> date: Thu Jun 05 17:08:47 2008 +0200 files: gui/main.c description: * Branch merge! changeset: 224:3d6c63721278 parent: 218:9f20b813ef25 user: pancake <@youterm.com> date: Thu Jun 05 17:07:57 2008 +0200 files: gui/main.c gui/menubar.c src/rasc/shellcodes.c description: * Fix shellcode length for rasc (thx whatsup) - add 23byte bsd shellcode * Some gui todo as comments changeset: 223:32412dc54941 parent: 221:88cdd6b7b5b9 user: pancake date: Thu Jun 05 18:42:06 2008 -0400 files: doc/gdb.scripts src/dbg/arch/arm-bp.c src/dbg/arch/mips64-bp.c src/dbg/arch/mips64.c src/dbg/debug.c src/dbg/unix/syscall.c description: * Make debug_skip be portable using arch_aop - works on arm and mips64 now! * Minor code cleanup changeset: 222:fc5fd1ec5b91 user: pancake date: Fri Jun 06 00:49:47 2008 +0200 files: libexec/flag-sections scripts/opcleaner.lua src/plug/hack/Makefile src/plug/hack/luaedit.c src/plug/hack/radare.lua src/visual.c description: * Initial import of the lua script editor in gtk - needs more work. this is just a sketch - H luaedit * Initial import of the opcleaner.lua script - Enhacementes on the radare.lua API * Make flag-sections show _end of sections - useful to get ranges of .text section, etc.. changeset: 221:88cdd6b7b5b9 user: pancake date: Thu Jun 05 05:25:33 2008 +0200 files: src/cons.c src/cons.h src/dietline.c src/radare.c src/visual.c description: * Fix fgets for assembly insertion - 'a' key in visual mode - Add more opcodes changeset: 220:594aabbfb091 user: pancake date: Thu Jun 05 05:09:19 2008 +0200 files: TODO libexec/Makefile src/cons.c src/cons.h src/flags.c src/radare.c src/utils.c src/utils.h src/visual.c description: * Add rsc sections-flag in Makefile * Make dietline cons_fgets be modular - Supports multiple sets of commands * Document 'fg' command - Use radare_seek properly * Add memcpy_loop in utils.h * Add support for endian address conversion in hexstr2binstr fun - Accessible with /x, wx, etc... - Useful to write addresses in memory > wx 00 00 0x8048312 00 00 * Rehabilite the 'w' command in visual mode to write hexstrings - If range of bytes are selected with cursor the whole block is filled - this is useful for nopping or blanking areas changeset: 219:899feb6c1c23 user: pancake date: Thu Jun 05 04:02:09 2008 +0200 files: TODO gui/main.c libexec/flag-sections src/cmds.c src/config.c src/dbg/close.c src/dbg/darwin/debug.c src/dbg/debug.c src/dbg/libps2fd.c src/dbg/system.c src/dbg/unix/debug.c src/dbg/win32/debug.c src/dietline.c src/dietline.h src/flags.c src/flags.h src/main.c src/radare.c src/radare.h src/readline.c src/readline.h src/utils.c src/utils.h src/visual.c description: * New flag commands: 'fc' and 'fg' - fc : define a command to be executed to print this flag - fg : flag grep. greps flag names with nicer output - The new 'eval flag.cmds' has beed created to enable or disable the commands. * Initial import of rsc flag-sections * Initial import of dl_callback for dietline - Support for ^U and ^Y (copy pasta for the shell) - Fix stdin issues when using pipes in dietline - Fix dl_hist_free out of range array access - First steps for full dietline autocompletion * Reduce debugger help command list * Wrap kill syscall to avoid massive kills (pid=-1) * The '.' in cursor+visual mode seeks to * Some refactoring changeset: 218:9f20b813ef25 user: pancake <@youterm.com> date: Tue Jun 03 20:05:01 2008 +0200 files: TODO gui/main.c gui/toolbar.c description: * Fix vte shrink changeset: 217:b7ae6035ff5b user: pancake <@youterm.com> date: Tue Jun 03 11:52:31 2008 +0200 files: gui/main.c gui/toolbar.c src/dbg/arch/i386-bp.c src/dbg/debug.c src/dbg/debug.h src/dbg/system.c src/udis.c src/visual.c description: * More fixups for F1-4 keys - Refactor visual_f(int key) keys * Add vte-based manpage reader for gradare - indent it * Make !wp show help if no wps defined - Code cleanup changeset: 216:d036155dc50b user: pancake date: Tue Jun 03 10:20:59 2008 +0200 files: TODO src/arch/x86/code.c src/cons.c src/dbg/arch/i386-bp.c src/dbg/bp.c src/dbg/debug.c src/dbg/debug.h src/dbg/mem.c src/dbg/objects.mk src/dbg/signal.c src/dbg/unix/debug.c src/visual.c description: * Lot of work on the breakpoint refactoring front - Needs more work, but for soft bps is cleaner than before - More refactoring on the debugger side - ABI changed (now breakpoints are 64bit addressable) - debug_bp_restore now makes it stop where it should (on x86) * Fix visual ESC keys handling - Double makes the visual to quit - F5 changes current EIP changeset: 215:3a21a9ba9f2e user: pancake date: Mon Jun 02 02:49:24 2008 +0200 files: TODO libexec/idc2rdb src/config.c src/cons.c src/radare.c src/rasc/shellcodes.c src/rasm/examples/selfstop.rasm src/rasm/rasm.c src/rasm/rasm.h src/rasm/x86.c description: * Initial import of idc2rdb (import IDA comments and symbols) * Add functional example of 'rasm' shellcode * Add 'scr.tee' to tee the output of the screen to a file * Handle ^C sending a SIGSTOP to the child * Add shellcodes of selfsigstop for linux and bsd x86 * Lot of fixups in rasm for directives - Initial mov eax, reg - Added jz and jnz - Fixed jmp and call delta offsets - Add pusha and popa opcodes changeset: 214:061a66c1be5f user: pancake date: Sun Jun 01 22:22:59 2008 +0200 files: gui/main.c src/dbg/debug.c description: * Use 'pd' for !trace :) * Fix build of gui changeset: 213:0141e52f53d4 user: pancake date: Sun Jun 01 15:00:51 2008 +0200 files: TODO libexec/gokolu src/dbg/debug.c src/visual.c description: * Fix gokolu to work with current google output * Make the 'i'nsert mode more pleasant - show insert mode in visual prompt - can use +-*/ for resizing and HJKL for moving - can use any available print mode for inserting (assume consequences until full support done) changeset: 212:1e3dd0b999ef user: pancake date: Sun Jun 01 13:51:25 2008 +0200 files: TODO src/Makefile.acr src/dbg/open.c src/hasher/hash.c src/hasher/hash.h src/main.c src/rasm/x86.c description: * Show PID after attach * Fix hash_par segfault * Make -d pid work in radare * Add jmp [reg] and [reg+delta] opcodes to x86/rasm changeset: 211:58e9b1f323c8 user: pancake date: Sun Jun 01 13:20:38 2008 +0200 files: TODO config.mk.acr libexec/adict libusbsniff/libusbsniff.c src/Makefile.acr src/rasc/rasc.c src/rasc/shellcodes.c src/rasm/main.c src/rasm/x86.c description: * s/OSOLIBS/SOLARIS/g * Add 'enter' and 'leave' opcode descriptions in 'rsc adict' * Fix usb_bulk_write signature (thx nibble!) - Fix rasc build and sysproxy path * Add -e flag to rasc to output escapped string format (for perl and so) - fix some shellcodes (x86.bsd.bind4444 was not ok) * Add 'pop' opcode to the rasm assembler for x86 changeset: 210:d790f7f8022a user: pancake <@youterm.com> date: Fri May 30 19:28:22 2008 +0200 files: src/rasm/x86.c description: * Add 'call (reg)' and 'jmp (reg)' for rasm/x86 changeset: 209:7c680c1634d6 user: pancake <@youterm.com> date: Fri May 30 17:32:45 2008 +0200 files: Makefile.acr man/hasher.1 man/radare.1 man/radiff.1 man/rasc.1 man/rasm.1 rasc/Makefile rasc/b2a.pl rasc/dump_sh.c rasc/listeners/getsock.S rasc/listeners/lis_socket_tcp.S rasc/listeners/lis_socket_udp.S rasc/rasc.c rasc/rasc.h rasc/rpc.c rasc/shellcodes.c rasc/sp.h rasc/syscall-linux.c rasc/syscall.S rasc/syscalls.h rasc/sysproxy.c rasc/test.c rasc/test_sp.c rasc/test_srv.c rasc/test_srv1.c src/Makefile.acr src/radiff/radiff.c src/rasc/Makefile src/rasc/b2a.pl src/rasc/dump_sh.c src/rasc/listeners/getsock.S src/rasc/listeners/lis_socket_tcp.S src/rasc/listeners/lis_socket_udp.S src/rasc/rasc.c src/rasc/rasc.h src/rasc/rpc.c src/rasc/shellcodes.c src/rasc/sp.h src/rasc/syscall-linux.c src/rasc/syscall.S src/rasc/syscalls.h src/rasc/sysproxy.c src/rasc/test.c src/rasc/test_sp.c src/rasc/test_srv.c src/rasc/test_srv1.c src/rasm/main.c src/rasm/x86.c description: * Move rasc to src/rasc * Update radare manpage - Add manpages for radiff and rasm * Some minor fixups changeset: 208:66aa782d09fd user: pancake@localhost date: Fri May 30 13:43:01 2008 +0200 files: configure src/dbg/libps2fd.h src/dbg/objects.mk src/dbg/regs.h src/udis.c description: * Fix SunOS case sensitive problem * Initial ptrace overview for solaris - i86pc -> i386 - ptrace(3) have no enums, hardcoded numbers only * Fix height in disasembly changeset: 207:09cfa1bb0779 user: pancake@localhost date: Fri May 30 13:15:07 2008 +0200 files: config.mk.acr configure rasc/Makefile src/Makefile.acr src/code.h src/project.c description: * Fix ACR to support OpenSolaris (SunOS/Solaris) - Lowercase it * Use ${OSOLIBS} to link radare against libsocket and libnsl on OpenSolaris * Export comments list in code.h changeset: 206:04a8a8377185 user: pancake <@youterm.com> date: Fri May 30 12:55:45 2008 +0200 files: configure description: * New fixup from acr 0.7 changeset: 205:05194093b753 user: pancake date: Fri May 30 05:22:05 2008 +0200 files: configure gui/main.c description: * Upload configure script generated with ACR v0.7 - Speeding with sed - Theorically fixes the problem in OpenSolaris * Fix build of the gui changeset: 204:f14b4ad19ccf user: pancake date: Fri May 30 04:52:51 2008 +0200 files: TODO doc/fortunes gui/main.c src/code.h src/config.c src/radare.h src/udis.c src/visual.c description: * Add '-d flag to gradare * Refactor comment_t and data_t to code.h * Fix file.baddr=0 * Make assembly folders work with file.baddr * Drop %, w and W keys of visual mode - Make use of 'i' or shell commands like 'wx' * Fix cursor code folding forward and backward - handles file.baddr properly changeset: 203:444cedf05745 user: pancake date: Fri May 30 02:52:51 2008 +0200 files: src/cmds.c src/config.c src/dbg/arch/arch.h src/dbg/arch/i386.c src/dbg/arch/powerpc-bp.c src/dbg/arch/powerpc-hack.c src/dbg/arch/powerpc.c src/dbg/darwin/debug.c src/dbg/objects.mk src/dbg/unix/syscall.c src/dbg/win32/debug.c src/utils.c description: * Fix '?' command column tabs * Fix #ifdef for powerpc in config.c - dump_eflags code cleanup - move getHTTPDate to utils * Strip syscall.c from i386 to unix * Initial import of the powerpc debugger stub - warnings with stuff to do changeset: 202:71fc27147c35 user: pancake date: Thu May 29 23:41:47 2008 -0400 files: TODO src/dbg/unix/debug.c description: * Fixes on the mips64 process status handler - Dumps a piece of code when unaligned access smashes the cpu changeset: 201:6e136c8baba0 user: pancake date: Thu May 29 19:58:33 2008 -0400 files: src/config.c src/dbg/arch/arch.h src/dbg/arch/mips64.c src/dbg/debug.c src/dbg/debug.h src/dbg/system.c src/radare.c description: * Add dbg.fpregs to view fpregs in debugger view * Oops. fix !jmp and !call - Make !jmp work on mips changeset: 200:fd7794db8034 user: pancake date: Thu May 29 17:34:29 2008 -0400 files: TODO configure rasc/shellcodes.c src/config.c src/dbg/unix/debug.c src/print.c description: * Fix acr problem with OpenSolaris awk * Fix build for rasc * Show fpregs in mips by default * Handle mips6t4 (ls2f) exception values changeset: 199:4645c8c7f6a4 user: pancake <@youterm.com> date: Wed May 28 19:23:54 2008 +0200 files: rasc/shellcodes.c src/dbg/debug.c description: * Add nopcode stack carver * Add shellcodes for osx on x86 and ppc - Also dual one * Add dummy 'cpuid' code. changeset: 198:670b45b98d95 parent: 196:5b2184ba62b1 parent: 197:b3bdca1f143a user: pancake date: Wed May 28 04:54:41 2008 +0200 files: src/dbg/arch/i386.c src/dbg/unix/debug.c src/radare.c description: * Merge freebsd branch - Fix radare_cmd bug while parsing end of string spaces changeset: 197:b3bdca1f143a parent: 195:3db23795670b user: pancake date: Wed May 28 04:48:50 2008 +0200 files: src/config.c src/dbg/arch/i386-bp.c src/dbg/arch/i386.c src/dbg/debug.c src/dbg/mem.c src/dbg/unix/debug.c src/plug/io/debug.c src/radiff/bdiff/Makefile description: * Fix radare debugger on FreeBSD (waitpid problem) * Use software breakpoints by default on FreeBSD - Initial implementation of Hardware breakpoints for FreeBSD - dr_get() and dr_set() * Snippet code for fpregs and xmmregs on freebsd * Implement !maps for FreeBSD changeset: 196:5b2184ba62b1 user: pancake date: Wed May 28 03:16:56 2008 +0200 files: src/dbg/arch/i386.c src/dbg/debug.c src/dbg/mem.c src/dbg/unix/debug.c src/plug/io/debug.c src/radiff/bdiff/Makefile description: * Fix debug_waitpid for FreeBSD - the debugger is working again * Fix !mp help message (format string problem) changeset: 195:3db23795670b user: pancake date: Wed May 28 03:05:17 2008 +0200 files: TODO src/dbg/debug.c src/print.c src/udis.c description: * Fix !signal segfault * Make 'pd' command work again - udis.c needs more love changeset: 194:bda5eef1f328 user: pancake date: Tue May 27 05:00:22 2008 +0200 files: gui/main.c description: * Fix gui consistence bug hpaned -> hbox changeset: 193:5a909ba1d57b user: pancake date: Tue May 27 04:21:26 2008 +0200 files: TODO src/cons.c src/dbg/debug.c src/grava.c src/plugin.c src/radare.c src/radare.h src/udis.c src/visual.c description: * Add
to cons_printf * Split monitors_run() and call it from graph and visual * Fix radare_cmd("") and pD usage * Show flags for all jumps (>10) * Fix number of lines for pD in visual mode - Better control of screen changeset: 192:bffae661cac7 user: pancake date: Tue May 27 03:36:21 2008 +0200 files: TODO src/arch/x86/code.c src/config.c src/cons.c src/dbg/debug.c src/flags.c src/flags.h src/io.c src/print.c src/udis.c src/utils.h description: * Lot of small bugs found in a talk - code analysis returns invalid pointers * Add scr.html boolean to output html instead of ansi * Fix flag_name_by_offset problems in udis - Fixes the asm.flags and asm.flagsline weirdness * Show labels in keybind aop.jumps * Make 'pd' command disasemble 'n' opcodes - no longer use objdump changeset: 191:29303d20e107 user: pancake <@youterm.com> date: Mon May 26 13:48:50 2008 +0200 files: dist/maemo/Makefile gui/gradare.desktop gui/grsc/Shell description: * Up version and fix the missing gradare entry - fix install for the maemo menu changeset: 190:882b25102db1 user: pancake <@youterm.com> date: Mon May 26 12:57:58 2008 +0200 files: Makefile.acr config.mk.acr src/plug/hack/Makefile description: * Use 'install' program to install plugins - fixes dlopen map-populate bug - Thanks sha0 and gerardo for the tips! :) * Fix build for lua plugin (try -llua and -llua5.1) - ubuntu friendly changeset: 189:5d2c67b3298e user: pancake <@youterm.com> date: Fri May 23 13:52:33 2008 +0200 files: configure configure.acr libexec/Makefile libexec/boomerang src/environ.c description: * Up to 0.9.7 * Add support for boomerang - decompilation of functions in the fly - Implemented as 'rsc' script. - export XOFFSET envvar * Usage: !rsc boomerang $FILE $XOFFSET changeset: 188:7d1402af39ad user: pancake date: Fri May 23 02:32:46 2008 +0200 files: Makefile.acr src/arch/sparc/sparc-dis.c src/rabin/Makefile src/radiff/Makefile src/w32utils.c description: * Fix build for mingw32 * Proper handle of ${BINSFX} * Add w32dist make target changeset: 187:e195042eaf68 user: pancake <@youterm.com> date: Wed May 21 16:57:03 2008 +0200 files: ChangeLog configure configure.acr gui/Makefile gui/grsc/Shell scripts/search-demo.lua description: * radare 0.9.6 released! - We need at least valac 0.3.3 (svn one) - Fix warning from configure.acr script - Update changelog for the release === 0.9.6 === changeset: 186:d578e87649db tag: tip user: pancake@flubox date: Wed May 21 13:38:16 2008 +0200 description: * Oops. hildon dislikes menu items from stock :O - Autocomplete menu for maemo changeset: 185:32d7b567a931 user: pancake@flubox date: Wed May 21 13:08:08 2008 +0200 description: * Fix build for valac 0.3.3 - 'weak' keyword has been removed \o/ * Upgrade maemo scripts for a release * Add 'run script' in gradare menubar - support radare and lua script * Handle maemo zoom buttons in grava window - the widget needs to be redrawed after zooming changeset: 184:b136b6e43bfc user: pancake date: Wed May 21 08:30:09 2008 +0200 description: * Fix flag autocompletion (fixes infinit loop bug) * Clear some warnings * Make config.limit work again - setup a node callback to set config.limit internally * Refactor terminal_ -> cons_ * Show a '*' in !maps indicating your config.seek position * Flag 'search_last' when pressing ^C in search changeset: 183:eee7e2be5cdb user: pancake date: Tue May 20 17:17:46 2008 +0200 description: * Add missing include. I'm filling of shit this changelog lol changeset: 182:a695c69eb970 user: pancake date: Tue May 20 17:16:25 2008 +0200 description: * Oops. sparc stuff was not added O:) changeset: 181:a50dd541d1e1 user: pancake date: Tue May 20 10:10:17 2008 +0200 description: * Add actions menu of gradare inside a expander container * Make rsc-syms and rsc-strings handle $ENV{VERBOSE} * Make '-d' cmdline flag handle pids also (radare -d pid) * Define 'cursor' flag at every prompt * Make 'f' and 'F' keys in visual cursor mode create and destroy flags changeset: 180:807db6476718 user: pancake date: Mon May 19 22:08:05 2008 +0200 description: * Clean all missing *.o and *.so * rename status->info and fix output * Reload process after end * Fix div0 problem in print_addr while mod changeset: 179:b2249ae64d4b user: pancake date: Sat May 17 18:25:39 2008 +0200 description: * Initial import of the SPARC disassembler (no code analysis yet) * Drop nasty verbose messages in plugin load * Merge Nibble's patch to fix build without GUI changeset: 178:f2e115f228c2 user: pancake date: Fri May 16 04:14:12 2008 +0200 description: * Rename !regval to !get (matches !set/!get pair) - make the lua fuzzer scrip happy with this change * Add support for changing memory page protection properties - New !mp command for the debugger - Stores a list of all the memory map changes done - Works on linux/x86 and windows (32bits) - Aligns memory and size to -=%4 - Supports changing rwx permissions * Add support for GUI hack plugins - Fixes some bugs in plugin list handling - Add gtk-hello.so example - Needs completely rebuild of radare (change of ABI!) - Initialize gtk before calling a PLUGIN_HACK_GUI one changeset: 177:20498e4182f9 user: pancake date: Thu May 15 10:01:19 2008 +0200 description: * Refactor of gradare and grava popup menus - add set/remove breakpoint - add continue until here - add copy to clipboard - remove (add/rm node branches) menu option * Support for toggle options in gradare changeset: 176:38380e1fbfc2 user: pancake date: Thu May 15 00:30:05 2008 +0200 description: * Add 'lua' and 'nop' menu entries in Hacks menu for gradare * Fix output of debugger !alloc command * Fix mmap_tagged_page (32-64bit problem) * Enhacements for the lua api: - Radare.get(string) use get_math() to process the string and returns the hexadecimal value of it. Can be used to get register values: local eax = Radare.get("eax") - Radare.Debugger: step, step_over, step_until_user_code, add_bp, remove_bp, alloc, free, dump, restore, jump, backtrace changeset: 175:76acf144fe84 user: pancake <@youterm.com> date: Tue May 13 20:38:14 2008 +0200 description: * Some minor enhacements for radare.lua - Search api more stable - add chomp string function - add bytes() function * ubuntu uses liblua5.1.so (but the rest liblua.so) changeset: 174:6a96fbf71585 user: pancake date: Tue May 13 03:50:08 2008 +0200 description: * Add search example in lua - Add global join() method in radare.lua - Search results using cons changeset: 173:ce081d857815 parent: 172:53b4afa22059 parent: 171:60ebbe6cb87a user: pancake date: Tue May 13 02:34:18 2008 +0200 description: * Oops merge! changeset: 172:53b4afa22059 parent: 170:a91759d2743d user: pancake date: Tue May 13 02:33:54 2008 +0200 description: * Some scr.palette parse bugs fixed * Initial try for hildon popup menu * Minor manpage update O:) * Add asm.reladdr to show relative addresses in disassembly * Support to setup relative breakpoints from current seek * Add gtk-forward button in pG window to add nodes executing a command - monitor nodes that are updated everytime - support for fixed nodes across graph reloads * Initial import of Grava.Chart class - Skeleton of the charting class for grava changeset: 171:60ebbe6cb87a user: pancake date: Sun May 11 04:55:38 2008 -0400 description: * Make mips code analysis work a bit - Needs pseudo virtual machine to get branch prediction * Show 'bad' and 'cause' registers changeset: 170:a91759d2743d user: pancake date: Sun May 11 02:26:12 2008 +0200 description: * Initial import of syms-extract - An rsc script to extract symbols of a program or library - Ouputs radare commands using 'pa' output. * On mips cfg.addrmod is 32 (for pipeline alignment * ASHC print format (pa) now takes care about the flag in current seek, and ouputs correct gas assembler output using .equ syntax changeset: 169:5bcde2e1e92c user: pancake date: Sun May 11 03:54:38 2008 -0400 description: * Yay ! loongson2f debugger (mips) working nicely! - Fix register fetch (32, 64 bits, mips and cpu1 (fpu)) - Simplify register printage * Implement "stepbp" command for the debugger - uses arch_aop to predict jumps and put a breakpoint on each possible execution branch - debug_step bridges to debug_stepbp for mips (you will need to execute a "!stepbp 2" to step over nops) changeset: 168:0034f9bc8329 user: pancake date: Fri May 09 21:38:53 2008 -0400 description: * Add -d to debug programs ala gdb --args * Setup CK_FORK = no to debug gstreamer test checks changeset: 167:70cc9f3a743d user: pancake <@youterm.com> date: Fri May 09 16:21:34 2008 +0200 description: * Reimport the oldschool code_analyze_r_nosplit in analyze.c - New algorithm splitting code blocks is buggy - Selectable with the boolean eval 'graph.split' (false by default) changeset: 166:bb381f212bfc user: pancake date: Fri May 09 03:32:52 2008 +0200 description: * Fix !cont and !contu to support an argument with a memory address to place a breakpoint and make radare run to there - implement new debug_cont_until() function * Fix Makefile for radiff (oops..) * Remove sugar color hack from udix86 stuff - not needed anymore - colors now handled by scr.palette * Implement easier syntax for scr.palette - Allows to do things like: > eval scr.palette = .prompt=3.jumps=5 changeset: 165:64bd628b96ff user: pancake <@youterm.com> date: Wed May 07 13:32:57 2008 +0200 description: * Oops. missing makefile in src/radiff/Makefile * Fix warning message in bdiff.cpp changeset: 164:88853de4d590 user: pancake date: Wed May 07 15:25:04 2008 -0400 description: * Add basic shellcode for mips-linux inside rasc.c * Fix segfault while using multiple color palettes * Add nop,metadata,header and printable palete colors * Fix build for arm and mips64 (get_reg int->u64) - fix warns in get_tmpd_dir and endian_memcpy * More use of the color palette - prompt color - memory addresses - for some headers - byte types - arch_aop in udis changeset: 163:baca922d76e4 user: pancake date: Wed May 07 04:00:09 2008 +0200 description: * Some refactoring on cons.h * Default prompt color is yellow - oops changeset: 162:937599b20b79 user: pancake date: Wed May 07 03:53:02 2008 +0200 description: * Initial implementation of the color palette - user defined with eval scr.palette - currenty you only can change the prompt color - palette only works when scr.color is true * talk about radiff in README changeset: 161:743a04b71ffa user: pancake date: Wed May 07 02:20:01 2008 +0200 description: * Ooops. we need valac 0.3.2! (current svn) * Fix broken build changeset: 160:d0b0676751b0 user: pancake date: Wed May 07 02:08:27 2008 +0200 description: * Initial import of radiff - Teh unified bindiffing utility - some refactoring of the 4 current bindiffing engines * Add "remove breakpoint" in contextual menu in graphs * Make it depend on vala 0.3.1 - Warn about the miss of libvte for the gui changeset: 159:721be76715a4 user: pancake <@youterm.com> date: Tue May 06 18:16:13 2008 +0200 description: * Fix build for vala 0.3.2 - handle '?' null references in some functions * Initial import of the bindiff.c * Fix build for i386. get_reg must be u64 to fit with signature changeset: 158:fe11900ad1d9 user: pancake@flutes.fluendo.lan date: Tue May 06 11:18:33 2008 +0200 description: * Fix build for x86-64 - fixes the th0rpe patch - arch_set_pc -> arch_jmp - get_reg must be u64 changeset: 157:b02bf9a0a765 user: pancake date: Tue May 06 04:31:34 2008 +0200 description: * Fix 32-64 bit problem in graphs - Graphs and code analysis (out of lines) still broken - add some printf debugging - use memset0 in block_new * force endian=1 in java udis changeset: 156:5b945a2bb89a user: pancake date: Tue May 06 01:43:33 2008 +0200 description: * Use big endian while file.id = 1 and class file detected - do not exit if bad header parsing * Import nibble's initial plugin.c cleanup patch * Fix list_del segfault for data_add, data_del, etc.. * Fix output udis code formatting options in visual mode - fix space count after printing a flag in disassembly - remove 'b' key of visual mode (not used..dont like the idea..) changeset: 155:f05004143197 parent: 149:079c8b97f38e parent: 154:ef9686a4375e user: pancake <@youterm.com> date: Mon May 05 13:26:46 2008 +0200 description: * Merge heads changeset: 154:ef9686a4375e user: pancake date: Sat May 03 12:29:50 2008 +0200 description: * Initial import of the th0rpe's fuzzer - Based on new !loop debugger command and a LUA script - Coded and tested on windows * Add fuzzer-loop.lua script * New lua command to return integer value instead of string - regval command for debugger (needs refactoring) changeset: 153:5ed0a59696b8 user: pancake date: Fri May 02 13:21:06 2008 +0200 description: * Apply Nibble's patches - Fix plugins array overflow 11->12 - Fix visual height annoyance changeset: 152:6ed8b4df1b52 user: pancake date: Wed Apr 30 14:15:31 2008 +0200 description: * Make monitor stuff work again - setup proper monitor dir in config - Strip \n from commandfile in -L - Use MONITORPATH environ * cfg.addrmod defaults to 4 - draws a comma after each offset if mod is zero * Fix dir.tmp (get_tmp_dir()) - Get w32 directory (GetTempPath) changeset: 151:8860ec265e2c user: pancake@stimutacs.local date: Wed Apr 30 02:57:52 2008 -0700 description: * Fix HEXB print mode (header misses 1 space) * Show warn message when cannot attach (needs procmod group to debug in 10.5) * Launch debug_attach after fork in darwin debugger * Use killall instead of pkill in gdbx plugin (osx friendly) changeset: 150:4792d0c2e887 parent: 148:a2c0a3a855bd user: pancake@stimutacs.local date: Tue Apr 29 17:55:50 2008 -0700 description: * Fix build for MacOSX 10.5.2 (Thanks Ben Byer!) - Initial native debugger implementation for mach/osx - Fixups in gdbx plugin. Make it work fine on osx66 changeset: 149:079c8b97f38e user: pancake <@youterm.com> date: Mon May 05 13:25:26 2008 +0200 description: * add doc/xtra/intel-opcodes --- needs merge with rsc adict * print \n when ^D in radare_prompt (Thanks progeny!) * Fix multiline error message * Add '-r' flag to javasm (should output radare commands instead of plain nfo) changeset: 148:a2c0a3a855bd user: pancake <@youterm.com> date: Mon Apr 28 15:40:45 2008 +0200 description: * Thanks nibble for fixing the history bug in dietline * Thanks piem for adding 'nm' line in rabin for mach-o changeset: 147:b0f46d0b85ea user: pancake@flutes.fluendo.lan date: Mon Apr 28 13:06:16 2008 +0200 description: * Fixes build on GNU/Linux - 64 bit - Current state is usable, but not very nice changeset: 146:241aded88e0c user: pancake date: Sun Apr 27 22:49:31 2008 +0200 description: * Oops. fix really stupid bug in unix debugger - Assign ps.tid = ps.pid in debug_attach changeset: 145:f4a17f618d42 user: pancake date: Fri Apr 25 03:37:07 2008 +0200 description: * Fix entry text input command in grava.c * Up to 0.9.6 - update changelog == 0.9.5 == changeset: 144:123af7bb0f55 tag: tip user: pancake <@youterm.com> date: Fri Apr 25 02:53:11 2008 +0200 files: src/dbg/arch/i386.c src/dbg/regs.h description: 0.9.5 release! - Fix build on NetBSD changeset: 143:25b8b1139f83 user: pancake date: Fri Apr 25 03:06:05 2008 +0200 files: src/arch/csr/dis.c src/plugin.c src/rabin/rabin.c src/search.c description: * Fix build for mingw32 - Tested on Windows Vista (32 bits) - The debugger works!! * Fix plugin loading method * Add some minimal MACH-O stuff in rabin - Add -t to show filetype * Show 'Stopped at 0x..' when ^C in search - run f -hit0_* before the search (ugly hack) changeset: 142:1ae791abbfd7 user: khaos@dhcp-96.pofhq.net date: Fri Apr 25 00:24:30 2008 +0200 files: src/arch/ppc/ppc_disasm.c src/config.c src/plugin.c description: * Fixups for powerpc (Thanks Kaos!) - big endian by default when not lil endian :) - user asm.arch = ppc on __POWERPC__ - ascii code analysis works fine. pG one does not :( * Oops. remote array is not build properly - add remote-plugin changeset: 141:97ace38fa841 user: pancake <@youterm.com> date: Thu Apr 24 12:05:58 2008 +0200 files: dist/maemo/Makefile gui/gradare.desktop gui/main.c description: * Make gui menu work in scratchbox * Grab gtkdialog from /usr/bin when disting debian pkg changeset: 140:8f7bcf106be0 user: pancake date: Thu Apr 24 09:29:23 2008 +0200 files: TODO src/dbg/darwin/debug.c description: * Add some stuff for the darwin debugger changeset: 139:389bf91a2355 user: pancake date: Thu Apr 24 02:27:13 2008 +0200 files: gui/main.c gui/main.h src/dbg/debug.c description: * Fix GtkWindow definition in main.h * Add support for increase/decrease the font size in gradare - Supports zoom keys of nokia internet tablets - Keypad add and subtract keys are the ones for standard pcs * F5 in gradare refreshes screen * Show better help for !set debugger command changeset: 138:8a03c997c36c user: pancake <@youterm.com> date: Wed Apr 23 17:39:10 2008 +0200 files: dist/maemo/Makefile gui/main.c gui/sidebar.c src/Makefile.acr src/grava.c description: * chmod +x all bins for maemo package * Do not unfullscreen with key * 'arm' architecture by default in maemo gui * Add '+' and '-' keys for the graphs using gdk * Manage fullscreen key for graphs too changeset: 137:0df20a879257 user: pancake <@youterm.com> date: Wed Apr 23 16:22:16 2008 +0200 files: gui/main.c gui/main.h gui/toolbar.c description: * Build fixups for maemo - new prelease maemo/debian package uploaded changeset: 136:4fd5a6711f61 user: pancake date: Wed Apr 23 03:53:37 2008 +0200 files: config.mk.acr configure configure.acr gui/Makefile gui/main.c gui/main.h gui/menubar.c gui/sidebar.c gui/toolbar.c description: * Add --with-maemo flag for hildon integration stuff in gui/ * Handle fullscreen key in maemo (F6) * Handle monitor windows with hildon too * Theorically fix the problems with toolbar and menu (needs testing) * Add fullscren entry in view menu * Add mips and csr asm.arch in combobos * Show notification banners in the hildon gui changeset: 135:f966e44454ca user: pancake date: Wed Apr 23 03:04:05 2008 +0200 files: dist/maemo/Makefile gui/sidebar.c src/analyze.c src/arch/arm/gnu/arm-dis.c src/arch/csr/dis.c src/config.c src/environ.c src/print.c src/radare.c src/udis.c src/visual.c description: * Fix build without debugger for iphone - replaces assert to avoid portability problems * Show an appended ',' (comma) in 4 byte aligned addresses * Make lines of the code analysis wider! (asm.lineswide=1 by default) * Dist libexec and gsrc scripts too into maemo! changeset: 134:74c15a8f94f5 user: pancake date: Sun Apr 20 03:19:49 2008 -0400 files: src/arch/mips/gnudismips.c src/arch/mips/mips-dis.c src/arch/mips/mips-opc.c src/dbg/arch/mips64.c src/flags.c description: * Use loongson2f CPU by default * Automatic support for 64->32 bit register wrapping for mips * strnstr->_strnstr in flags.c (oops) changeset: 133:86a18993d516 parent: 131:f58b606f9f53 parent: 132:c1f9d0baab8d user: pancake date: Tue Apr 22 00:36:08 2008 +0200 description: * Merge osx branch changeset: 132:c1f9d0baab8d parent: 130:5821bffdef90 user: pancake date: Mon Apr 21 23:08:52 2008 +0200 files: config.mk.acr libusbsniff/Makefile src/arch/arm/aasm/Makefile src/dbg/arch/arch.h src/dbg/arch/i386.c src/dbg/darwin/debug.c src/dbg/darwin/fd.c src/dbg/darwin/signal.c src/dbg/darwin/weasel.c src/dbg/darwin/weasel.h src/dbg/objects.mk src/plugin.c src/radare.h src/utils.c src/utils.h description: * Initial port of debugger skeleton for darwin (OSX) - Import weasel debugger code to fill the gaps in debug.c - Planned initial ports for x86 and arm * Fix some build problems on osx - addr_t defined in radare.h - fxpregs only available for linux - rename strnstr to _strnstr (already defined in osx api) changeset: 131:f58b606f9f53 user: pancake date: Tue Apr 22 00:35:13 2008 +0200 files: src/grava.c src/print.c description: * Fix node references usage from C - flags_between makes radare crash - Do not use it from the pG command (graphs) changeset: 130:5821bffdef90 user: pancake date: Mon Apr 21 22:46:16 2008 +0200 files: TODO src/print.c src/print.h src/utils.c description: * Implement p7 command for 7bit encoding (raw SMS decoding) * Fix recursivity level problem with get_math - Some files makes radare crash on startup changeset: 129:f7a4976e8937 user: pancake <@youterm.com> date: Mon Apr 21 15:35:41 2008 +0200 files: dist/maemo/Makefile dist/maemo/README gui/Makefile gui/main.c src/arch/csr/dis.c src/dbg/arch/arm-bp.c src/dbg/arch/arm.c src/dbg/regs.h description: * Fixes for ARM build * Some minor/buggy hildon/maemo fixups changeset: 128:bdb1d1599663 user: pancake date: Fri Apr 18 02:11:22 2008 +0200 files: TODO src/config.c src/dbg/debug.c src/dbg/unix/debug.c src/visual.c description: * Make trace.libs take sense and be true by default * On unix do not reload process inside debug_step - avoids infinite loops in scripts and traces * Add new !trace level that shows the stack - ^C with trace.sleep = 1 works fine * Make F7 coo step() or stepu() depending on trace.libs changeset: 127:3a69ee9d4925 user: pancake date: Fri Apr 18 04:13:29 2008 -0400 files: src/dbg/arch/mips64.c src/main.h src/print.h description: * Fix print regs last \n * Define is_cursor() which makes radare fool when entering cursor mode changeset: 126:9ac9f475ca9e user: pancake date: Fri Apr 18 00:56:53 2008 +0200 files: src/dbg/arch/mips64.c src/grava.c vala/grava/Makefile vala/grava/graph.vala vala/grava/node.vala description: * Some more buggy stuff for registers on mips * New segfaults has appeared in vala. Nothing fixed :/ changeset: 125:87670c7177a7 user: pancake date: Tue Apr 15 21:43:17 2008 -0400 files: src/arch/arm/gnu/arm-dis.c src/arch/mips/code.c src/arch/mips/mips-opc.c src/dbg/arch/i386.c src/include/opcode/mips.h src/radare.h src/udis.c description: * Set aop->length for mips * Upgrade GNU mips disassembler from CVS - Implements MMX opcodes for Loongson2E/F * Import erg0t's snippet for printing floating point registers - Works, but needs more love. Thanks! changeset: 124:f8b1e7c77a34 user: pancake date: Tue Apr 15 03:55:28 2008 +0200 files: TODO src/cmds.c src/cmds.h src/cons.c src/dbg/arch/i386.c src/dbg/arch/mips64.c src/radare.h src/readline.c description: * Add help to 'e' command with 'e?' - Add 'm' surname to 'e' for 'emenu' - more userfriendly way to manage your configuration - command added into dietline and readline autocompletion - needs more work and integration with flags, breakpoints, etc :) * Move cmd definitions from radare.h to cmds.h changeset: 123:ce099533d8e7 user: pancake date: Tue Apr 15 02:33:00 2008 +0200 files: src/arch/mips/code.c src/dbg/arch/i386.c src/xc.c description: * Fix 'xc' bin to hex conversion O:) * Fixed mips_aop code analysis function - needs testing - uses 0x3f as binary mask for getting the op - needs vm info :) * More unworking testing code for fpregs changeset: 122:e16e8f3d88b5 user: pancake date: Mon Apr 14 15:51:43 2008 -0400 files: src/dbg/arch/mips64-bp.c src/dbg/arch/mips64.c src/dbg/system.c description: * Initial support for breakpoints on mips64 * Add support to read 64 bit floating point registers on mips (!fpregs) - Make fpregs work like .!regs* do * Get program counter from PTRACE_GETREGS - old kernels use PEEKUSER..working by reversing, but works like a charm changeset: 121:19fda009ca08 user: pancake date: Mon Apr 14 04:14:39 2008 +0200 files: TODO src/dbg/arch/i386.c src/dbg/unix/debug.c src/udis.c description: * Some moar buggy get_fpregs stuff * Fixed arch_pc on x86_32 to be 0xffffffff * Nicer "stop at" message * Fix udis '; --' lines in udis() changeset: 120:8f9a6a20b7f7 user: pancake date: Fri Apr 11 03:31:20 2008 +0200 files: src/config.c src/config.h src/dbg/arch/i386.c src/print.c src/visual.c description: * Implement of the normal write method - press 'i' in visual mode like vi does - only FMT_HEXB support - use to switch between hex and ascii changeset: 119:d3ee6500e608 user: pancake date: Wed Apr 09 02:47:57 2008 +0200 files: src/search.c src/utils.c description: * Use radare_controlc() and _end() in search * Make progressbar completely live in stderr changeset: 118:5c5ef6f61cc6 user: pancake date: Wed Apr 09 02:37:01 2008 +0200 files: TODO src/cmds.c src/dbg/arch/i386.c src/dbg/debug.c src/dbg/mem.c src/flags.c src/print.c src/radare.c description: * Fix usage of .! to .!! - Use the old code for pipe_cmd_to_str which makes it work not properly - Hardcode !maps reference to use radare_cmd_str (no system) - Some code has been commented (if everything works fine..i can remove it ;D) * Fix flag name length (last byte was not cleared :O) changeset: 117:624da77804f1 user: pancake date: Tue Apr 08 05:08:00 2008 -0400 files: src/arch/mips/code.c src/dbg/arch/mips64.c description: * Implemnet color for move opcodes * stb for bps - Also SWI for syscall on mips changeset: 116:e898e4b7c298 user: pancake date: Tue Apr 08 00:35:00 2008 +0200 files: Makefile.acr TODO src/plug/hack/Makefile src/plug/io/ewf.c src/plugin.c src/plugin.h src/readline.c description: * Apply Nibble's patch - Thanks! - Fixes libewf build for the latest snapshot - Fix lua cflags - Fix list of plugins (one missing O:) changeset: 115:f4bd0a90c597 user: pancake date: Tue Apr 08 03:22:27 2008 -0400 files: src/arch/mips/code.c src/config.c src/dbg/arch/arm-bp.c src/dbg/arch/arm.c src/dbg/arch/cpu.h src/dbg/arch/i386-bp.c src/dbg/arch/i386.c src/dbg/arch/mips.h src/dbg/arch/mips64-bp.c src/dbg/arch/mips64.c src/dbg/arch/x86_64-bp.c src/dbg/debug.c src/dbg/os.h src/dbg/regs.h src/dbg/unix/debug.c src/dbg/win32/debug.c src/dietline.c description: * Initial pseudo-working implementation of debugger for mips - detect ret and nop - set asm.arch = mips if __mips__ defined - register list is buggy - only stack pointer seems to be ok (?) - only for color mode atm - make all empty functions in mips return null - there's no STEP for mips :O - check if debug_os_steps() is -1 - get_entrypoint is working properly * Some minor refactoring and fixups - debug_steps is now called debug_os_steps - check if mask != NULL in x86, arm and mips * Fix a dl_buffer_idx <0 bug changeset: 114:fb81cfdf47e5 user: pancake date: Fri Apr 04 19:50:10 2008 +0200 files: src/cmds.c src/radare.c src/radare.h description: * Enhacements to radare_resize - 'r' command now accepts negative values for stripping bytes from the current seek. (ex: r -20 will remove 20 bytes and truncate the file 20 bytes smaller) - Make the 'r' command help appear changeset: 113:7542aa03101a user: a@localhost date: Fri Apr 04 21:37:39 2008 -0400 files: TODO src/dbg/arch/arch.h src/dbg/arch/arm.c src/dbg/arch/mips64-bp.c src/dbg/arch/mips64-hack.c src/dbg/arch/mips64.c src/dbg/debug.h src/dbg/regs.h src/dbg/unix/debug.c src/plugin.c description: * Initial non-working implementation of radare debugger for mips64 - builds everything - crashes unexpectedly :? - needs moar love changeset: 112:050df1ea0f96 user: a@localhost date: Fri Apr 04 17:54:23 2008 -0400 files: src/dbg/arch/arch.h src/dbg/debug.h src/visual.c description: * Fix build for --without-debugger when no debugger is available for this architecture changeset: 111:a57bb91dfc81 user: pancake date: Fri Apr 04 03:13:08 2008 +0200 files: TODO src/cmds.c src/config.c src/hack.c src/io.c src/main.c src/plug/io/ewf.c src/plug/io/socket.c src/plugin.c src/radare.c src/search.c src/visual.c description: * Add initial support for file.insert - roadmap and ideas in TODO * Rename cfg.write to file.write * Fix the call to cmd.hit - fixes the seek problem changeset: 110:2bd36ffcf50d user: pancake date: Fri Apr 04 01:54:35 2008 +0200 files: Makefile.acr config.mk.acr doc/fortunes src/Makefile.acr src/cons.c src/dietline.c src/objects.mk src/plug/io/winedbg.c src/plugin.c src/plugin.h src/radare.c description: * Dietline enhacements - add key ^L for clearing screen - fixed cursor position while using ^W * Some fixups for winedbg plugin - It is demonstrated to be problematic and buggy - It is because wine is not a real windows and debugging protections can easily become a mess * Make --without-vala configure flag take sense * Fix a internal bug while changing block size changeset: 109:43526b4b20cc user: pancake@flubox date: Tue Apr 01 13:21:08 2008 +0200 files: Makefile.acr src/Makefile.acr src/arch/csr/dis.h src/binparse.c src/binparse.h vala/grava/Makefile description: * Fix build for ubuntu changeset: 108:92d0a3554ddb user: pancake date: Fri Mar 28 05:13:55 2008 +0100 files: doc/csr src/analyze.c src/arch/csr/code.c src/arch/csr/dis.c src/arch/csr/dis.h src/binparse.c src/code.h src/objects.mk src/rabin.c src/udis.c description: * Initial import of the csr asm architecture - Implement code analyzer - Import code disassembler from Sobos changeset: 107:5c44bd72a913 user: pancake date: Wed Mar 26 04:00:06 2008 +0100 files: Makefile.acr src/config.c src/cons.c src/dietline.c src/hasher/entropy.c src/hasher/hash.h src/hist.c src/print.c src/radare.c description: * Fix build of grava stuff /oops/ * Implement dietline history save/load from ~/.radare_history - Do not log 'q' command * Add some initial dietline autocompletion stuff in cons.c * Never fill the history array (needs to be a cyclic buffer * Fix segmentation with eval zoom.byte=entropy && pO - missing hash.h include in print.c changeset: 106:61fb567c4534 user: pancake date: Mon Mar 24 03:33:14 2008 +0100 files: TODO doc/xtra/realtime libexec/symcalls src/analyze.c src/cmds.c src/config.c src/io.c src/print.c src/print.h src/radare.c src/rdb/main.c src/search.c src/utils.c src/utils.h src/visual.c src/w32utils.c description: * Add linux realtime events xtra documentation (gdb stuff) * Add 'rsc symcalls' to find which symbols of a binary are not called directly - Doesn't supports callbacks yet. * Some code cleanup and refactoring - Remove mode flag from print_t (MD_BLOCK , ...) - add cfg.inverse to inverse dumps - lot of simplification * Move OpenBSD's getopt() implementation to w32utils * Make pR be buffered * Make pipe_stdout_to_tmp_file() and pipe_command_to_string() be cleaner - Fixes some problems changeset: 105:4f03fce66d05 user: pancake date: Sun Mar 23 23:13:33 2008 +0100 files: gui/Makefile libusbsniff/Makefile src/Makefile.acr src/analyze.c src/arch/arm/aasm/Makefile src/bdiff/Makefile src/code.h src/config.h src/dbg/unix/debug.c src/dbg/win32/debug.c src/dbg/win32/signal.c src/hasher/Makefile src/plug/hack/Makefile src/rabin/Makefile src/rasm/Makefile src/rdb/Makefile src/udis.c src/w32utils.c vala/grava/Makefile description: * Lot of makefile fixups (faster rebuilds) * Remove code_lines_print2 * Refix build for mingw (debugger segfaults :/) (psapi related?) changeset: 104:1607a42d8a59 user: pancake date: Sun Mar 23 19:30:13 2008 +0100 files: TODO src/analyze.c src/arch/arm/code.c src/arch/arm/disarm.c src/arch/mips/code.c src/arch/ppc/code.c src/arch/x86/code.c src/cmds.c src/config.c src/config.h src/cons.c src/dbg/arch/arch.h src/dbg/arch/arm-bp.c src/dbg/arch/i386-bp.c src/dbg/arch/i386-hack.c src/dbg/arch/i386.c src/dbg/arch/x86_64-bp.c src/dbg/close.c src/dbg/debug.c src/dbg/debug.h src/dbg/events.c src/dbg/libps2fd.h src/dbg/mem.c src/dbg/regs.h src/dbg/signal.h src/dbg/thread.c src/dbg/thread.h src/dbg/win32/debug.c src/dbg/win32/signal.c src/dbg/win32/utils.c src/flags.c src/flags.h src/main.h src/plug/io/gdbx.c src/plug/io/gxemul.c src/plug/io/haret.c src/plug/io/socket.c src/plug/io/winedbg.c src/plugin.h src/radare.c src/rasm/rasm.h src/socket.c src/udis.c src/visual.c src/w32utils.c description: * Import th0rpe set of patches to fix build with cygwin - Fixes the load of psapi.dll * Add _sockread_last overwritting flag to socket plugin - Use 'eval flag.follow = _sockread_last' to always read the last packet - This flag can also be used by scripting * Fix help message of 'w' command in default help * Fix console lines weirdness - Needs to be cleaned up. but now it works - Three disassembly heights: - no limits - from the shell - full screen - visual disassembly - not full screen - visual debugger * Static-ize and minor cleanup of the arm code analyzer changeset: 103:d467bb356184 user: pancake date: Fri Mar 21 16:16:17 2008 +0100 files: src/Makefile.acr src/arch/arm/gnu/dis-asm.h src/arch/arm/gnudisarm.c src/config.c src/dbg/libps2fd.h src/dbg/os.h src/dbg/regs.h src/include/bfdlink.h src/include/dis-asm.h src/include/libiberty.h src/main.h src/radare.c src/socket.c src/udis.c src/visual.c description: * Fix build for mingw32 - Fix regs.h - Fix socket.c build (no select() support) * Static-ize config variable callbacks * dbg.dwarf replaces dbg.reference * asm.dwarf removed (too heavy!) changeset: 102:7ae16995ef8e user: pancake date: Fri Mar 21 08:22:17 2008 +0100 files: TODO src/config.c src/flags.c src/radare.c src/visual.c description: * Finally fix the 'f' and 'F' keys in visual mode * Implement cfg.vbsize and cfg.vbsize_enabled - Make the current block to be dinamic depending of a maximum distance defined by cfg.vbsize to find a near flag. - This way its easy to read data streams or debug protocols * Fix 'f -xxx' command . Big Oops changeset: 101:1fc98f56af3c user: pancake date: Fri Mar 21 07:10:59 2008 +0100 files: TODO configure configure.acr src/cmds.c src/hist.c src/plug/hack/Makefile src/plug/hack/lua.c src/plug/hack/radare.lua src/plugin.c src/radare.c src/udis.c src/visual.c description: * Forced vala >= 0.1.7 requirement * Fix dl_hist_add call * Up to python 2.5 (Thanks anonymous bugtracker!) * Add report debugging when loading radare.lua - Use luaL_loadfile * Fix radare.lua (big oops) * Fix data size when using 'd' key in visual changeset: 100:aa60a2725450 user: warnaton date: Fri Mar 21 05:43:58 2008 +0000 files: TODO doc/fortunes libusbsniff/libusbsniff.c src/analyze.c src/arch/arm/code.c src/arch/arm/disarm.c src/arch/arm/gnu/dis-asm.h src/arch/arm/gnudisarm.c src/arch/java/code.c src/arch/java/javasm.c src/arch/m68k/m68k_disasm.c src/arch/mips/code.c src/arch/mips/gnudismips.c src/arch/mips/mips-dis.c src/arch/ppc/code.c src/arch/x86/code.c src/bdiff/bdiff.cpp src/cmds.c src/code.h src/config.c src/dbg/Makefile src/dbg/arch/arch.h src/dbg/arch/i386-bp.c src/dbg/arch/i386.c src/dbg/arch/i386.h src/dbg/debug.c src/dbg/debug.h src/dbg/events.c src/dbg/events.h src/dbg/libps2fd.h src/dbg/mem.c src/dbg/mem.h src/dbg/parser.c src/dbg/parser.h src/dbg/procs.c src/dbg/regs.h src/dbg/signal.h src/dbg/system.c src/dbg/thread.c src/dbg/thread.h src/dbg/unix/debug.c src/dbg/unix/fd.c src/dbg/unix/procs.h src/dbg/wp.h src/dietline.c src/flags.c src/flags.h src/grava.c src/hack.c src/hasher/crc16.c src/hasher/crc16.h src/hasher/crc32.c src/hasher/crca.c src/hasher/entropy.c src/hasher/hamdist.c src/hasher/hash.c src/hasher/hash.h src/hasher/hasher.c src/include/dietline.h src/io.c src/lsbstego.c src/objects.mk src/plug/hack/lua.c src/plug/io/gdbx.c src/plug/io/gxemul.c src/plug/io/haret.c src/plug/io/socket.c src/plug/io/winedbg.c src/plugin.c src/plugin.h src/print.c src/print.h src/project.c src/rabin.c src/rabin/rabin.c src/radare.c src/radare.h src/rasm/Makefile src/rasm/arm.c src/rasm/java.c src/rasm/main.c src/rasm/ppc.c src/rasm/rasm.c src/rasm/rasm.h src/rasm/x86.c src/rdb/main.c src/rdb/rdb.c src/rdb/rdb.h src/rdb/rdbdiff.c src/readline.c src/socket.c src/socket.h src/trace.c src/udis.c src/utils.c src/utils.h src/visual.c vala/grava/Makefile vala/grava/widget.vala description: * WARNATON! - 3 guys nonstop hacking night fixing warnings - Lot of bugs fixed (mostly unexpected segfaults) - Do not exit when cannot open grava window (gtk_init_check) - Add mips/code.c (oops) - Some code refactoring - Popularize u8, u16, u32, u64 and addr_t (aka u64) - Drop runtime debugging messages - Centralize hasher stuff in hasher/hash.h * Add rasm support to compile from files (-f flag) - Add support for directives and comments - ';' char comment separator - .org, .zero, ... * Import bitcarrier changes to socket.c and socket.h * Make rabin -a identify ELF and PE x86 and ARM architectures * Initial import of socket io plugin to open socket connections as streams (always growing file) changeset: 99:ab5310e164ff user: pancake date: Wed Mar 19 05:30:21 2008 +0100 files: src/Makefile.acr src/objects.mk vala/Makefile vala/api/core.vala vala/api/io.vala vala/api/plugin.vala vala/list.vala vala/main.vala vala/shell.vala vala/term.vala vala/terminal.vala vala/window.vala description: * Fix build of Vala GUI code in vala/ - New target in src/Makefile called 'gui' to link radare core files against the vala gui ones. * Moar build refactoring stuff changeset: 98:68e09c9290a0 user: pancake date: Wed Mar 19 04:42:31 2008 +0100 files: TODO configure configure.acr libexec/syms-disk src/Makefile.acr src/analyze.c src/arch/arm/gnu/ansidecl.h src/arch/arm/gnu/bfd.h src/arch/arm/gnu/symcat.h src/arch/arm/gnudisarm.c src/arch/mips/gnudismips.c src/arch/mips/mips-dis.c src/arch/mips/mips-opc.c src/arch/mips/mips16-opc.c src/code.h src/dbg/Makefile src/include/ansidecl.h src/include/bfd.h src/include/elf-bfd.h src/include/elf/common.h src/include/elf/external.h src/include/elf/internal.h src/include/elf/mips.h src/include/elf/reloc-macros.h src/include/opcode/mips.h src/include/opintl.h src/include/symcat.h src/include/sysdep.h src/objects.mk src/rabin.c src/udis.c src/utils.h description: * Up to 0.9.5 * Initial import of the GNU mips disassembler - null stub code analyzer - support for little and big endian * Some code refactoring changeset: 97:7f56a33aef69 user: pancake date: Thu Mar 13 21:53:58 2008 +0100 files: .hgtags description: Added tag v094 for changeset ea4711f84f16 === 0.9.4 === changeset: 96:ea4711f84f16 tag: v094 user: pancake date: Thu Mar 13 21:53:33 2008 +0100 files: TODO doc/fortunes src/dbg/mem.c src/print.c src/radare.c src/udis.c src/visual.c description: * 0.9.4 release - codename "prefluendo" * Implements incremental dump/restore of debugged process maps and registers - !dump, !restore with no arguments * Cleaner :po output * Do not show debugged aop.jumps on x86 * Support to remove comments key ';' (and input a null comment) - Removes the first comment for this position - Allows comment cycling changeset: 95:b5ea7ba3d2d1 user: pancake date: Thu Mar 13 04:45:28 2008 +0100 files: TODO gui/gradare.desktop libexec/list src/analyze.c src/config.c src/dbg/debug.c src/radare.c src/udis.c src/visual.c description: * Add scr.accel - scrolling acceleration PoC - Timming stuff is buggy * Major cleanup of the 0.9.4 todo * Add maemo desktop entry * Colorize selected line in rsc list (inverse colors) * Show decimal value for small values in pA * Add help for !signal command * Add dbg.reference to show the source line when debugging - True by default * Show comments before folders (FIXBUG) * Fix open/close folder stuff * asm.cmtmargin defaults to 27 changeset: 94:6560972ae2a2 user: pancake date: Thu Mar 13 01:50:56 2008 +0100 files: gui/main.c gui/prefs.c libexec/Makefile libexec/list src/Makefile.acr src/config.c src/print.c src/print.h src/visual.c description: * Initial port of the gui for maemo and hildon * Add rsc script 'list' - Implements the gdb 'list' command in perl - Supports LISTPATH environvar to find files * Add print format 'pR' -> print Reference - calls rsc list `add2line $HERE` * Add scr.seek eval to follow eip or wathever in a view different than FMT_VISUAL (debugger view) changeset: 93:21f00c276bab user: pancake date: Wed Mar 12 22:23:14 2008 +0100 files: TODO src/analyze.c src/dbg/arch/i386-bp.c src/dbg/debug.c src/dbg/libps2fd.h src/dbg/win32/debug.c src/flags.c src/flags.h src/udis.c src/visual.c description: * Fixed ancient bug in flag removal code (makes sometimes the debugger crash) * Avoid dupped nulls in pA command * Fix DRX breakpoints removal * Fix "breakpoint" flag set/remove with F2 key in visual mode - when no breakpoint is possible, shows no flag - Fix bphw -> bpsw transition when no more bphw available - Some minor bugs needs to be fixed - Up max bps to 128 * Load psapi.dll (should fix w32 maps version) changeset: 92:d4b23422f697 user: pancake date: Tue Mar 11 05:13:35 2008 +0100 files: src/cmds.c src/plug/hack/radare.lua src/radare.c src/radare.h src/udis.c src/visual.c description: * Add fold open/close command to the shell 'Cf' and 'Cu' - Cf - code folder - Cu - code unfolder * Ensure !! is real system(). Fixes arm debugger bug * Supports input with radare shell as prefix. - Now you can copypaste a list of commands from the terminal without having to strip the "[0x........]> " of the beggining :) * Add Radare.Core.iosystem(cmd) in lua api * cons_clear() when opening and closing folders (we are in cursor mode!) changeset: 91:05b2cbe91a8b user: pancake date: Tue Mar 11 04:35:54 2008 +0100 files: TODO src/plug/hack/radare.lua src/radare.h src/udis.c src/visual.c description: * Initial implementation of the code folding feature * Accesible with the '<' and '>' keys in visual-cursor mode * Somewhat buggy and incomplete * Needs interaction with commandline * Add lua api for code attribute manipulation changeset: 90:4960ac747c7c user: pancake date: Mon Mar 10 16:01:00 2008 +0100 files: src/cmds.c src/project.c src/radare.h src/udis.c description: * Add command 'C*' to show all code metadata attributes * Make project take care about code attributes - implemented in project_open/_save changeset: 89:ca10c176accb user: pancake date: Mon Mar 10 04:32:16 2008 +0100 files: libexec/dwarf-lines src/cmds.c src/dbg/debug.c src/grava.c src/radare.h src/udis.c src/visual.c description: * New command 'C' - code related operations - Cd convert N bytes to data - Cs convert N bytes to string - Cc convert N bytes to code - CC adds a comment * Fix grava window management - fix new window usage too changeset: 88:278e94d7e8f3 user: pancake date: Mon Mar 10 03:32:50 2008 +0100 files: TODO src/Makefile.acr src/arch/java/javasm.c src/arch/ppc/code.c src/arch/x86/dislen.c src/arch/x86/udis86/syn-pseudo.c src/bdiff/Makefile src/cmds.c src/dbg/arch/i386.c src/dbg/arch/i386.h src/dbg/debug.c src/dbg/libps2fd.h src/plug/hack/Makefile src/plugin.c src/radare.c src/visual.c vala/grava/renderer.vala description: * Fix linux filedescriptor handling problem - Makes debugger blind - Fixed. Now seems to work clean and fast * Keys '+' and '-' in cursor mode increment and decrement the byte under the cursor. Nice for fast patching and random byte changing :D * Accelerate rebuild process - javasm - plugins - bdiff * Fix some minor bugs - java/powerpc disassemblers fixed - get rid of return values for void funs - Handle lea by syn-pseudo (proper negative value handling) - remove all warnings in i386.c - fix a vala warning (needs more work) changeset: 87:7329ea553012 user: pancake date: Mon Mar 10 01:21:13 2008 +0100 files: TODO src/dbg/win32/debug.c src/dbg/win32/maps.c src/dietline.c src/radare.c description: * Fix psapi symbols loading in init_maps for w32 * Fix console height for w32 changeset: 86:995f1b137ae5 user: pancake date: Sat Mar 08 14:29:09 2008 +0100 files: src/arch/arm/gnu/ansidecl.h src/arch/arm/gnu/bfd.h src/arch/arm/gnu/symcat.h description: * Add some missing files to fix build of the GNU arm disassembler on mingw changeset: 85:86cb5e0f01dd user: pancake date: Sat Mar 08 14:28:27 2008 +0100 files: src/arch/arm/gnudisarm.c src/dbg/mem.c src/dbg/os.h src/dbg/unix/debug.c src/dbg/win32/debug.c src/dbg/win32/utils.c src/plugin.c src/socket.c src/w32utils.c description: * Import of the w32/cygwin patches from th0rpe - Fixes attach. - Implements detach - Gadix maps code fixed and integrated into the debugger core - Fixes build on cygwin (mingw32 problem appeared) changeset: 84:23ad35845bda user: pancake date: Fri Mar 07 18:20:06 2008 +0100 files: TODO src/cmds.c src/dbg/close.c src/dietline.c src/project.c src/radare.c description: * Add project_close() called by radare_close - Asks for confirmation to save the current project - store asm.arch and cfg.endian too - fix project file header - show file.project with 'i' command * Fix '|' and '>' pipes in the shell - They stay broken some commits ago :( - Now everything looks to be fine again * Fixups for the dietline - fixed the ^W key (now works exactly like readline does) changeset: 83:721867d506bb user: pancake date: Fri Mar 07 15:51:55 2008 +0100 files: TODO src/arch/arm/code.c src/arch/arm/gnudisarm.c src/udis.c description: * More fixups for the arm disassembler - Unknown instructions by default - fix arm16->arm problem * Make the code analysis be synced with jump table changeset: 82:f7cf0452646e user: pancake date: Fri Mar 07 03:34:08 2008 +0100 files: TODO configure configure.acr src/Makefile.acr src/cmds.c src/dbg/arch/arm.c src/dietline.c src/visual.c description: * Check for vala 0.1.7 instead of 0.1.6 in configure.acr * Fix history cursor position for dietline * Using dietline with ':' visual mode key':' command. changeset: 81:5114335f1786 user: pancake date: Mon Mar 03 16:30:06 2008 +0100 files: TODO src/arch/arm/code.c src/arch/arm/gnu/arm-dis.c src/arch/arm/gnu/dis-asm.h src/arch/arm/gnudisarm.c src/cons.c src/dbg/arch/arm.c src/plug/io/gdbx.c src/print.c src/radare.c src/udis.c src/utils.h vala/grava/widget.vala description: * Initial import of the qemu-eabi-arm libopcodes based disassembler - Fixes the current buggy arm disassembler - Support for endian in thumb and normal mode * Add support for asm.arch = arm16 (THUMB MODE) - No thumb code analysis yet * Enhacements for the gdbx plugin - Supports setting breakpoints, step and running - read memory supported - .!regs* is too slow atm * Fix 'pf' command (print floating point numbers) * Fix menu.popup() call for vala 0.1.7 (REQUIRED TO BUILD) changeset: 80:c2c8d7446253 user: pancake date: Thu Feb 28 18:26:38 2008 +0100 files: TODO src/Makefile.acr src/main.c src/plug/hack/Makefile src/plug/hack/lua.c src/plug/hack/radare.lua src/plug/io/gdbx.c src/plugin.c src/plugin.h src/radare.c src/search.c src/utils.c description: * Allow to run lua scripts in batch mode with -i foo.lua * Fix lua api load ($libdir/radare/radare.lua * Add more experimental api namespaces - Radare.Search - Radare.Config - Radare.Hash * Initial import of the gdbx io plugin (ala winedbg one) using tm and sockets for communicating to a running gdb. * Do not alter verbose in cmd_str() * Show progressbar for stderr, fix screen width changeset: 79:74901d1ae3d2 user: pancake date: Wed Feb 27 18:57:52 2008 +0100 files: Makefile.acr TODO src/plug/hack/Makefile src/plug/hack/lua.c src/plug/hack/radare.lua src/plug/io/winedbg.c src/radare.c src/visual.c description: * Fixes for winedbg plugin - Read from memory is now memory-aligned (disassembly is now ok) - Debugger is now usable (a bit slow) - Lot of new commands implemented (!maps, !th, !set, !cont, !step, !pids, !bt) * Show help for 'y?' command - Use eprintf in yank code - fix scrbuf usage in radare_cmd_str * Fix lua API installation changeset: 78:8f54abcaf862 user: pancake date: Wed Feb 27 17:56:03 2008 +0100 files: TODO src/dbg/thread.c src/dbg/win32/debug.c src/hack.c src/plug/hack/Makefile src/plug/hack/lua.c src/plug/hack/python.c src/plug/hack/radare.lua src/plug/io/winedbg.c src/radare.c src/visual.c src/w32utils.c description: * Initial import of the lua scripting interface * Build and install ($prefix/lib/radare/) * Mostly usable via Radare.cmd() function * Accessible via "H lua" radare command * Implement radare.lua file to initialize the radare api interface * ATM it only uses r.cmd() and text parsing functions on the given output * Basic support for Hexeditor and Debugger APIs implemented * Import th0rpe fixups for w32 debugger * Implement !bp and !cont in winedbg:L// plugin * Fix radare_cmd_str() using scr.buf changeset: 77:492ce92f4cf5 user: pancake date: Tue Feb 26 01:38:15 2008 +0100 files: TODO gui/grsc/Debugger/ContinueUserCode gui/grsc/Visual/toggle-zoom src/arch/ppc/code.c src/arch/x86/code.c src/code.h src/config.c src/radare.c src/socket.c src/udis.c src/visual.c src/w32utils.c description: * Initial support to define data types inside the disasembly view - Hooked to the 'd' key in visual mode c - code d - data bytes s - string - Supports hexpairs bytes, strings, and disassembly - Portable for all disassmblies - in a near future will support other mixed architectures - Needs a more fine-grained storage - Needs to be saved/opened in projects * Add toggle-zoom and ContinuelUserCode commands for gui * Pseudo-fix comments output in disassembly * Some fixups on all code analysis - Needs more love * Add asm.splitall (split all possible end of blocks or only rets) - Set asm.split to true by default * Colorize disassembly - makes ppc, java and intel at&t disassemblies happy - help me to debug better the code analysis modules * Refactor of TODO changeset: 76:844d1f03ccc6 user: pancake date: Mon Feb 25 19:58:30 2008 +0100 files: TODO doc/fortunes gui/grsc/Visual/toggle-color gui/grsc/Visual/toggle-cursor gui/menubar.c src/cmds.c src/config.c src/plug/io/debug.c src/radare.c src/rasm/arm.c src/rasm/main.c description: * Minor fixups on lot of places - rasm now handles arm nop properly - rasm -e works fine now * file.identify renamed to file.id * Fix cfg.write config callback (oops) * Reset block size if equal to 0 and reopen (nice for gui) * New commands Visual/toggle-color and Visual/toggle-cursor for gradare * Moar fortunes! changeset: 75:600660aa6932 user: pancake date: Mon Feb 25 18:44:49 2008 +0100 files: TODO src/analyze.c src/arch/java/javasm.c src/bdiff/bdiff.cpp src/cmds.c src/flags.c src/print.c src/print.h src/rabin.c src/radare.c src/udis.c description: * Method, field and string resolving for the java disassembler - Major class format parsing done - no segfaults now * Load class information with -e file.identify=true and opening a .class * Some fixups on the radare_analyze code - Avoid excessive recursive walks * Nicer radare_compare output changeset: 74:34df1dc0a288 user: pancake date: Mon Feb 25 04:05:14 2008 +0100 files: Makefile.acr doc/fortunes src/Makefile.acr src/bdiff/Makefile src/bdiff/bdiff.cpp src/bdiff/bdiff.h description: * Initial import of bdiff (Thanks erg0t!) - Some modifications on the output of the program - Show final report with change statistics - integrated with build and install * Add some new fortunes changeset: 73:e99bf39ef656 user: pancake date: Mon Feb 25 03:38:15 2008 +0100 files: TODO gui/actions.c gui/grsc/Disassembly/syntax-att gui/grsc/Disassembly/syntax-intel gui/grsc/Disassembly/syntax-pseudo gui/main.c gui/main.h gui/menubar.c gui/prefs.c gui/sidebar.c gui/toolbar.c src/visual.c description: * Lot of fixups for gradare - combo for print modes and asm.arch now are working! - initial preferences window with some working buttons - Add open/save project menu entries (not yet working) - Add working refresh/undo/redo buttons - Refactorize menus - Add code graph button direct menu entry changeset: 72:8480fdc96b3b user: pancake date: Mon Feb 25 01:46:15 2008 +0100 files: TODO src/arch/m68k/m68k_disasm.c src/arch/x86/udis86/opcmap.c src/arch/x86/udis86/syn-pseudo.c src/cmds.c src/config.c src/dbg/libps2fd.h src/dietline.c src/flags.c src/flags.h src/hist.c src/main.c src/plug/hack/hello.c src/plug/hack/lua.c src/plug/hack/python.c src/plug/hack/radare.lua src/print.c src/print.h src/project.c src/radare.c src/rasm/x86.c src/readline.c src/search.c src/stripstr.c src/udis.c src/utils.c src/visual.c description: * Completely port flag stuff to list.h - Add 'fr' command to rename flags > fr foo bar > fr hit0* search_hits_lib - should fix segfault problem on w32 * pm 'B' (byte buffer) support * Show flag name in search results * More comment free * Add some lua snippets and ideas.. changeset: 71:ebfa11cd07c1 user: pancake date: Tue Feb 19 05:48:13 2008 +0100 files: TODO debian.sh dist/debian.sh dist/maemo/Makefile dist/maemo/deb_hand.mak dist/maemo/description.txt src/dbg/arch/arm.c src/dbg/arch/arm.h src/dbg/debug.h src/dbg/libps2fd.h src/dbg/os.h description: * Upgrade development version to 0.9.4 * Fixups for building on/for ARM - Some minor warning cleanup * New directory dist/ to place all distribution stuff changeset: 70:cca00aea31b1 user: pancake date: Tue Feb 19 01:00:59 2008 +0100 files: ChangeLog Makefile.acr README configure configure.acr vala/grava/Makefile description: * Up to 0.9.4 - Update ChangeLog * Add 'ball' make target (needs testing) ---- 0.9.3 release ------------------------ changeset: 69:db71dc4f0960 tag: tip user: pancake date: Mon Feb 18 23:42:31 2008 +0100 * 0.9.3 release - Remove stripstr -S flag from the commandline (nosense) - Noted in fortunes changeset: 68:a5507801c32e user: pancake date: Mon Feb 18 23:18:25 2008 +0100 * Fix build for w32 - random() -> rand(), srandom() -> srand() - DATADIR cannot be defined before windows.h * Fix inc up/down scroll in hexdumps for even columns changeset: 67:70503ca83586 user: pancake date: Mon Feb 18 22:35:40 2008 +0100 * Initial import of the fortunes command (fo) - New file: doc/fortunes - Disabled with eval cfg.fortunes = false * Add some dex fileformat docu * Prettify the ';--' split lines * Add slurp() in utils. * Fix undo_push in visual out of debugger changeset: 66:a4217b13df6f user: pancake date: Mon Feb 18 18:27:48 2008 +0100 * Fix two problematic code analysis bugs for x86 - Add AOP_TYPE_PUSH and UPUSH support for x86 - handle references in disassembly and show flags of pushed addresses * Moar fixups on the graph view - Add a buggy text area with command output sausage - New edge rendering - Fixes some segfaults * Fix udis printing long flags on the flag column changeset: 65:d6b990ead7b7 user: pancake date: Mon Feb 18 15:25:34 2008 +0100 * Initial import of dwarf-addr * New eval 'asm.nlines' - less flickering for asm.lines :D * Add cmd.asm to execute a command on every opcode - allow to access to $HERE environ * Add asm.dwarf to properly setup cmd.asm * Handle ^C when interpretting commands (^.) changeset: 64:1320787b57db user: pancake date: Mon Feb 18 07:14:33 2008 +0100 * libusbsniff decodes request type now * Fix arm code analyze (jump = 0 are broken jumps) * Add new 'faster and buggy' lines_print algo, for comments * Fix code analysis module for Java (aop->length not set) * Initial toying support for the DEX format to rabin (Android binaries) * Major code cleanup for udis. It needs more love. - Remove lot of unused/commented code * Grava workaround to kill gtk_main loop when closing a window - Add 'last window' hack * Beutify disasebmly output. Nicer for debugger * 'repeat' command in visual mode have been disabled * Show warning when your linux box have randomize_va_space - But all architectures have been integrated into a single function * New eval flags: - asm.flags - show flags as a column in disassembly (true by default) - asm.flagsline - show flags as comments (old way, disabled by default) changeset: 63:d04f50d6279d user: pancake date: Fri Feb 15 03:35:27 2008 +0100 * Fix deletion of comments - Fix command line parse * Make project code interpret evaluation strings and store file.scrfilter too (in previous commit) changeset: 62:4f25abba0d8a user: pancake date: Fri Feb 15 03:28:48 2008 +0100 * Add new keys in visual mode ',' and '.' - ',' marks current cursor position - if marks twice the same address the mark is set to 0 - '.' key seeks to the mark - if mark not set jumps to flag "eip" - show 'mark' in visual prompt * Add buggy metadata comment deletion function - enhace 'C' command with help message and '-' prefix deletion changeset: 61:5c56c2a5ed3a user: pancake date: Wed Feb 13 16:26:26 2008 +0100 * add file.scrfilter= * replaces strings when flushing characters on screen - really nice for the disassembler - import the substr function from GNU bash changeset: 60:83e2db5be567 user: pancake date: Wed Feb 13 06:37:57 2008 +0100 * Do not seek to eip in the debugger. Just act as in asm.follow - (done in previous commit) * Cleanup and optimize the color byte and cursor stuff (needs more love) * Do not lock the cursor when scrolling in disassembly - Show a star before the bytes to emulate a cursor - cleaner to read, and makes the asm.bytes=0 with cursor nicer * Add zoom.byte=FF...counts the number of 0xFF...maybe will be better to make the hex value selectable with 0xNN or so changeset: 59:516f2cd6cc26 user: pancake date: Wed Feb 13 06:02:42 2008 +0100 * Add udis_jump() - shows a number between 1 and 9 - these numbers are hooked to perform a seek with a single key - old seek is stacked, so you can use 'u' key to go back * Fix integer overflow in off_t -> u64 port - negative offsets are absolutely useless * new function flag_get_addr() (returns offset of a flag by name) * asm.trace to false by default changeset: 58:705908cbfb1e user: pancake date: Tue Feb 12 01:21:24 2008 +0100 * Implement client/server unix-socket functions * Check for vala >= 0.1.6 in configure.acr (Thanks esteve for the tip) * Remove perl and python references in configuration stage changeset: 57:7331552b0882 user: pancake date: Tue Feb 12 00:16:07 2008 +0100 * Fix all important warns from valgrind - 'lost bytes' ignored * Add socket_ready(fd,secs) to wait for bytes changeset: 56:9ebd414c88f5 user: pancake date: Mon Feb 11 14:58:37 2008 +0100 * Add support to load plugins from a directory - Install plugins in ${LIBDIR}/radare - dir.plugins points to LIBDIR"/radare" by default * cleanup and todoize flags.c changeset: 55:406b2aa86964 user: pancake date: Mon Feb 11 13:20:37 2008 +0100 * Add 'p%' print percentatge bar (ida-like navigation bar) - atm only marks flags - works in debugger too - hooked in cmd.vprompt * Add doc/xtra/func-frames * Remove '%' command * Fix w32 ansi parsing * Fix chdir to unitialized dir * Fix !pid segfault * use u64 and cons_printf in debugger * Minor wine-hack fixup. uh? * Debugger filesize is set to 0xffffffff by default instead of -1 * Fix '.' command. - Add help message - use cmd_str instead of piped_cmd for .!regs* on w32 (faster) * Make asm.comments work changeset: 54:6bf24f113b72 user: pancake date: Sun Feb 10 23:36:32 2008 +0100 * Also build plugins by default (perl/python+hello) * New eval variable asm.follow - follow in visual-disasembly view a flag > eval asm.follow = eip * Fix plugin callback argument bug * Fix python plugin and some code cleanup - H python - use radare_cmd_str core function - if no filename is given, reads from stdin - shell is ended with '.' or 'quit' changeset: 53:e3251334f850 user: pancake date: Sun Feb 10 17:26:26 2008 +0100 * Fix graph window management (mygrava_close()) - creation/destruction done nicely * Add close button, nice for dwm ;) changeset: 52:1ca2f6cd0fdd user: pancake date: Sun Feb 10 17:03:32 2008 +0100 * Initial extraction of perl and python from the core - Re-implemented as plugins - Needs more love - Build stage must be cleaned up * Make fietline handle terminal columns properly on unix * Make vala build obligatory changeset: 51:fba4e3022335 user: pancake date: Fri Feb 08 19:30:50 2008 +0100 * Oops fix build * Refactor of signals for the Grava widget * Breakpoints should work now :) changeset: 50:bff995e33c5b user: pancake date: Fri Feb 08 19:12:27 2008 +0100 * Make debugging in graph view much more pleasant - More colors for nodes - Colorize nodes with flags (useful to follow eip and so) - Edges drawn at the bottom of the nodes (easy to read) - Use Verdana instead of Courier (scales better) - Allow to manage multiple windows properly - Do not show labels in buttons in the gui (smarter) * Remove graph.window - handled only internally changeset: 49:4f6b36d63b0f user: pancake date: Thu Feb 07 03:44:22 2008 +0100 * Merge of the patches provided by Ben Byer - Fix build and port of core for MacOSX - Initial port of the debugger for MacOSX (does not yet works) changeset: 48:54c3754383d7 user: pancake date: Thu Feb 07 03:22:08 2008 +0100 * Implement radare commands into the entry in graph window - Allows to use the debugger inside the graph window - Typing 'V' we can go back to shell and 'q' to return to graph. * Refactor src/plugins and src/hacks to src/plug/io src/plug/hack * Add graph.window eval variable - opens graph in new window or not * off_t -> u64 fixups in hasher. Make't work nicely on w32 * Recovered from a broken mercurial repo :" changeset: 47:60c652d3be57 user: pancake date: Tue Feb 05 03:46:12 2008 +0100 * Implement the w32 plugin stuff - Properly handle Hack plugins * build debugger by default in configure * Fix get file size problem (32-64 bit bug) * ewf:// should work on w32 now too * u64-ize the io plugins and w32 fixups changeset: 46:e51a9a78c62b user: pancake date: Tue Feb 05 03:16:37 2008 +0100 * Build vala fixup * Complete off_t -> u64 refactoring - maked w32 debugger work again - the .!regs* problem persists. must be fixed before release * Fix grava build and fix stupid segfault changeset: 45:873beb38fa22 user: pancake date: Sat Feb 02 06:35:24 2008 +0100 * Oops. minor fixups changeset: 44:6286561fc40d user: pancake date: Sat Feb 02 06:18:04 2008 +0100 * Yeah! Initial usb-gecko commands working - radare plugin written but not yet integrated - read function needs to take care about the protocol * Wii plugin refactoring - move console files to the proper directory * Add a minimal test program that uses the grecko api to zap the console in freeze and unfrezze state every 2 seconds. - src/plugins/wii/test changeset: 43:8b68c80a38a5 user: pancake date: Sat Feb 02 05:33:40 2008 +0100 * Add more documentation about the Wii and the usb gecko protocol - Most of commands have been reverse enginered + 30 getregs + 13 load + 11 screenshot + 10 set breakpoint (rwx) + 7 continue + 6 stop + 4 read + 3 write - Initial non-working implementation with libusb called 'Grecko' * print command now handles ^C to stop a print processing - Fix the ^C exits radare bug changeset: 42:f51f3ce14ff9 user: pancake <@youterm.com> date: Fri Feb 01 01:22:33 2008 +0100 * New print mode: pm (print memory format string) - Allows to read function arguments in debugger - Allows to parse structures in oneliners - Command per offset will be implemented soon... [0x00000000]> pm? Usage: pm [format] e - temporally swap endian n - perform \n after format b - one byte i - %d integer value (4 byets) q - quadword (8 bytes) x - 0x%08x hexadecimal value z - \0 terminated string Z - \0 terminated wide string s - pointer to string * - next char is pointer . - skip 1 byte * Fox x86/code analisys bug by esteve (short jumps) * Refactor radare_command to radare_cmd, radare_command_raw -> radare_cmd_raw * Store timestamp in traces * Make trace use the trace.dup configuration variable - dups creates new traces when passing two times over the same address - time counter will be increased for all vars if dup is not set * New files: .hgignore, AUTHORS * Add resolver function callback to the hack plugin structure - Add some core function pointers to the core array - Make hello world plugin example use it - Allows to resolve core functions from plugins - Will help to define a better core api - Gtk plugins will come soon too ;) changeset: 41:62dcc9711b2e user: pancake <@youterm.com> date: Thu Jan 31 06:04:28 2008 +0100 * Initial import of the tracing code. facilities to read code :) - Integrated with udis disassembler * Colorize asm.lines arrows green/red depeding if ingoin or outgoing * Show printable char for byte cast intel (udis86) opcode arguments * More use of the radare_controlc inside the debugger * Add key 't' in visual mode to simulate a trace...uh? * Fix stepo ..uh! * Fix zoom hexdump offsets * New eval flags: asm.trace <- toggle visibility of tracing bytes trace.log <- should be renamed to file.traelo? graph.flagblocks <- are flagged addresses blocks too? changeset: 40:c53ffa11f418 user: pancake <@youterm.com> date: Thu Jan 31 03:15:22 2008 +0100 * Implement block_split_new() to properly generate code graphs - Thanks esteve for this random piece of code :) - Splits already analized blocks and correct jumps and block sizes * Keep config.seek after graphing (pG) * Cleanup assembly plugin code changeset: 39:33f90f181fc0 user: pancake date: Wed Jan 30 03:57:36 2008 +0100 * Fix graph edge render issue * Support different color for node titles dependng on the num of calls per block * Some minor changes for w32 (does not fixes the build) changeset: 38:422e89efd151 user: pancake date: Wed Jan 30 02:51:16 2008 +0100 * Faster access to flags * Fix build of hack plugin without debugger * Remove /debug/ sleep() in w32 debugger changeset: 37:2fd6a9e27c57 user: pancake date: Wed Jan 30 02:25:53 2008 +0100 * Initial working of the hack plugins with '-l' flag - plugin_registry autodetects hack plugins - add two example plugins for it written in C and assembly for x86 * Add MrGadix maps implementation for w32 - Not working with wine, needs to be integrated * Shorter help message changeset: 36:e88272684eeb user: pancake <@youterm.com> date: Wed Jan 30 00:47:05 2008 +0100 * Handle ^C on loading and interpreting scripts * Notes and tips for: - debugger port to solaris - memory ranges for the Wii plugin * Dup detach to be sure.. changeset: 35:9d8627046aba user: pancake date: Tue Jan 29 04:15:52 2008 +0100 * Import of elektranox's syscall-flag (perl port of pof's one) * Fix non-color arm register printage * Fix arm get_entrypoint changeset: 34:113b946d4e66 user: pancake date: Tue Jan 29 02:32:04 2008 +0100 * Make radare debugger happy with ARM - Thanks to BitCarrier for the compulab dev.board :) - fix build with scratchbox - asm.arch=arm by default - make breakpoints work and take sense of endianness - beuty print color registers * w32 build is now broken. - Working to support 64 bit offsets changeset: 33:c444a54c43ca user: pancake@bare date: Mon Jan 28 15:32:35 2008 +0100 * Refactor pprintf to cons_printf - Also pstrcat to cons_strcat - ... * Fix w32 build - Fix console input changeset: 32:58d81f02e856 user: pancake@bare date: Mon Jan 28 14:16:25 2008 +0100 * Fix 4 byte overwrite bug. Thanks valgrind :) * Fix cfg.write initialization changeset: 31:d007672d5ba9 user: pancake date: Mon Jan 28 04:24:13 2008 +0100 * Fix build of hasher for native w32 changeset: 30:b84d99602a95 user: pancake date: Mon Jan 28 04:20:32 2008 +0100 * Rename cfg.color to scr.color - Make scr.height be 24 if not detected (serial port or windows console) * Import the patch of esteve to make the graph happy * Add search.flag and search.verbose * Basic implementation of the ANSI colors for the w32 console - Make use of the helper gotoxy/clrscr functions * Some refactoring on the console and search related code - tsearch -> search * Fix nonverbose mode input with dietline changeset: 29:ece269be2546 user: pancake date: Sun Jan 27 14:28:45 2008 +0100 * exp2(x) -> pow(x,2) fix portability issue changeset: 28:19496d9efacf user: pancake date: Sun Jan 27 14:26:50 2008 +0100 * Import of changes done by esteve - New Grava layout. needs more work but at least is readable ;D - Ooops. x86 unknown jump analysis bug fixed - Do not append extra bytes per block - Nodes now store the base address of each block - Nodes graphically sorted by base address - exp2 bug appeared again (must think on..) * Import two helper functions for w32 console (conio like) changeset: 27:8da4d6e18b29 user: pancake date: Sat Jan 26 15:53:28 2008 +0100 * Fix independent dietline.c build * Fix compare command help message changeset: 26:7727b5e42d11 user: pancake date: Sat Jan 26 13:37:59 2008 +0100 * Add 'c' compare command. Works like 'w' - add new function radare_compare() - should be moved to utils and drop the radare name? * Add project.vala in vala/api * Do radare_read when '@'. * Initial working implementation for the !ie command - allows to ignore events from the child > !ie trap ; ignores all traps procuded by the child > !ie alarm ; ignores all sigalarms > !ie ; list all ignored events * Oops missing dietline.c in the previous commit O:) changeset: 25:aea0e2c734c2 user: pancake date: Sat Jan 26 04:51:40 2008 +0100 *new command 030 * Add 'c' compare command * Fixups for the w32 side - no ansi controli in cmd ? - aixo ja ha sigut vici * More work on the hidden-event to work on * Add rRadare.Confg yo manyana me pongo las pilas y a ver :P - Add Radare.Config make vala gui build again * buggy , needs review changeset: 24:8871cdcd4165 user: pancake date: Fri Jan 25 16:39:39 2008 +0100 * Make the threading and pid selection stuff logical - Now it works O:) - !pstree command removed - !pid - list all processes - you can change the current pid (tid) by giving it as arg - !th - list threads - on *nix !th is an alias for !pid * Theorically fixed a problem with w32 process attach - Needs testing * configure: Do not build vala stuff if no gtk found changeset: 23:87705b637437 user: pancake date: Fri Jan 25 01:30:14 2008 +0100 * Fix some ps.pid/ps.tid problems - Use !pstree to list processes - Use !th to list threads and select current pid - needs more work. Too many commands for listing/switching pids.. * Show pid and pid with !info * Notice signal 19 + unknown thread as a new process created (fork) * Fix segfault in print_event * Add 'ie' stub command - I'll implement this tomorrow ;P changeset: 22:26c870ff1664 parent: 20:b50c9466ced5 parent: 21:737cb79d7649 user: pancake date: Thu Jan 24 23:34:39 2008 +0100 * Oops. Merge stupid branch changeset: 21:737cb79d7649 parent: 19:754645ac897b user: pancake <@youterm.com> date: Thu Jan 24 22:29:27 2008 +0100 * Import of the elektranox patch to cleanup make output - Fixes some Makefile "problems" - configure stuff has not been merged - use this command if you want a prettier output: $ gmake VERBOSE=0 * Some more ideas in TODO changeset: 20:b50c9466ced5 user: pancake date: Wed Jan 23 02:50:04 2008 +0100 * Implement zoom.byte = flags (show the number of flags per zoom piece) - "first" zoom.byte rule renamed to "head" * Add an navigation entry bar on the grava window * Fix build of grava in non GNU systems (wtf ? exp2...) changeset: 19:754645ac897b user: pancake <@youterm.com> date: Wed Jan 23 03:39:41 2008 +0100 * Initial port of the debugger to GNU/Linux intel 64 bits - Thanks Gerardo! - More work will follow :) * Add function frame definitions for x86 (ms, gcc), arm, ppc * Add more opcode descriptions in rsc adict: - some arm floating point instructions - basic powerpc instructions changeset: 18:b9c6dcc633a0 user: pancake <@youterm.com> date: Mon Jan 21 14:03:06 2008 +0100 * Implement native raw console read and environ for w32 - All console related stuff moved to cons.c - optimize console performance (less pprintf_flush()) - CLRSCR uses pstrcat - TODO: rename all pprintf* funcs to be prefixed with cons_ * Do not print '---' stuff in verbose dump headers changeset: 17:a7aabab03140 user: pancake date: Mon Jan 21 04:15:19 2008 +0100 * Allow to specify the search id when searching: /10 lib ; search for 'lib' with id 10 /20 bar ; search for 'bar' with id 20 /r 10,20 ; go searach 10 and 20 together * Add /m command - Cleaner /k and /m output * Fix writemem in debugger bug (aaah!) - incrustate erg0t's WriteMem function for evaluation * Really fix the problem of the flag movement in visual * Moar autocompletion and minor build fix changeset: 16:2cc3147cb9b5 user: pancake date: Mon Jan 21 02:58:54 2008 +0100 * More charfilters for dwarf-lines (oops) * Add 'wd' command to write a dword in current arch - in future will use cfg.endian * Remove %SEARCH[n] and %MASK[n] - moved to /k and /m commands: /k[number] [keyword] - adds a new keyword to search for /k - list all keywords - TODO: /m - list all masks /m[number] [keyword] - add binmask for keyword n * Fix w32 and solaris build * Make hack_nop portable * Search flags renamed to hit%d_%d instead of hit%d[%d] - Fixes the problem of indexed pointer access * Prevent from segfaults envvar and get_offset/math * Make movement between flags nicer in visual mode (f,F) - when the number of flags is reduced recalculates the next flag index * Enhaced pointer access for get_math - allows to access to data from the file at a certain position and use it as a numeric value. $ radare /bin/ls > ?[0x18] ; show entrypoint of elf 0x8049790 ; 134518672d ; 1001113620o ; 1001 0000 Now is possible to nest operations inside a pointer access. So you can do things like: > x @ [data+0x20]+10 changeset: 15:17c344b68ebf user: pancake date: Sat Jan 19 17:34:16 2008 +0100 * Fix dwarf-lines to work for the new comment stuff * Add child.stdin/stdout/stderr eval vars - allow to dump to files, or read stdin from a file - i'll add pipes support and more - tm must be integrated here. changeset: 14:acac69cac3bb user: pancake date: Sat Jan 19 16:18:29 2008 +0100 * Add asm.cmtlines to limit the number of comments per address - Thanks esteve for the idea! - very useful when tracing with trace.cmtregs changeset: 13:40a368fd718d user: pancake date: Sat Jan 19 16:08:18 2008 +0100 * Initial import of the !hack inside the core - Accessible with the 'Hack' command - Does not yet works inside the debugger * added radare_(read|write)_at * Add some missing scripts into the libexec install - add make miss check into libexec * Rename dbg.setuid and so to: - child.setuid - child.setgid - child.chdir - child.chroot changeset: 12:8d3492054389 user: pancake date: Sat Jan 19 14:36:23 2008 +0100 * Update flag and syscall-flag from pof * Add missing project.c (oops) changeset: 11:e737b021d53f user: pancake date: Sat Jan 19 06:29:49 2008 +0100 * Fix build and update TODO with freshly ideas zZzzZ changeset: 10:a98535a274e1 user: pancake date: Sat Jan 19 05:49:14 2008 +0100 * Add trace.cmtregs to comment the difference of registers in eip. This way you can stepover a loop and easily understand what does every register. * Add command 'P' to manage radare Projects - With #RP# magic and autocompletion! - Ps ([file]) saves the project - Po ([file]) opens a project - Pi ([file]) information about the project * Add flag -P to the radare to specify a project to open: - This is the same as defining the eval file.project $ radare -P crackme01.rp dbg://./crackme01 * Store all comments in memory - Optimized way to retrieve comments from an address - More optimizations must come * A project is a file containing - flags - comments - debugger environment - some core configuration - .. more in the future * Add asm.cmtmargin - defines the left margin for comments * Moar eval vars: - dbg.setuid - dbg.setgid - dbg.chdir - dbg.chroot changeset: 9:e14be84ece6f user: pancake date: Fri Jan 18 21:49:34 2008 +0100 * Fix build to make pof happy - missing w32utils.c - ignore errors installing libusbsniff changeset: 8:2e7bdb781bfe user: pancake date: Fri Jan 18 03:35:50 2008 +0100 * Fix and adapt code to build natively on w32 - Some terminal handling and similar things are not handled yet - Autodetect mingw32, cygwin and windows directives - proper handle of these variables via configure not environ - add --enable-w32 to enable the native w32 build - adopt hacky unix signals include into w32 build - some parts like mmap (stripstr and so) are not working * Adapt socket.c to the w32 api (wsock32.dll) * Move asm.linesout in analyze_init, cleaner, faster simpler :) * Fix info command printage * Clean make clean * Make everybody be happy with W32 and __WINDOWS__, __UNIX__ * Add build instructions in README changeset: 7:79d64c7912dd user: pancake date: Thu Jan 17 23:51:10 2008 +0100 * Initial import of the Wii plugin using UsbGecko (www.usbgecko.com) - Basic documentation in the README - Add --with-wii configure flag - Add wii specific code to handle flash and usb - Plugin code inherits from the remote one - uses the remote protocol using an EXI communication via USB with the USB Gecko card. - Lot of glue code. Needs cleanup - This code does not builds yet changeset: 6:afcecca2678d user: pancake <@youterm.com> date: Thu Jan 17 22:27:48 2008 +0100 * Lot of new freshly ideas into the TODO * Implement !contuh command (continue until here) - Use F4 in visual for this * Fix build of hasher changeset: 5:47e7f43e5662 user: pancake date: Thu Jan 17 04:20:22 2008 +0100 * Integrate lsbstego print mode as 'pB' * Alphabetically sort all commands * Add pU command again (using cmd.user) * Fix FMT_ASC0 printf->pprintf changeset: 4:8dca37d4f23c user: pancake date: Thu Jan 17 02:01:26 2008 +0100 * Initial import of lsbstego from RoMaNSoFt - Needs integration with the core * New directives: asm.linesout (bool) print lines of jumps out of block cmd.prompt (string) command to be executed before the prompt cmd.vprompt (string) command to be execute after the visual prompt - useful for embedded monitoring file.trace (file) trace file trace.bt (bool) show backtrace when tracing code trace.sleep (int) sleep N seconds after every step (demo mode) trace.smart (bool) show smart output or not * Register oeip flag - useful to track calls and jumps when using cmd.vprompt - Also export oesp - rename eax_orig to oeax * Set cfg.bsize to 100 when debugging instead of 200 * Add zoom.byte = (printable | print) - Shows the percentage of printable chars of every block of the file - useful for fast finding for string sections or so. (~ 0xc8 is text) * New command '!dregs' shows only the registers that has changed since the previous step. - Fix oregs capture * Add 'eval cfg.delta' to define the maximum delta offset to handle for a flag to string_with_offset. Thanks pof for the idea! :D * Add crca.c from Victor Mun~oz - Implemnts different simple crc checksums with variations - Not yet used inside hasher (my needs some refactoring) * Add 'I' modificator to the print command to invert code block - useful to read code or data in stack f.ex > pIx - inverse hexdump > pID - inverse disassembly - 'I' key is hooked into the visual mode to toggle inverse mode * cursor can be moved in visual mode with 'g' and 'G' like vim does * Refactor of the undo command usability - By default shows the help - un[do] command performs an undo - uu a redo - u! or u- removes all undo history - ul or u* shows the list of history seeks - u? shows this help * New command 'wA' write assembly using rsc asm - Fix segfaults when using '`' pipe * Rename command 'Y' to 'yy' (copy (y) / paste (yy) - Same for undo command changeset: 3:84c29f110c30 user: pancake <@youterm.com> date: Tue Jan 15 16:12:46 2008 +0100 * Initial import of syscall-flag by pof - Seems buggy on non-linux systems * Add asm.linestyle for different asm.lines algorithms - Temporally hack * Add asm.nbytes - Show only the bytes you need! (Thanks Gadix for the tip) - 8 instead of 12 by default * Show vala-capable info in radare -V * Add ret0 opcode for x86 (needs to be ported changeset: 2:3119cbcac67e user: pancake@localhost date: Tue Jan 15 04:13:15 2008 +0100 * Add the "dist" command for publishing snapshots changeset: 1:c3e0fe97e507 user: pancake@localhost date: Tue Jan 15 03:39:38 2008 +0100 * Initial implementation of the buffered print (faster console output) - New eval: scr.buf (false by default) - Ease nested command parsing * Drop c code generated by vala (should not exist in the repository) - Fix build of vala stuff * Fix x86 code analysis (invalid size of two byte jumps O:) changeset: 0:e5ae4c510c37 user: pancake@localhost. date: Mon Jan 14 12:03:57 2008 +0100 * Initial import of radare 0.9.3 into teh HG - Latest pvc commit: 14bb6af7 ------ switch to mercurial --------- 0: 14bb6af7 author: pancake@dazo date: 20080114-02:25:58 * Up configure stuff to 0.9.3 1: bdac2a6c author: pancake@dazo date: 20080114-02:20:37 * Oops. missing "gokolu" in make install * Disassembly now can be analyzed in realtime to get an ascii-art lines following the jumps and calls. * More stuff interruptable with ^C * Some x86 code cleanup * New grava layout for testing...needs more love * New config stuff: asm.size = show number of bytes of the opcode asm.lines = show line references for jumps and calls graph.jmpblocks = split blocks by jumps or not ----- version 0.9.2 ------- 2: b50238cf author: pancake@dazo date: 20080112-21:11:48 * 0.9.2 release! * Update to the latest pof's strings--flag rsc scripts * Some minor hidden build fixups * Fix debugger build on netbsd 3: bc9615c1 author: pancake@dazo date: 20080112-06:06:10 * Awesome optimization of the cairo stuff for graphs Featuring: - No flickering! - Less repaints - space and 'u' to (up and down screen) * Tab in grava moves and centers around the graph * Make "Focus" callback work :D * Pan when moving nodes with keyboard * Fix valac related stuff build * Add cmd.bp for command breakpoints 4: 4c3c801a author: pancake@dazo date: 20080111-01:37:58 * Add missing hash.h * Add .c files generated with vala 0.1.6 (one dep less, make w32 build easier!) - add target 'novala' and use it by default * Add more java opcodes into rasm - Add support to 'push reg' * Add support for handling address contained by pointers in memory: > fd @ [0x804d800] ; will read 4 bytes at this address and show label * Better add/remove flagging stuff for breakpoints with F2 - brreakpoints are full of bugs. needs more love * Be toggle_breakpoint functionality * Allow to remove flags by their address * Properly calculate the increment for 'j' (down movement) in udis and so 5: be5dde94 author: pancake@dazo date: 20080110-08:20:36 * Fix rsc asm (-f was not working correctly) * Add timestamp for oregs (code can be reduced) * Flag breakpoints (clear by addr is maybe not working) * Standarize and propagate the use of radare_controlc/end() - Disassembly, searchs, etc.. can be canceled (most long processes) * Setenv KEYWORD for cmd.hit 6: b9ea2cfa author: pancake@dazo date: 20080108-23:30:52 * Integrate rasm into the core. - New 'wa' command to write assembly for x86, ppc, arm, java * Some readline autocompletions added 7: 83974e9b author: pancake@dazo date: 20080108-21:35:31 * Add sha256, sha384, sha512 to hasher - Avoid empty line after -a all * Add some powerpc opcodes for rasm - fix return value handling 8: 2161db7f author: pancake@dazo date: 20080108-03:09:59 * Initial import of rasm: - The radare patch-oriented multi-architecture assembler - complete support for x86 - add basic support for arm, and templates for java and ppc - needs more work. this is just an initial implementation - can be easily integrated with the core (own assembler) * Move posix.o to plugins/ * Fix debian.sh to make happy scratchbox again - Build and release a beta testing 0.9.2b debian package for maemo * Oops strings-pe-flag does not exist * Cleanup of the debugger layer - some minor refactoring - src/dbg/os.h - represents the debugger interface - all plugins has a new debug_t pointer inside its plugin_t structure - this way we can implement new debuggers as plugins * Remove config.x/y . Faster console access (bah!) * Command 'B' deprecated by eval file.baddr * Fix -qv flags weirdness in hasher * Fix Linux-ARM build of the debugger * 9: ec8e29e7 author: pancake@dazo date: 20080107-02:39:44 * Make the graph interactive by using the popup menu - allow to walk between calls - follow work will be an entry text - draw infinite hangs with lace edges * Do not destroy old windows..allows stacked navigation - the gui should go in this direction :) 10: 5a59cf59 author: pancake@dazo date: 20080107-00:11:22 * Remove config.count and use cfg.count eval * Fix ARM code analysis and disassembler - Thanks esteve for the flow analysis (arch_arm_aop) code! - Colorize disassembly and graph 'calls' - show label references in arm branches - fix conditional branches printage - s/\r\n/\n/ in disarm.c 11: f886dc3f author: pancake@dazo date: 20080106-18:22:03 * Make hasher work inside the debugger * Add '-A' and '-a all' to perform all algorithms at a time - Some code cleanup for hasher * Remove dbg.second - Add dbg.vstack 12: a55f3023 author: pancake@dazo date: 20080106-04:47:20 * Fixes for w32 debuger build - Sync with *nix stuff. Dual build passed! - Some code cleanup and so * Some hidden fixups - Make debugger visual show the stack with addresses - Fix flag references for jumps (!!!) 13: 908ce9b1 author: pancake@dazo date: 20080106-04:13:58 * Fixups for the debugger layer on *nix - tested on netbsd and gnu/linux - 32/64 bit bug appeared in erroneous merge - split split argv from string - add plugins/debug.o properly * Lot of warning cleanup and minor bug fixups - More casting - Lot of func definitions in dot hacs - Fix cursor color reset when no color enabled - Needs moar work * Add dbg.tracebt to show backtrace when tracing - The same for cfg.contscbt (continue until syscall) 14: 8a1cc999 author: pancake@dazo date: 20080106-02:15:21 * Merge of the th0rpe w32 debug plugin - Refactoring of the debugger architecture - Tested on cygwin and linux - Needs more work * Some minor changes in graphs 15: 906665f3 author: pancake@dazo date: 20080102-03:34:34 * Initial integration of the powerpc code analysis module - Lot of fixups from the previous version - PowerPC code graphs looks cleaner atm (needs more work) * Fix get_offset (hex with spaces) number parsing (? 0x300 + 0x33 is now ok) * Limit number of lines when disassembling * Make powerpc disassembly handle endianness with cfg.endian * Make javasm know that Mach-O bins also have a 0xcafebabe header * Make zoom factor of the graph more soft * Add bctr and bcctr ppc opcodes to rsc adict * Add strings-pe-flag in make install * Port strings-pe-flag and syms-pe-flag to perl - Much faster. - This reminds me that radare -S must be happy with rabin to find strings only in data sections and so * Add '?' math eval command to '?' help. * Set arch_callback (code analysis) as hook for asm.arch - Also for cfg.color 16: c52bebc7 author: pancake@dazo date: 20080101-17:54:34 * Welcome 2008 :) * PowerPC stuff: - Initial import of the powerpc code analysis (gogo Wii!) - Add 'sc' and 'svc' to rsc adict ( - Endian support for ppc disassembly * Fix bin to hex conversion for XC (big oops) * Fix config.write (old->new) weirdness) * Fix short jump code analysis (addr+2) * Silently fix the -i flag init order bug * Disasembly out of visual mode shows entire code block extended to ARM and ppc 17: 1b32953e author: pancake@dazo date: 20071231-22:00:12 * Make eval cfg.write work with a callback (otf change) * Fix intel 'eb' (short jump) opcode code analysis * Split print_color stuff * Some updates and fixups for the grava - limit smaller zoom - add load_graph_at callback - add const ZOOM_FACTOR - the context menu only popups when a node is selected 18: 2005f9f3 author: pancake@dazo date: 20071231-05:07:08 * Initial import of strings-pe-flag (thx pof) - should be merged with strings-flag... * Silently make all rsc commands to show help to stderr and just show the results (N syms/strings added) * file.identify=false by default * Add file.flag to flag all syms and strings (false by default) * Silently fix the verbose insanity when .! * Colorize graph lines depending on calls or jumps (only x86) - Change some colors - make single clicks on nodes refresh the graph and colorize node border * Make nodes be conscient about the calls found inside - also for xrefs (but not yet implemented) * Initial import of 'rsc flag' command (thx pof again ;) - flags all string and symbols of a binary inside or outside the debugger and jumps to sym_main 19: 2ae1f6f9 author: pancake@dazo date: 20071230-23:31:23 * Initial import of the AES expanded key search algorithm from Victor Muñoz - the poc and snippet was presented at CCC 24c3 Congress at Berlin 2007 - Thanks for the code snippet! Great work! - /a command - should change? - TODO: implement the same for RSA keys * New strhash algorithm without small string collisions - Re-add the core.loop config key 20: d6e851e8 author: pancake@dazo date: 20071230-21:03:04 * Update strings-flag by pof fixing stuff for non-elf files * Initial import of the syms-pe-flag (for PE files) - will be merged with syms-flag in the future * Silently fix a segfault when /x 8383383838 - (no spaces between hexpairs) * Lot of hardcore fixups (CAFFEINE WORKZ) - missing main.h includezz (32-64 problems) - fixes config_set off_t problems (baddr and so :D) - some valgrind fixups * Initial working version of the 'R' command - all graphs are stored in memory - supports listing, removing, graphing and loding from file - support diffing between program_t's * Move all grava stuff to src/grava.c * Export BADDR and ARCH as envvars * Store the program_t entrypoint and split program_new and program_open * Make the disassembly be raw outside the visual mode - allows to dump the whole file 21: d653f73a author: pancake@dazo date: 20071230-07:38:51 * Implement 'fn' command to flag new - useful for rsc strings-flag - adapt the rest of radare to make flag_set receive 3 args * Make print command changes not affect in visual mode * Clean and sort TODO * Some minor code cleanup * Hiddenly import an initial draw of the RDB management command 'R' 22: 15d9a6e6 author: pancake@dazo date: 20071230-06:09:59 * Initial import of the powerpc and m68k disassemblers http://devnull.owl.de/~frank/Disassembler_e.html * The 68k disasembler is buggy and segfaults - have to contact with http://sun.hasenbraten.de/~frank/ - vdasm and so looks really cool :D * Silently add a 'calls' linked list inside the block_t 23: d94d3986 author: pancake@dazo date: 20071230-04:26:15 * Up configure to 0.9.2 O:) * Some fixups of strings-flag by pof * Add graph.offset to show/hide offset of opcodes in graph * Fix graph node output (cleaner to read) * Use dbg.maps, dbg.syms and dbg.strings * Make syms-flag work as strings-flag (nice shot ;) * Fix the cfg.verbose weirdness (make rsc asm work again ..) * Fix graph depth calculation. (lower values for depth will work now) * Add graph.callblocks to choose if you want calls split code blocks or not - ida like graphs ;) - needs more work .. like storing all call offsets into a linked list to be accessible by the gui and so.. * Fix block_split branches (not tested) * Make label be considered when determining the node width * The 'unknown filetype' string is only showed in verbose mode 24: 26fc4a05 author: pancake@dazo date: 20071229-16:33:43 * Updated syms-*flag stuff * Add strings-flag * Add graph.callblocks - Thanks pof for this commit! 25: a65fbfe6 author: pancake@dazo date: 20071228-16:38:32 * Make the gui combo of arch be happy with eval * Lot of warning stuff cleared - thanks ora8! * Clean list.h ... linux does some nasty stuff! * Fix backtrace stuff - integrate the new one. * backtrace configurable via eval.bttype * Add dbg.second .. uhm not tested maybe buggy 26: c3d6832b author: pancake@dazo date: 20071228-02:26:06 * Fix !maps stuff for debugger and pid:// (thx brainstorm for reporting) - needs some work.. hackaton soon! * Fix most of the base address stuff * Colorize interrupts and above/below or equal jumps 27: 4836f6bd author: pancake@dazo date: 20071226-23:12:36 * Clean TODO file * Initial import of the rabin identify inside the core - file.identify = true - jumps to entrypoint, identifies base addres and sets asm.arch - add file.type - some minor fixups for the baddr * Really *hacky* commit. Not for real use ---- version 0.9.1 ---- 0: c0056b87 author: pancake@dazo date: 20071225-23:27:45 * 0.9.1 release * Update changelog * Fix configure --with-vala * Fix gdb --without-debugger build 0: 2897d4d3 author: pancake@dazo date: 20071225-21:32:21 * Make grava widget be happy with keyboard - no need to use the mouse or wheel - now the nodes can be selected and moved with hjkl and arrows - i'll enhace the keyboard accesibility for working with graphs - fix pan speed by using graph.zoom * Fix build of libewf by adapting it to the new config * Code cleanup and syntax indentation for aasm the arm disassembler - i have to contact the author to join efforts - needs more work * Fix java code analysis to work with asm.split - the arm code analysis doesnt works - more x86 unknown jumps handled * Make cfg.endian be happy with udisarm() 1: 2ae86588 author: pancake@bare date: 20071224-04:14:27 * Make the debugger view configurable with dbg.regs, dbg.stack, dbg.stacksize, dbg.stackreg, dbg.bt - line number of disassembly are not yet supported * Move scripting commands (;ones) to eval command - commands are stored inside the 'core.' namespace - asigning a value you can active the callback > eval core.echo = hello world > eval core.cmp = eip, 0x8048458 > eval core.je = 0x8048500 * Better graphing algorithm - Full of nasty hacks - But it have a better dispose for small graphs * Cleaner help message without env stuff * Finally fix the code block length in graphs :DD * Dissasemlby configured with: asm.split : draw split lines after each jump asm.offset : show offset of opcode asm.bytes : show bytes owned by the opcode * Add more unknown jumps into the x86 code analyzer * prefix with 'rabin_' all rabin sauce 2: 03c74d8f author: pancake@bare date: 20071223-22:22:34 * Massive code refactoring to use the new config paradigm - most of radare is now configured via 'eval' command or -e - cleaner code - goto command has been removed in pro to use scr.x and scr.y - lot of environment vars has been deprecated - ':' verbosity ghost has appeared again - disassembly and graphs configurable via eval too * Make readline be happy with eval() for config vars autocompletion - eval strings ended with '.' are considered for listing * Fix the visual rotate views to take avoid dups 3: 7735d328 author: pancake@bare date: 20071223-07:58:28 * Initial import of the new model for the key/value configuration - Accessible with -e - endian command has been removed - eval command has replaced the 'e'! - evaluates a key/value string to change config values - code adaptation to use this new model - needs more work * Show warn message when 'w' in visual mode. * Fix syscall trace printout * 'c' command removed too accessible via 'eval cfg.count=3' * %COLOR and family has been replaced for cfg.color and similar %ARCH asm.arch, %SYNTAX asm.syntax - needs documentation when code finished - creates a tree-like key/value hash for configuration * Fix udis() length disassembly - Let the graphs be happy :D * Moar new commands in readline * Add '-i' to interpret a file * syn-pseudo push too 4: 42afa88e author: pancake@bare date: 20071223-01:58:03 * Make zoom and pan work and be happy with the grava widget - now graphs are fully statically navigable - window is opened at 600x400 by default TODO: next step is to make them interact with the debugger and the core TODO: add a toolbar for the pG command * Make stripstring (-S) functionality happy with concatenated ascii strings foo\0bar\0... * Talk about rabin in README * Reset thread list when reloading a binary * Fix double init environment in radare_open * Fix the loss of -s and -b when loading into the debugger * Make '-x' finally happy in config.mode * Some more readline commands added * Make !fd known about symlinks * Initial import of gokolu - The google code lurker which tries to determine which projects and source files are used into a firmware or binary (for example) * New manpage for rabin - Update all manpages to welcome rabin 5: 7046953a author: pancake@bare date: 20071222-20:29:23 * New backtrace engine. - Can be fooled. - Filters per user code - Show related map section * Show new backtrace in default debugger view in visualcmd * stepu - step over user code only - F7 in visual mode - 's' key performs 'step' * set default block size for debugger to 200 * Add debugger command '!st' (stack analysis) - experimental backtrace implementation * Find flag references on 32 bit mov's in syn-pseudo * Fix grava graphs drag and zoom * TODO: - Add rabin -b to get base address (0x8048000) - Fix -r flag of rabin (output in radare format) 6: 64949555 author: pancake@dazo date: 20071220-04:01:12 * New keybindings for the visual mode: - 'z' : toggles the zoom from/to the whole size or block - will support - 'Z' : resets the information of the zoom structure * Initial import of the 'pO' command * Some more bugs has been closed thanks to pof and elektranox! * Better layout algorithm for Grava - more complete example of a graph generated by C * Autodetect valac, no need to use --with-vala 7: ed638132 author: pancake@dazo date: 20071219-22:27:53 * Move all plugins to src/plugins * Remove libaff2fd plugin * Add intel16/32/64 combobox in GUI * Some new goodies in TODO 8: 05d90ee4 author: pancake@dazo date: 20071219-22:05:44 * Initial import of the gxemul plugin * Some silent fixups for building usb sniffer under *BSD 9: d2fc073b author: pancake@dazo date: 20071218-04:43:27 * More warning cleanup from elektranox work * Fix memory aligned reads with ptrace using patan's ReadMem 10: 69d3df1a author: pancake@dazo date: 20071217-03:00:44 * Initial import of the winedbg:// io plugin - allows to debug w32 programs using winedbg on *nix systems - memory reads are not aligned. some bugs with that - lot of debugger commands are missing, but step and regs * Add rabin into the Makefile build - Rabin now supports PE headers for entrypoint and checksum * Massive warning cleanup Thanks elektranox! - Some bugs have been fixed (mostly spurious segfaults) * Silently fix a segfault in disarm * Silently fix some bugs in src/hist.c 11: f9405ce8 author: pancake@dazo date: 20071216-23:50:53 * Up configure to 0.9.1 * Import of 64bit patches from elektranox * New command "./s *" to flag all strings as str_ 12: d8a79acc author: pancake@dazo date: 20071216-22:55:57 * Initial real support for python-radare _print r.cmd("x") _.entrypoint.py * valgrind fixes for the hist.c storage * Make pw, pW, pQ work properly again print_color_byte casts to byte! - do not colorize these commands 13: 33550dd5 author: pancake@dazo date: 20071214-04:36:45 * Initial import of the 0.8.8 w32 installation scripts - Not yet working for 0.9.1. 14: 5744258f author: pancake@dazo date: 20071214-04:18:31 * Major makefile cleanup. - Centralize most static stuff to config.mk.acr - Remove lot of Makefile.acr * Add colorization for intel syntax - TODO: also for att * Fix posix on cygwin to support 64 offsets. - Not yet tested ---- version 0.9 ---- 0: 17bd6666 author: pancake@dazo date: 20071212-22:56:35 * radare 0.9 released - Fix double free in vala/grava - Minor hidden fixups in print and ewf - Silently update Changelog and sync with old git repo 1: b85db356 author: pancake@pluna date: 20071213-00:04:23 * Lot of code cleanup - Fix build on NetBSD - Remove lot of warnings - Some bugs fixed by removing warnings * Needs more love 2: ffb0ef03 author: pancake@dazo date: 20071212-02:02:21 * Initial support for els:// URIs for libewf to open splitted ewf images (.E01,.E02,..) - So just type: ls *.E* > list.els * Fix flag-offset-printf in visual mode - Fix flag-offset fixup to work everywhere, not onl dbg 3: bbce2489 author: pancake@dazo date: 20071210-21:54:16 * Initial import of the libewf plugin - support to open EnCase(R) forensic disk images in read/readwrite mode - add proper checks in configure.acr - show header information like case number, stored hash, etc.. * Some hidden changes for rabin and arm 4: ca37b89a author: pancake@dazo date: 20071210-02:28:31 * Initial import of rabin (radare binary header helper) - understands ELF format - show imports, exports, entrypoints, sections, etc.. * Initial import of dosdebug snip.. 5: b8008bb1 author: pancake@dazo date: 20071209-11:25:07 * Initial port of the debugger layer for x86-64 - It builds and steps. but not much more * Add %ARCH intel16, intel32 and intel64 keywords * Add some fpu goodness (show x87 regs) - more opcodes in 'rsc adict' (assembly dictionary) * Minor code cleanup in dbg/system 6: be449ba2 author: pancake@dazo date: 20071206-05:33:48 * Macroize the plugin.c code. * Fix minor nasm related bug 7: 595caad1 author: pancake@dazo date: 20071206-02:20:11 * Initial implementation of the 'pG' command - Opens a Gtk Window using the Grava Vala API - Add zoom and rotate support to Grava.Widget - Works from the debugger or a file - Colorizing nodes seems to segfault sometimes, disabled atm. - Hook 'mouse wheel' to zoom into the graph * Initial import of the Grava api - Add --with-vala ./configure flag - enabled pG command * Initial import of the HISTORY file * syn-pseudo.c : make 'ret' be 'ret' and not just a set of dashes - Cleaner udis() output for Grava * New stuff to think in TODO... * Add ARCH=java support to rsc asm - Fix rsc asm when no 'nasm' is installed - New command 'rsc path' like whereis or type, but portable * Fix cannot open weirdness - rename struct config to struct config_t - Restore entire config_t structure when opening a new file is impossible - Exit if we are opening our first file and it fails * Fix pipe_command_to_string function to work with files and pprintf - slower, but it works(R) - should be fixed before 1.0 ;) * pprintf the flags.c file * Add missing print commands to help: - pb, po, pc, pC, pG NOTE: I NEED INTERNET YAAAH 8: 712a6234 author: pancake@dazo date: 20071204-00:30:16 * Fix and full initial implementation of monitors for the gui and the shell - does not properly supports multiple sessions for the same user - does not uses inotify or so - works from the gui - 'rsc monitor' command has been fixed (rsc makes monitor take too many args) * Lot of silent patches in previous commit 9: ef0d8e0b author: pancake@dazo date: 20071130-04:08:19 * Fix Step/StepOver commands in gui * hist_get, hist_get_i (the same for _set[_i] * move radare_move to radare. * More code cleanup * Add jz, jnz, ja, jb, echo, list, reset commands in the ';' mode * Add get/set for variables in ';'-way * Rename goto to jmp * Silent nightly fixes 10: 59b9aba9 author: pancake@dazo date: 20071130-01:55:01 * Fix build for ARM * Fix re-build problem caused by the utils.x hack - Fixed with another hack 11: 73716594 author: pancake@pluna date: 20071130-03:08:26 * Make the rdbdiff build happy again * Hard refactoring of utils.c * Add -DRADARE_CORE to make utils.c usable outside the core * Code cleanup * Simplify msdos date code. cleaner to read 12: bb0252fa author: pancake@dazo date: 20071129-04:10:04 * Fix short jumps output that didn't get the flag offset string * Make mroe use of pprintf inside the disassembly module * Implement ;cmp comment-command (to be used with ;jz, ... * Add get_cmp to compare two strings * Fix color register print * Extend the use of eprintf! * Remove commands.[c,h]. Moved to cmds.[c,h] * Code cleanup * Verbose mode is now only changed by % command * Make hexstr2binstr get 2 parameters * Rename hiztory to hist_* 13: 73f558be author: pancake@dazo date: 20071128-02:33:21 * Initial working version of the code analysis (pC command) * Remove debug stuff * Some opcodes like 0x75 (jz) are not yet supported, only calls and jmps * Silently fix the loss of ticks with flags_setenv() 14: db68ff9d author: th0rpe@pluna date: 20071127-15:12:35 * software breakpoints fixed on bsd 15: d3e89b36 author: pancake@dazo date: 20071124-16:15:10 * Initial import of the code analysis module * Accessible via pC command (print Code analysis) * Does not currently works properly * The structures and required code is done (need fixups) * Supports: - x86 - arm (Thanks esteve!) - java * Import z0mbies length disassembler in C * Fix some makefile problems * Silently fix the breakpoints stuff on GNU/Linux (Thanks th0rpe!) 16: 5266a5f2 author: pancake@pluna date: 20071122-03:29:54 * Initial import of the x86 code analysis module (not yet tested) * Fixtures for the debugger breakpoints on *BSD * Make more use of eprintf and pprintf 17: fa71260c author: pancake@dazo date: 20071121-05:05:45 * Add !syms command to silently call .!rsc syms-dbg-flag $FILE - this command flags all symbols of the program * Make the flags (fd command) be available from the disassembly. * Fix string_flag_offset. (make it buffered and more checks) * src/dbg depends on src/ now 18: 7d7e8630 author: pancake@dazo date: 20071120-06:03:26 * Initial import of the monitoring stuff - New rsc command: - rsc monitor [name] [command] - Each prompt runs all commands in ~/.radare/monitor/*[^txt] - Improve the print to stdout functionality (pprintf) - Needs more work! statistics and optimization * The gui have a 'File -> New monitor' menu entry - Not yet working * Major code cleanup thanks to -pedantic -gnu99 * Fix some minor bugs * Fix build of vala frontend (continue crashing!) * Silently fix a null pointer when EOF ocurred in visual mode with readline 19: 5d136c2b author: pancake@dazo date: 20071114-01:00:53 * Important updates and fixups for the graphical frontend - More integrated with debugger - Simplify the gui (less buttons on toolbar and menus) - Add %ARCH combobox - reorder print modes combobox * Add contextual menu to seek, and set breakpoints (atm) * Support to change the font: $ gradare -f "Sans Bold 12" 20: b1f21a8d author: pancake@dazo date: 20071113-02:37:30 * Hard file hirearchy reorganization - Still needs more work on cleaning makefiles and moving source files and functions - But is on the way * libps2dbg has been moved to src/dbg - About separated src/arch and src/dbg/arch.. - This will help for a better integration between the debugger and code analyzer * Add dwarf-lines libexec script :? uh oh I thought it was there - api/asm.vala was missing too :O * Silently fix the !wp command help - Make it more coherent with the rest of radare (flags and output format) - Remove !wpl command - Registers mark renamed from 'r' to '%'. So instead of reax, you should type %eax :) 21: a572cbe0 author: pancake@pluna date: 20071112-14:44:13 * Major file system reorgonization. - Needs more work (the debugger and rest of plugins should inherit a single directory. - move all the architecture dependant stuff to src/arch/ - the debugger should be moved to src/dbg ? - move rdbdiff to src/rdb (will be used from radare core) * Chop libudis86 unnecessary files. - moved to src/arch/x86/udis86 22: 3b5995ec author: pancake@dazo date: 20071111-15:49:35 * Fixups and enhacements for the bindiffing engine - better output - find code blocks with same name - XXX does not yet supports xrefs and comments :/ * Some minor changes and fixups for the watchpoint debugger command - TODO it needs more changes. it's not much user friendly atm 23: 455697de author: pancake@dazo date: 20071108-20:51:06 * Initial import of the conditional expressions for watchpoints - new deprecated command "wtrace" - wp allows registers and memory expressions 24: 63b12064 author: pancake@dazo date: 20071105-14:14:09 * Integrate the java asm/disasm with radare core - Lot of fixups. - The class header needs more love - New command: "javasm" - allows inline assembly and disassembly (ala rsc) * Reorder code from utils.c to io.c * Add RDBDIR environ var $ echo "%RDBDIR ~/.radare/rdb >> ~/.radarerc * Implement %TRACEFILE * Implement software breakpoints for ARM - wrap hardware ones via software - not yet tested * Add oregs for ARM - Initial coloritzation for arm registers using oregs * Autocomplete %ARCH with arm,intel and java * Autocomplete Comment command * Add nlines for all disassembler functions * FUTURE * integration with the arm debugger for Jazzele! 25: 6c17e8a0 author: pancake@dazo date: 20071103-18:35:53 * Initial import of javasm - my own minimalistic java assembler/disassembler 26: 6fa50b1d author: pancake@dazo date: 20071103-10:59:44 * Initial import of the thread handling patch from th0rpe - now we can catch events from all the childs - update thread list on dispatch_wait! (arch_pc() should be called for each process) - store address in thread list - add parent thread to the list too * Silent fixup of thr thread list with correct EIP 27: 45c8e320 author: pancake@dazo date: 20071102-19:44:16 * Lot of silent enhacements for the ARM port - disassembly endian fixup - debugger is now working - implement the arch_syscall function - fix some disassembly of disarm (guided by ida and objdump) * Silently add some shellcodes to rasc * Add TRACECMD environ to !trace command * Silently fix makefiles.acr :O * Pseudo-silently integration of the libgdb2fd - Fix build and implement a VERY basic protocol api - not yet usable - added to the plugin list and accessible via $ gdbserver localhost:9999 /bin/ls ... $ radare gdb://localhost:9999 28: c5aa87db author: pancake@dazo date: 20071101-15:19:19 * add ptrace_syscall - a wrapper for all hosted syscalls - atm open/close/dup2/lseek/tkill/gettid are supported. - would be nice to mix this with syscallproxy - all code in fd.c is now using the ptrace_syscall() * Add pids_ptrace_all to ptrace() all sons of a child (forks and so..useful?) * Initial support for handling threads (clone(2)) on Linux platform * Use internal pstree() instead of the system one (needs /proc) * Fix BEP=main (still have a step(1) bug :?) * Add !th command to handle threads (lot of work needed!!) * Fix segfault in !fd arg parsing 29: 0a2ab6bc author: pancake@dazo date: 20071031-22:51:48 * Initial import of aasm renamed as armasm - minimalistic ARM based assembler - integrated with 'rsc asm' using the ARCH environment variable * Add 'c'ancel option when closing the debugger * Sanitize some code to be more serious :) * msync() pages before dumping and after restoring * Fix !maps parser * Add eprintf...avoid fprintf(stderr! * Add (if __WIN32__) on the plugin initialization * Finally fix the stupid chdir bug in !dump/!restore 30: 9f72e22f author: pancake@pluna date: 20071030-18:34:24 * More documentation for the x86 Adict (Assembly Dictionary) (rsc adict 'opcode') * Support directory name for dumps and restores * Also dump FLAG_USRCODE memory regions (not only REGION_WRITE) * Initial import of doc/xtra/x86-flags (CPU FLAGS documentation) 31: 90209dbf author: pancake@dazo date: 20071029-02:07:56 * Fix readme to fit reality * Update configure version to 0.9 * Add dump/restore process status (maps, stack and registers) * Move debug_dr to i386.c * Add some more missing vala files * Fix /proc/pid/maps parser * Code cleanup 32: 7b1dcdb1 author: pancake@dazo date: 20071028-23:32:06 * Autodetect radare version in debian.sh * Minor fixups cygwin and 0.8.8 release * Fix sysproxy build * Add new shellcode for w32 (test both of them) * Some fixups on w32 plugin * Add some missing vala files ---- version 0.8.8 ---- 0: 01485543 author: pancake@dazo date: 20071027-21:45:49 ** 0.8.8 SPURIOUS RELEASE! ** * Fix build on ARM * Add syscall tables for netbsd * Add syscall.h from netbsd and freebsd in doc/xtra * Add seteuid, setegid, and pseudo suid directives in rdb * Add colors in visual help * Make F10 refresh after achieve user code * Show 'cannot determine user code' when no maps found 1: 67644ff1 author: pancake@dazo date: 20071027-20:57:40 * Initial import of dead sql stuff 2: b7df1975 author: pancake@dazo date: 20071027-20:30:34 * Add manpage for rasc.1 * Fix contu old_pc bug * Prefix register values before stepping * Add -E to rasc to define a enumeration (00 01 02 03...) - Useful to locate the place to fit the return address 3: 5a8f5889 author: pancake@dazo date: 20071027-19:15:24 * Add soft step over reps when tracing or continue until user code * Add continue until user code (!contu) * Add !info* (radare-ized command) * Load !maps and !info* when loading the binary * Add !trace command with debug levels (only traces user code) 0 no output 1 show addresses 2 address and disassembly 3 address, disassembly and registers * Make debug_step be conscient of breakpoints returning 0 or 1 * Sort and colorize debugger help messaage * Add rows argument to udis() * Add -a flag to rasc to defint the return address and the offset to place this address. * Cleaner !maps output * Add jmp $$ hack * Autodetect infinite loops and silently optimize !contu 4: 07c38db1 author: pancake@pl2 date: 20071023-15:21:30 * Fix a Solaris issue related to alarm(2) * Take care about solaris to link against -lsocket or not * Add cursor and colors for the ARM disassembler * Fix flickering when cursor is used * Handle lines in ASHC on visual mode * Add metadata for ARM * Fix cursor movement inside udisarm * Minor fixups for Vala 5: a4ee730c author: pancake@pl2 date: 20071023-02:45:29 * Make search show number of hits and progressbar (cleaner) * Add support to search widechar strings (/w foo) * Deprecate the old search.c 6: a8b7f1f6 author: pancake@pl2 date: 20071022-04:36:14 * More work on the Vala front - Add console and shell working tabs with - no "load script" functionality yet - initial radgets format - Initial interaction with radare - fixups on radare thanks to vala (fix open initialization) 7: db808f6c author: pancake@pl2 date: 20071022-01:26:40 * Merge of the mprotect patches for the debugger. Thanks th0rpe! * Implement contu command 8: d29bf5f1 author: pancake@dazo date: 20071021-17:40:01 * Initial import of disarm. A GPL ARM disassembler - Some modifications to make't build on ubuntu-gcc-4.1 * Silently add changes and fixups for the Vala frontend * Support ARCH environ to use udis86 or disarm with pD 9: 6205df66 author: pancake@dazo date: 20071021-14:25:18 * Initial import of the Vala frontend - Initial implementation of the Radare Vala API * Fixups for the debugger layer - allow to recover from fatal signals and so (do not reload!) * Non verbose functionality fixed in the debugger - use getv() to get VERBOSE environ. - In the future this lib will die coz will be compiled together with radare 10: deac1f27 author: pancake@dazo date: 20071020-16:31:35 * Add print_syscall for better understanding of !contsc - TODO: !contsc 4 - continue until syscall 4 is called - arguments of the syscall are showed (not yet processed with pA) - an associated radare command may help * Fix build of debugger on ARM (for the new engine) - port is already incomplete and untested * Fix --without-udis86 (useful for crosscompiling out of intel) * Initialize $RDB file when debugging - Load chdir, chroot, setuid, setgid variables from it - Use !vim $RDB to change the values - Use !load to reload the changes and restart the process 11: 7a9a3692 author: pancake@dazo date: 20071020-06:09:35 * Initial import of the mprotect() code injector - Thanks th0rpe! - !contu command has been added (no code yet) * Load chdir, chroot, setuid, setgid directives from rdb file * Fix bp tip when using BEP (no eip relocation after soft bp) * Use F6 for !contsc and F10 for !contu 12: aee21481 author: pancake@dazo date: 20071020-04:46:02 * Initial support for contsc syscall identification for linux-x86 - Works like an interactive strace - Continue until certain sycall does not yet works (work on) > !contsc 4 ; continue until syscall(4) - Bind to key in visual mode * Fix BEP buggy conditional check * 13: cdfc3c28 author: panda@panda0 date: 20071019-15:52:49 * Fixups from FreeBSD. - Initial debugger support - Fully compilation - ktrace has been disabled (fktrace is netbsd only?) 14: 7b994283 author: pancake@pl2 date: 20071018-04:10:49 * Remove load:// from ptrace. useless dupped unused deprecated! * Add description field on every plugin - Available from 'radare -L'. * Silently fix the build for NetBSD. (The new debugger does not works yet) * Silently fix line counter for udis 15: 833e81d1 author: pancake@pl2 date: 20071018-03:21:07 * Fix build for TCC (The Tiny C Compiler) * Fix some ugly pointer bugs thanks to tcc * The 64 bit mode works on 32 bits by offsetting it by 0x1 0000 0000 - this value is converted into seek 0xFFFFFFFF, but it is in reality the 0x100000000 position. You can relatively seek from there, so searchs and so should work for large files (512M?). * Fix compiler dependent things like defining variable size in local frames defining the size with a variable name. TCC does not predicts this size in realtime. Use malloc instead. Less optimal, but functional * Make sysproxy flaggable by configure (--with-sysproxy) * Fix anoying problem with the plugin handling list. This will allow us to easily add new plugins with the '-l' flag. So it will be able to dynamically load IO plugins from .so or .dll * Silendly add the new -l flag for adding plugins (not yet working, just initial code) * Reduce LOCs removing stupid comments and checks. Clean some warnings * Silendly add the -V flag to rasc 16: 6145dc43 author: pancake@dazo date: 20071016-20:06:39 * Add -X to execute shellcodes * Initial on-the-fly patching of shellcodes to change port, addr and cmd (not yet stable) * Add some new shellcodes into the pool 17: c88c5fe6 author: pancake@dazo date: 20071015-02:09:11 * Moar harcoded shellcodes! * support for C output format (-c), (-x for hexa) * -ANC [n] used for setting prefixes and sufixes. * Initial support to modify parts of the shellcodes - Use environment variables * Lot of fixups and enhacements in rasc 18: 4415e5f5 author: pancake@dazo date: 20071014-16:51:54 * Initial import of the syscall proxy IO plugin * only for linux-x86 atm. little buggy * No syscallproxy ptrace support yet - ./configure --with-sysproxy - alice$ rasc -l 9999 - bob$ radare sysproxy://alice:9999/bin/ls * TODO: use syscallproxy together with bitbull (the shellcode loder from pluf&ripe) * Move socket_fgets to a safer place (it uses stupid config.fd) - bad movement 19: 25098245 author: pancake@dazo date: 20071014-03:21:11 * Initial import of some hardcoded shellcodes into rasc * Make 'rasc' work as expected ;) * Bring new ideas from some empty beer bottles - syscall proxy can be used as a radare plugin for remote debugging and so * Silently fix a bug in the debugger which disables steps after end of process 20: 93dcb3cd author: pancake@dazo date: 20071013-14:25:59 * Export %CURSOR envvar * Keep last_print_format after writing * Make 'rsc asm' happy with %CURSOR. This is, relative jumps are now done by default * Enhace the nasm support by not exporting an elf file * Fix the 'a' keybinding in the visual mode * Important fixups on the command parsing. - Now is possible to create your own oneliner debugger like this: > %PRINTCMD .!regs* && pD @ eip > pp * PRINT and VISUAL cmds does not alter the last_print_format * More stuff to stderr to avoid noise * Add 'y' and 'Y' commands into the shell 21: b07363de author: pancake@dazo date: 20071012-15:17:24 * Add ranging with the cursor mode (select = HJKL, move = hjkl) - Range selection works also in the disassembly print mode, so you can yank (aka copy) and Yankee (aka paste) easily * Notify when not in write mode in visual mode * Fix showed bytes in udis print format * Add yank and paste commands in visual mode (y,Y) * ';' command is working again and now supports cursor! 22: 8fc6a24c author: pancake@dazo date: 20071012-02:28:23 * Add BEP for the debugger (break entrypoint to entry, loader, main or offset) - Environment variable BEP - For example: $ BEP=main radare dbg:///bin/ls * Add debug_until() helper for debug_load()+bep * Make visual mode cleaner * Support for Fx in visual mode (ollydbg-like keybindings) * Initial implementation of the /cursor mode/ - radare_write, 'w' and 'W' are now happy again * Key '%' in visual mode shows radare environment * Lot of minor fixups * Make CLRSCr famous again * Ninja hack to make comments work on debugger 23: 58d1da82 author: pancake@dazo date: 20071011-03:17:20 * Make -x work again * Minor code cleanup 24: b901a450 author: pancake@dazo date: 20071001-01:14:24 * th0rpe fixups for the debugger side * Add th0rpe patch to make breakpoints persistent between debug sessions * Make the terminal height fit only in visual mode (config.visual) * Add '-f' flag to the block size to file size 25: ebc53d1e author: pancake@dazo date: 20070929-08:19:54 * Initial merge of the th0rpe changes on the debugging architecture for better handling of breakpoints and so - Not everything is working yet - There are some bugs that must be fixed asap - Code refactoring - Finds available hw breakpoints or use software ones * Remove !stepbp command (useless) * Optimize the perl integration ( do not use temporally files out of the debugger :/..must think on ): * Add command_to_string function to get the stdout data as a string * Some fixups on the radare_command() parser * Add :pD and :pd commands (remove trailing memory addresses and so) * Initial call to the events interface (not yet tested) * Add '!bp?' help command * Some alien experiments with the swig interface (maybe its not a good solution?) * pstree replaced on linux 26: 362c521a author: pancake@dazo date: 20070928-22:21:35 * Initial import of the events() support for ptrace linux * Fix multiple pipes bug | | | .. * Verbose 'w?' help * Cleaner visual keybindings 27: c5490ac8 author: pancake@dazo date: 20070928-01:42:59 * Initial import of the w32:// io layer to wrap CreateFile, WriteFile, ReadFile, .. * Some cleanup on the ARM debugger side, but it needs more love * Add 4 new breakpoints for ARM :D * Cleanup the arch/debug includes and function definition * Code cleanup for the signal stuff * Fix warnings in fd.c 28: da1f50ab author: pancake@dazo date: 20070924-08:15:48 * Make rsc asm happy with nasm and gas (NASM=0 or NASM=1) * Make stripstr work inside the debugger. - Integrated with /s [match] search command * Cleaner help messages for radare help * Add help message for 'f' command (f?) * Add '!hack ' command to the debugger * Add 'A' key in visual mode to Add a debugger hack. 0 - nop one opcode\n"); 1 - negate jump (jz->jnz , ja->jbe, ..)\n"); 2 - force jmp (only for { 0f, 0x80-0x8f })\n"); 3 - insert jmp (TODO)\n"); 4 - insert call (TODO)\n"); 5 - add ret\n"); 6 - add ret with eax=0\n"); 7 - negate zero flag (TODO)\n"); 29: ea076b48 author: pancake@dazo date: 20070924-05:22:04 * Fix !skip command (Make use of the killabyte inst_length code) * Initial try for the load:// prefix * Do not build libps2fd anymore. its br0ken (-fPIC is crappy) * Add insn_length() - reading from R_EIP(reg) * Add '!fd' command to manage filedescriptors - open - dup2 - lseek - close - list 30: 96f8a87f author: pancake@dazo date: 20070923-21:39:33 * Beutify the flag list output * Support to remove breakpoints fixed "!bp -0x804970" * Rename rsc proc-map to maps - Fix the maps load on the debugger - Fix multiple sections with the same name problem * Add function arch_get_entrypoint() - radare stores the ld.so entrypoint and the program's entrypoint - see !info fmi * Add some prctl() stuff * Add isalive() function to kill(ps.pid,0) * Fix detection of dead process * Reload breakpoints when the program restarts * Make info command recursive when config.debug - show delta flag offset too * Add some LD_ envvars for better debugging * Rename 'i' and 'I' keys to 'w' and 'W' in visual mode * Make the 'wait' flag of visual commands functional * Better fit of the rotate print modes in visual * Add 'C' key in visual mode to continue * Fix getenv("TMP") problem in make_tmp_file() * Split radare_command() into radare_command_raw() - Fix memory leaks - Fix problems with non-verbose flag - Fix problem with history - Add support to work as vi [repeat][command]. F.ex: 33x * Fix udis86 disassembly output - no relative addresses - No color for u->pc (more readable) - uppercase hexa addresses for calls - avoid nested stack frame in disassembly * Cleanup for the debugger command parsing code 31: 88e3939f author: pancake@dazo date: 20070922-01:27:39 * Store and colorize the debugger register values on x86 * Lot of awesome fixups on the pD command (udis86) with syn-pseudo - Fix impertinent segfault - Colorization of opcodes by type - Fix some negative values to be shown as -0xHHH - cleaner floating point representation - Add marks depending on the type of the opcode (jmp, call, ret, loop, ...) * Add '!oregs' command to show the last registers captured TODO: Need timestamp!!! * Cleaner look&feel for the visual mode * New keybindings for visual+debugger - 'B' - set a breakpoint - 'W' - set a watchpoint * Add support for repeating commands in visual mode Type 33s to make 33 steps :) * Add 'c' keybindings into the visual mode to toggle config.color * Finally fix the 'pA' command (recursivity overflow) 32: bb020c44 author: pancake@dazo date: 20070919-03:22:48 * Initial import of the !dr command for the debugger. - Allows to manipulate the DR registers to set read, write and execution watchpoints via DR and CR registers. * Fix udis disassembly segmentation faults by avoiding intel disasm * Fix height in udis (pD) 33: e054c04a author: pancake@dazo date: 20070918-02:46:33 * Initial import of the entropy calculation for the hasher tool. $ hasher -qva entropy my-target - Thanks anonymous gnome!! 34: d10ddd34 author: pancake@dazo date: 20070916-07:57:23 * Initial import of the not-yet-working !mmap command for debugger * Initial import of the not-yet-working implementation for watchpoints * Make !stepall command stop after loading the program * Avoid progress bar in !stepall * Thanks elektranox for fix up some warnings and minor fixups 35: f3a59927 author: pancake@dazo date: 20070916-03:26:55 * Add support to change the hosts signal handlers (!signal SIGHUP 0x8048000) * Add doc/xtra documentation * XXX debug_inject does not works :/ 36: ae9b551a author: pancake@dazo date: 20070916-02:26:25 * Remove the monitor stuff. Will be replaced by stdmixer: - http://vicerveza.homeunix.net/~viric/soft/stdinmix/ 37: 747b1813 author: pancake@dazo date: 20070915-09:24:42 * Add 'undo' command. (allows, list, reset and redo) * Add 'u' and 'U' commands to the visual mode (needs more work) * Define 'if (config.color)' as 'C'. Cleaner code :) * Fix some email headers * Fix 'w' command help messages * '?' command now shows the result in different bases * Fix HARD bug that makes hex strings ended with 'b' to become trash * Fix hex2int insanity bug * Beuty the write command in debugger mode * Make pD in VISUALCMD fit on screen properly * c and C commands (for adding code comments) are replaced by ; and , * Major code cleanup, some bugs found and fixed (no warnings) * Cleaned up lot of nested stackframes * Fix memory leak in visual.c when readding commands from readline * Fix *CMD insanity ( FMT_USER -> FMT_PRINT ) * Fix 'px' header * Add 'pp' to print %PRINTCMD * Remove 'P'oke command. Replaced by 'wf' (write from file) * Close all fds before execv in debugger 38: a02654e0 author: pancake@dazo date: 20070915-04:28:58 * Fixtures for the licensing headers to add th0rpe * Limit pc output to screen height 39: 1d42ccc2 author: pancake@dazo date: 20070915-03:58:11 * Initial import of the !alloc, !free and !imap commands for the debugger - Allows to allocate memory on the target process * Usability fixups for the debugger mode 40: e421a271 author: pancake@dazo date: 20070913-01:01:13 * Store and show entrypoint with !info * Use entrypoint address to inject code * Make write-mode by default in debugger mode * Fix tsearch bug (unitialized variable) * Make search work in debugger mode 41: 7ca9a5b0 author: pancake@dazo date: 20070912-21:21:49 * Initial import of the signal command for the debugger * Thanks ora8! 42: 255efb66 author: pancake@dazo date: 20070912-21:17:57 * build problem for the gui fixed (from 0.8.6 :( * rfile-foreach fixups * Thanks! elektranox! 43: 5cbfaaa3 author: pancake@dazo date: 20070909-21:05:09 * Initial implementation of the FPU pseudocode * Some FPU documentation done..must read more to give better support * Add support for ENCODINGs to the -S functionality to strip strings from a blob. - Use the environment ENCODING to set this * Some minor compilation fixups has been fixed silently 44: 5b333340 author: pancake@dazo date: 20070908-21:33:14 * Initial import of the hamming distance calculation for hasher tool * Some minor changes on the monitor code. 45: 2ff7169b author: pancake@dazo date: 20070902-23:38:58 * More fixups and enhacements for the pseudo disassembly * Initial import of the 'monitor' code. Not yet usable, just the base - This implies a new cmdline flag '-m [port]' * Cleanup the pseudo code switch table with oneliners * Fix one byte overflow that makes pD segfault * Add and fix inline comments and labels on 'pD' command - This is a provisional code, requires rethink and recodink * Add UDISAS into the visual print cycle mode * Add 'pstree' command to the debugger - must be rewritten from scratch - nowadays it systems() to the pstree command * Oops. ps.offset must -1 by default * Lot of fixups on the initialization order to fix debugger load and so * Make config.verbose happy again * Avoid |head -n 10 everytime, so udis86 doesn't needs pipes 46: f6cfb1fe author: pancake@dazo date: 20070901-22:38:22 * Initial import of the udis86 library * Add new print mode 'pD' with colors, labels and primitive comments support * Integrate udis86 into the acr build process * You can disable it with --without-udis86 configure flag * Emulate the inc/dec values in disassembly with pD (useful for walking thru the flow) * More colors on the debugger and disassembly * Some off_t fixes from the tcc compiler * 'c' key adds a comment in visual mode * 'C' key edits the comments file * New command 'C' to edit to add comments for the pD command (more will come) * Some useless updates on 'rasc' ---- version 0.8.6 ---- 47: 524e0c0c author: pancake@dazo date: 20070827-01:36:57 * 0.8.6 release * Initial import of the syscall-proxy and shellcode helper tool 'rasc' * Get si.si_errno when receiving a signal from the child * Fix the config.count in tsearch (finally!) 48: a119b6fc author: pancake@dazo date: 20070827-00:11:59 * One step more to finally achieve breakpoints on arm * In visual mode show the row size in the status bar * Fix the up/down keys using a new global variable 'inc' * Make CSTR fit on screen in visual mode 49: 1173b3a4 author: pancake@pluna date: 20070823-01:27:31 * Fixes on dbg for NetBSD (build) * Show eflags on BSD too (portability problem fixed) * Implement a 'ktrace' command for *BSD (wrong and broken concept) * Fix some old emails 50: 2ffe543a author: pancake@dazo date: 20070821-21:27:41 * Initial import of bin2xml * Fix bin2txt. Make it work again (at least for me xD) Thx wzzx for light me * Show nice message of 'progress' while bin2txting * Make ffftoneg happy with parenthesis 51: d6549eb8 author: pancake@dazo date: 20070821-04:19:28 * Remove fit-dump command, useless! now everything is dynamic and soft like a creame * Handle height as terminal change event to redraw and fit contents * Add config.visual (useful sometimes). needs make clean to avoid segfaults! * Fix typo in cmds.c (file->oneliner) * Use config.height (default 23) in multiple print modes (yay!) * Fix '|' usage on comments, !shell scapes and _scripting * Fix help usage of command '_' 52: 10971863 author: pancake@dazo date: 20070821-03:05:28 * Up to 0.8.6! OMG There are motherfucking snakes on radare! * Initial import of the toy code for embedding python into radare (epython.c) * Add --with-python flag in ./configure * Add config.lang accesible via '#!perl' or '#!python'. * Now you can run python inside radare just type: > #!python > _ print "Hello World" * Next stuff will be to implement the Radare module to provide a decent api for python to manage radare. 53: f12ca246 author: pancake@dazo date: 20070820-23:43:29 * Yay: Now we have ;goto and ;loop commands to move around history. This looks like a turing machine ;) * config.h has changed. make clean is recommended to avoid segfaults * Labels are now defined with ';:' for example: > ;show-var: * Add label_get and label_show functions. this is all done from history.c so they can be static. * Add '!l' command to list all labels * Loop break (;break) * Add '!+' and '!-' commands to enable/disable execution (history.c) * Add ';hdump ' and ';hload ' to dump/load session history This can be used to load scripts * TODO: conditionals with jumps 54: 2ffa5757 author: pancake@dazo date: 20070820-22:33:09 * Fix the %COLUMNS weirdness. Use winsize structures. On visual mode an alarm is scheduled to automatically resize the terminal providing a better look and feel * Make HEXB fit better on %COLUMNS * Autodetect when radare is working with non terminal output (serial console) This is useful when you want to log a radare session easily. $ radare /bin/ls | tee log.file This way %COLUMNS are forced to be 80 at startup. You can redefine this by hand if you want :) * Split the drawing part from the input code. This way I can throw it from the alarm * Add history.c with lot of hiztory_ functions. This is a wrapper for the libreadline one, allowing you to emulate the history functionality in a better way without the need of libreadline. * This is dupped info, so in the future I plan to completely replace libreadline, or at least provide a minimalistic version if you want to link against libreadline, this will be good for the BSD family that uses libedit or so * Hijack '!h' command to show the history list * Reorder all print modes for nicer readibility (still shitty) * Colorize the rest of print modes. Maybe I should test it more and define new color palettes. 55: 42d92df3 author: pancake@dazo date: 20070816-05:59:52 * Add arch_ret() and arch_call() functions to the debugger * Should be enought to build debugger-side code execution. Now i need breakpoint callbacks :) but this requires a better breakpoint infrastructure..will look on it * Add a nicer implementation of 'stepover' for x86 only atm, but should build fine on arm 56: d081415d author: pancake@dazo date: 20070813-13:02:09 * Add 'stepo' command into the debugger * TODO: make stepo work over 'rep'z * Some minor VTE testing issues (needs more work) * Bind '!stepo' in visual mode with 'S' key * Rename 's' as 'f' to seek to flag, and make 's' single step. 57: 47a0190f author: pancake@dazo date: 20070813-00:45:09 * Add a graceful message after injecting code on child process * Add menubar to gradare * Lot of new keybindings for opening files/processes or programs * All important widgets focusable via keyboard: ^L -> uri widget, useful to launch commands ^K -> view combobox (hex, disasm..) ^J -> focus vte terminal ^N -> focus actions widget * Allow to change the toolbar (large, small or disabled) (^T) * Add "about" entry in Help menu ---- version 0.8.4 ---- 58: ea092a8d author: pancake@dazo date: 20070812-17:23:45 * Upgrade to 0.8.4 * Lot of fixups for the debugging layer * Colorize the command prompt when -c (%COLOR 1) * Call io_write instead of write() to write (fixes segfault on debugger mode) * Default syntax is 'intel' * Fix the open() inside radare command (kill process to avoid stacked zombies) * Add get_pc() and set_pc() commands to ease debugger development * Add 'jmp' command into debugger * Add command 'inject' to execute in-place code (rsc start2bin) * Fix 'step' after breakpoint * Export flags as environment variables when io_system() This way, the debugger can get the flags. Cool for breakpointing :) > !bp sym_main * Rip signals when stepping, continuing, etc.. not only 'run' * make get_offset() be happy on the debugger side by reading flag_XXX envvars 59: 5549b74f author: pancake@dazo date: 20070812-05:29:20 * New print command 'pA' (analyze data block) * Setup system-endian when debugging * "EOF" now is muted when no verbosity * update environment after setting a variable 60: 7164031d author: pancake@dazo date: 20070807-07:33:05 * Initial import of dbg-report script * Fix a division by zero bug in get_math() * Load syms-dbg-flag when debugging a process * Add 'pids' command in libps2dbg 61: ffe801ce author: pancake@dazo date: 20070807-02:07:58 * First after defcon commit * some fixups for the FreeBSD debugger * implement fpregs for freebsd and linux * fix segfault on debugger when opening a nonprocess file from debugger mode * show pbar with |/-\ * PT_DUMPCORE only for NetBSD * warn about the -CONT to stop execution of a debugged process * Lot of new items in TODO (not all injected) ---- version 0.8.2 ---- 0: ce85b2ca author: pancake@dazo date: 20070722-12:29:21 * 0.8.2 release 0: 92db8afa author: pancake@dazo date: 20070722-03:39:12 * Add new commands to gradare for the debugger (step, ...) * New commands for the gui: 'seek to flag', 'change register value' and 'show status of the debugged process' * wrap gtkdialog with rsc gtkdialog to avoid gtk error messages * Make 'changed' event of the combobox in gradare work again * Add keybindings ^L and ^K to focus entry and combo * Add 'debugger' view in gradare combo * Make %SYNTAX intel work again * Add 'proc-map' rsc script and use it from the radare debugger to flag the memory map of a process * Query the user to dettach or kill when exiting the radare debugger * Export DPID environment (debugger process id) * Add '!maps' and '!status' commands to the debugger * Documentate the pseudo-debugger command 'kill' * Some 'last_print_format' bugs fixed * Call io_close() instead of close() * Bind '!' command of the visual mode to show the debugger's help 1: 656b9c33 author: pancake@dazo date: 20070721-04:12:03 * Beutify the eflags debugger interface and be more userfriendly * Allow set the eflags (I flag is always on because of the trap!) * Fix another verbosity issue in debugger mode 2: 47c2908a author: pancake@dazo date: 20070721-03:24:42 * Show eflags in the debugger for x86 * More verbosity fixups * Some changes on the radare_command internals. Some bugs already exist * Add 'S' key in visual mode for the debug mode to step * Add experimental 'w' key to fit dumps into screen * Show 'invalid keystroke' when hardcoded. avoid user misstakes! * Ignore SIGALRM at startup, to avoid crying searchs * Cleaner debugger startup messages * Fix the \x1b problem in the first command readed in the debugger. -strange- 3: dea54b1b author: pancake@dazo date: 20070714-17:14:31 * Add 'set' command to set a value to register * Implement arch_set_register for x86 and ARM * Add -B flag to change the virtual base address * Make -s and -x work again * -v now works as a toggable, reduce loc * Major code cleanup (no warnings alive) * Clear remote.c warnings * Rename 'gamma' to 'gamme' in xrefs.c (avoid compiler warns) * Fix verbosity -> verbose transition 4: 366f5a46 author: pancake@dazo date: 20070628-23:50:28 * Add md4 support 5: fe528e35 author: pancake@dazo date: 20070609-12:32:13 * also export and use VERBOSE environ * Rename verbosity to verbose (more coherent) 6: fd93a539 author: pancake@pluna date: 20070526-22:30:32 * Initial import of the web frontend for radare. Aka raweb! 7: 9a6f53bd author: pancake@dazo date: 20070522-03:02:11 * Add 'extended' chars in stripstr with -c 8: bd1fe83f author: pancake@dazo date: 20070520-04:49:01 * Fixups for maemo debian package * Available at http://radare.nopcode.org/get/ * pd shows 'fd' only in verbose mode * Oops. fix configure to match 0.8.1 9: 26dc7b33 author: pancake@dazo date: 20070520-03:02:26 * minor cleanup for syms-flag * add 'fd' command. ugly syntax, but powerful. FD stands for Flag Delta The flag delta command prints a flag name plus the offset in hexa: f.e: sym_main+0x32 * always 'fd' before a disasm. very useful! 10: 530d4f4d author: pancake@dazo date: 20070512-18:54:20 * Initial import of the tcp remote plugin * It supports connect://host:port/file and listen://:port layouts * Also supports nested URIs like: $ radare connect://192.168.0.33:9999/dbg:///bin/ls * This command will remotelly debug the /bin/ls program on the remote side. This way you can crossdebug applications via TCP (from to x86/arm atm). * endian_memcpy moved from print.c to utils.c 11: 4d40efca author: pancake@dazo date: 20070507-23:37:28 * Make the build happy again for libps2fd. i686 => i386 * Recicle variable 'i' in tsearch.c * Fix anoying bug in search (config.interrupt was not reseted!) ---- version 0.8 ---- /* GIT */ commit 73db9d5dacda8f3a623e081a173762689b2fb4e8 Author: pancake Date: Sat Apr 7 18:31:40 2007 +0200 * Fix include order in tsearch that breaks the search callback * Add the TARGET ACR environ to the output of -V commit 258a62859f42a84dea6074fe1c026cdd65b68ae6 Author: pancake Date: Sat Apr 7 11:32:31 2007 +0200 * Major warning cleanup * '%' show %SEARCH[0] and %MASK[0] too * Autocomplete %SEARCH[0] for usability commit b096305cee785e79f180a8c3654103f4a7e46751 Author: pancake Date: Sat Apr 7 11:11:20 2007 +0200 * Oops nasty bug in makefile .c -> .o * PR168 --without-readline fixed * PR168 trailing \n removed for nonreadline keybindings in visual mode commit 8b8adbb05f9754dae79c233b4416459e26b7b688 Author: pancake Date: Sat Apr 7 01:31:58 2007 +0200 * Unignore --without-readline commit b3cadef4b2f9af73293718a332d91bb27ebf20f6 Author: pancake Date: Sat Apr 7 01:13:27 2007 +0200 * Initial import of the new binparser search engine (Thanks to esteve) The internals of the search engine has been changed completely, but the external command line interface remains backward compatible except for the removal of the buggy GNU regular expressions support. Mask searchs are not yet supported. * Autocomplete %SEARCH[ * Support for multiple searchs in paralel * Support for binary regular-expressions-like syntax * Implemented a token grammar file format for storing search blocks in files (/.) commit 0119516169025aed2b5166c855f1bd9c6488dda6 Author: pancake Date: Thu Apr 5 03:13:05 2007 +0200 * Final implementation of do_open for resize and write * Fix dupped NEWLINE definition (invalid include order) in config.c * Exterminate all xrefs and hasher warnings * Split yesno() checks into a separate function. avoid c&p commit edc3fb817aded4117894fc388ad6aeae3c9e7be1 Author: pancake Date: Thu Apr 5 02:41:12 2007 +0200 * Add and handle %XREFS environment variable * Some more testing cleanup for do_open() good for fixing the ro/rw weirdness * Fix some warnings/bugs in visual.c (Thanks gcc!) commit 2be2bb1809fc567dd25f33c8c6878d6055d77f85 Author: pancake Date: Thu Apr 5 02:27:20 2007 +0200 * Use get_math for 'm'ove command * Auto-resize when file growed by 'm'. Closes bug ticket 113 * Split do_open() to a separate function * Fix 'a' key typo in help of visual mode commit 4c19ff7b239c83fa2849946246c406fafdcae297 Author: pancake Date: Thu Apr 5 00:24:51 2007 +0200 * Support for wide write (ww) and wide print (pZ) commit 000413136418c53247ebc85428da39585c56e861 Author: pancake Date: Wed Apr 4 23:28:56 2007 +0200 * Add FMT_SHORT and FMT_TIME_FTIME (Thanks to parki!) * Support for dumping to files with spaces (Thanks parki!) * Long and LongLong endian support * Add bold ansi colors definitions * Support for interpreting environment variables (.%) * Use termios_init variable for safer terminal_set_raw usage * install libexec/core too commit 2be22f8933881f019ac852f806cd9c16409e48cd Author: pancake Date: Tue Apr 3 23:48:32 2007 +0200 * Better support for backtracing commit f513661c1bfa891a64c314a58fc88fe60678452d Author: pancake Date: Tue Apr 3 21:48:28 2007 +0200 * Oops, some nasty bugs in the gotoxy implementation. * More missing INILINE * Minor xrefs code cleanup commit 9ea35e0e5ba3f31eba1152fbf6b6026f06c82aa0 Author: pancake Date: Tue Apr 3 15:36:09 2007 +0200 * Initial import of the debug_backtrace() command (needs more work) * Fix strtok() bug that makes glibc segfault. STUPID ONE! commit 5c416d21fdb7708f807cde87e4a07867faab42c5 Author: pancake Date: Tue Apr 3 14:12:49 2007 +0200 * Support for relative gotoxies (close ticket n-163) * Support for %TMP environ, not yet done everywhere, but at least inside radare O:) * Fix some \n -> NEWLINE in data_print * up press_any_key fun to make gcc3 happy commit 5f6befe16987823a1bd1a7b96bce5eb2c752eb42 Author: pancake Date: Sun Apr 1 03:57:46 2007 +0200 * Fix xrefs on x86 * Integrate external xrefs in visual mode 'x' key commit d090973f3cbea9f9933b0a54555eea7222804859 Author: pancake Date: Sun Apr 1 02:56:07 2007 +0200 * Better to use get_math commit 71104bbb7acaed1d5ca47db3ebc7994a70a464c6 Author: pancake Date: Sun Apr 1 02:55:07 2007 +0200 * Autocomplete xor and xorpair * Numeric argument for print commands is now handled by get_offset commit 4c37d7c6c3af71a23286d6afc6aedda02217ec1c Author: pancake Date: Sun Apr 1 02:32:44 2007 +0200 * Fix /dev/mem hashing * WARN about hashing from stdin: the first block is 4096 bytes :/ commit d522f875a78acacbc9b1683456c0cd3869dd9cce Author: pancake Date: Sun Apr 1 02:04:53 2007 +0200 * Implementation of xor and xorpair algorithms in hasher * Minor code cleanup for libps2fd commit 45d87c1c831bcabc614d8beeb775606b8cdf213f Author: pancake Date: Sun Mar 25 17:40:38 2007 +0200 * radaredbg now handled loading programs in $PWD (aka ^./) * initial import of the gerardo intel opcode measurer * lot of fixups and hackarounds for the breakpoint and tracing commands * step commands are buggy in front of breakpoints (needs more work) * new command "stepbp" step all opcodes until found a breakpoint (aka pre-cont) * split waitpid code into a separate function to handle signals and breakopints restore * :.!regs* only executed in debugger mode * initial import of the signal handling code * initial import of bps.c * initial import of the Gerardo's i386 instruction measurer commit 588f6463446ff3c64b912bc9be265ae04a5b9b3d Author: pancake Date: Sun Mar 25 00:20:06 2007 +0100 * Fix hex seeks ended with 'b' * pretty print format for arm cpu registers * info must start with INILINE commit 1e3880aeb9d7539ea11aad65fd4ec12e821fd90a Author: pancake Date: Sat Mar 24 09:47:06 2007 +0100 * Initial draft for code-injerktion as an external tool * write in debug finally working again. masking must be implemented * use PTRACE_KILL when we want to close the child. not kill() * allow to open multiple pids without closing the radare session * align help messages with two leading spaces commit 2521bac327e413dc052fa9cdde66a12dad17a028 Author: pancake Date: Sat Mar 24 08:55:49 2007 +0100 * Up to 0.7.5-git (debugger centered release) * make radare know if is working as a debugger or not * cleaner !regs command output * print out process and cpu status when "" command has been typed * fix debug_close missing symbol * implement debug_write_at as a possible temporally hack * !step command now accepts a numeric argument to define how many steps you want to do * initial skeleton for more flow control commands (stepret and contfork), not yet implemented. * implement the !detach command for detaching radare of the parasited program * '!s' is an alias for '!step' * control color configuration using the %COLOR environment variable * cleaner code in dump, now the disassembly is faster * fix lot of NEWLINE -> INILINE stuff for better GUI experience * fix hexb print mode header commit a269a0ac1cd06d2d2e5c2e9ba8d115ce36621787 Author: pancake Date: Sat Mar 24 05:51:38 2007 +0100 * new command in visual mode 'a' (insert assembly) * get_offset now gets octal and binary values (???o and ???b respectively) * fix some read(1)->press_any_key in visual * minor cleanup of crc16 code commit 7b0100d8fb2019f3efe181a7c3304a1e85571bde Author: pancake Date: Wed Mar 21 13:57:40 2007 +0100 * Oops, maket work :) it's not working on BSD yet commit 4da4f27aa0f06545688c02994fe22acceb09c2c0 Author: User Date: Wed Mar 21 11:20:34 2007 +0100 * Initial import of the rsc core utility (Thanks virik//xscript) commit 3ae45ad59196b562cf1718a990bba407d9a280e3 Author: pancake Date: Sun Mar 18 04:58:32 2007 +0100 * Oops! commit 4806aa1517494922a3d613b00df7c950fd004735 Author: pancake Date: Sun Mar 18 04:55:14 2007 +0100 * More configuration and acr related fixups commit 06ed5ce415567b90113961b2465164f9c6f2221d Author: pancake Date: Sun Mar 18 04:45:54 2007 +0100 * Fix build on non-glibc systems of libfdsniff * Make mrproper more effective commit 266c581cda03ef65a7b9f0700be6ac6fc81d9c05 Author: pancake Date: Sun Mar 18 04:38:46 2007 +0100 * Up to 0.7.2 * Fixtures from acr 0.6 * autodetect target architecture for the debugger layer commit 11ccfb181338721638fb5777c41b99a5b661a047 Author: pancake Date: Sun Mar 18 04:00:15 2007 +0100 * Documentate -n in radare manpage * Documentate -s in xc manpage * 'g'oto integration for the info command * 'g'oto integration for various print formats * Fix the print rotation in visual mode commit cf3282786abcbd28e855d9136d26f8c31a20530e Author: pancake Date: Sun Mar 18 03:35:49 2007 +0100 * More 'g' command fixups on different print modes * Beutify the :px command output * Fix some memory access bugs in visual commands and visual keybindings * Split visual_bind_key into a separate function * Add -s flag to xc. f.example: $ xc -s 33 44 55 11 99 33 * Help for -e and -s flags for xc * Better endian support for xc commit 05df50815b4104bd6829781e8511331f3a986d1c Author: pancake Date: Sat Mar 17 16:53:41 2007 +0100 * Initial working and tested version of the debugger support on ARM * xc.o and xrefs.o must be removed too! * add '#crc16' command autocompletion commit baaf439e2c2c7a84453b244552b578d6237e8cc5 Author: pancake Date: Sat Mar 17 15:16:48 2007 +0100 * Initial implementation of the ARM debugger stuff.. needs more work * Fix non-verbose print binary command ':pb' * Fix print mode rotation in visual mode * Show print mode in visual mode header * Better UI for the keybinding assignment in visual mode commit 47da9e51f7512cc6a48ef9b650e8caecb970e7c3 Author: pancake Date: Fri Mar 16 02:43:36 2007 +0100 * Fix 'file has growed' bug commit 80f8154ca3fa54fbb80ca5cb22bb3f6e4235833a Author: pancake Date: Fri Mar 16 02:29:24 2007 +0100 * Add 'I' command into the visual help message commit fbd612746fea6e94471d2c3d3fffd2e2b98361d8 Author: pancake Date: Fri Mar 16 02:28:14 2007 +0100 * data_print doesn't takes care about file size * The above fix, make fix an ugly stuff in the 'w' commands * Implement a new command in visual mode 'I' (input hexa string) commit 5313277191bd584b2a3608f631493171d62ef38d Author: pancake Date: Tue Mar 13 23:52:19 2007 +0100 * Add environment variable called "SNFBYTES" for limiting the hexdump of the sniffer * README intentionally left blank O:) commit 31f00ab9a70f251aec996aad26d9ff8f6dac4f93 Author: pancake Date: Tue Mar 13 15:05:34 2007 +0100 * Fix underflow bug in radare_set_block_size_i commit f9736409007a973cbb1dca4ff428a26a896031f3 Author: pancake Date: Mon Mar 12 01:04:53 2007 +0100 * Add support for crc16 * Fix hex as bin confusion in 'xc' * Add '-f' flag to hasher commit 7a98b24cdbf170ac6c07bb441b6799ec2deea453 Author: pancake Date: Sun Mar 11 13:04:55 2007 +0100 * More fixups on the debugging layer * Write on process is br0ken. needs more workage * Code cleanup in libps2fd * command '=' removed * Do not file grow when unksize is set * Fill with 0xff when can't read commit d8b3ca611d62801dceb9d62697f8bd0f5940c24a Author: pancake Date: Sun Mar 11 00:43:24 2007 +0100 * Better support for breakpoints * Fix really ugly bug in get_math * Add 'detach' command to debugger * 'break' renamed to 'bp' * do not include in libfdsniff! * completely removed the config.interpreter var * add -n flag (do not interpret ~/.radarerc and ./radarerc) * interpret ~/.radarerc and ./radarerc on startup commit ac7dfc67ff7ab61f74614daef8023527fa49fa0e Author: pancake Date: Sat Mar 10 06:34:22 2007 +0100 * add a second argument to radare_command function to specify if we want to log or not the command. * This new argument makes the 'config.interpreter' variable useless * Fixes on the add_history readline usage * Fixes for the && concatenation commit 2afdab6030028a0d4dab4e325c23bcc4ab6f32d0 Author: pancake Date: Sat Mar 10 06:19:50 2007 +0100 * Implement command concatenation with the '&&' token. commit 2086e7a79b044daebd0fa89978777586b924b82e Author: pancake Date: Sat Mar 10 05:13:20 2007 +0100 * add 'b' command to the visual help and drop the 'g' one. * implement the b? command in visual mode * do not dup predefined keybindings. commit 83d129181e9573bec1a935938b8811ee2ebe8f58 Author: pancake Date: Sat Mar 10 04:26:09 2007 +0100 * Fix multiple bindiff problem (Thanks pof!) * Implement the 'g' (aka goto) command * Implement support for asigning keybindings in visual mode (key 'b') * Fix really ugly bug in @ + get_math() stuff commit 30a176a86fd6bafed76678d11d4a27e0343baff3 Author: pancake Date: Fri Mar 9 18:28:50 2007 +0100 * Fix terminal_set_raw problem in visual mode * Minor code cleanup in data_print func * 'pc' command wrapped to COLUMNS (Thanks esteve!) * Ignore build problems of libfdsniff commit 0b7a939e00ed8fd88f39031d4090ef2302dc378a Author: pancake Date: Fri Mar 9 01:04:53 2007 +0100 * Oops commit 9fe07087751b7ec09e35697df1d6d70f6caf8b95 Author: pancake Date: Fri Mar 9 01:03:06 2007 +0100 * Fix installation problem when no libusb found * Acr-ize the libusbsniff makefile commit 816eca8ab959af205b325592c2a9d71e5140ef48 Author: pancake Date: Fri Mar 9 00:48:06 2007 +0100 * Implement a progressbar in the search engine * Fix 'b' command for block sizes < 10 * Major cleanup of the search engine code * Minor optimitzations and fixups for the search engine * Fix hit flag names (eflags vs nflags) * Use config.interrupt instead of dupped SIGINT handling * Repeat last search working again * Restore seek when the search has gone commit 184e9ef9afeafb34415be68e43bc6221410efcef Author: pancake Date: Wed Mar 7 15:18:12 2007 +0100 * --without-perl -> --with-perl (fixes build on fucking Debian) * Cleaner output for the lib*sniff libraries * config.device -> config.file * Fix 1 byte underflow in radare_command (Thanks gerardo!) * Remove dupped condition (Thanks gerardo again!) * Add config.interrupted boolean * Use config.interrupted in flag_list, must be used everywhere! (search and so) * Fix add_history for non-verbose commands commit ed6443c182beaf08fcb0c3ab9028c2a7f76737ee Author: pancake Date: Tue Mar 6 02:06:33 2007 +0100 * lib{fd,usb}sniff hexdump to stderr * Completely replaced the 'v' command by 'p' * Loopize ONCE commands and notice endian affected printouts * Show BLOCK and ENDIAN environs * Fix verbosity illness when interpreting * PRINTCMD aka pU is a radare command. not a dump+process * nice '--press any key--' message in visual mode commit 9a59aacf94b81df097c13b8831eaa6e86dc134c5 Author: pancake Date: Sun Mar 4 19:13:28 2007 +0100 * Oops. do not install libaff2fd if does not exists * radare -V now shows endianness, register size and compiled features info * Fix x->c on the short help message commit 9097e9a2748be479544e433567d13b779c17263e Author: pancake Date: Sun Mar 4 18:57:31 2007 +0100 * Centralize hexdump of data bytes in hexdump.c * Add license headers in lib{usb,fd}sniff * fix read hook bug in libfdsniff * Major code cleanup in both sniffing libraries commit 1dee5c5ce74d1084d1bf365aaf2482e11a38a622 Author: pancake Date: Sun Mar 4 07:42:02 2007 +0100 * Initial PoC for the AFFLIB support * Support for 'K', 'M' and 'G' suffixes for get_offset() * Some fixups on the algo_par in hasher commit eee43378ccf9830d4582db29c9ea065b3fec046c Author: pancake Date: Sun Mar 4 06:02:34 2007 +0100 * debugger handles ^Z for interrupt the child process * cleaner coder * fix search hits flag definitions and reduce code commit 8d95e35af68484d23e05048fabaadfa4cd13924e Author: pancake Date: Sun Mar 4 05:45:46 2007 +0100 * Implement a new algo in hasher 'par' aka parity bit * Add some missing print commands in autocompletion * Better centralization of search_hits * resize command supports '*' argument * More code cleanup commit 807da48025dc7099ca8fca89f0d47ac21a9af457 Author: pancake Date: Sun Mar 4 04:39:05 2007 +0100 * Move hasher to src/hasher/ cleaner code separation * Up to 0.7.2-git * fix some include weirdness * Use get_offset in getopt() * Remove the hook-system PoC * Drop some unused variables * Better autocompletion for '!' command commit 4fad099d27c9f6315803018691c678d125a970bb Author: pancake Date: Sun Mar 4 02:30:47 2007 +0100 * Implement get_color_for() to reduce print_color_byte() LoC * Implement colorization for the binary format * Autocompletion for the debugger commands * Minor code cleanup commit 1f36a2ea78867104edaf77a936d0eb0494d22b8f Author: pancake Date: Sat Mar 3 18:36:32 2007 +0100 * Remove the '-x' flag. Use pipes! * Documentation for the -c flag * Fix eperl build on debian * Minor gcc warning cleanup commit 76041c97d444b77861e8b32904256cdfd55d44db Author: pancake Date: Sat Mar 3 04:48:18 2007 +0100 * Implement support for Jpegs in rsc/Display. Thanks to esteve! commit 5842c7c3187525b2c497d2629554c7a30e16f74f Author: pancake Date: Sat Mar 3 04:20:48 2007 +0100 * Initial import of libfdsniff inside libusbsniff directory must rename * Initial support for ansi colors (-c) needs rebuild * Configurable colors in print.h modifying the COLOR_?? defines * Some 'v' commands moved to 'p', take care! * Move format/print stuff from cmds.c to print.c * Centralized print byte and print address functions commit c29cc0bb3b25e9a7c45a2d38b7a86dceb5acf1a6 Author: pancake Date: Wed Feb 28 00:04:15 2007 +0100 * Fixups on the libusbsniff * print result buffer on reads (64 vs 192) * capture usb_set_altinterface too * handle return values * cleaner output char strings * new makefile target "clean" commit 51d13701bb32f25511918ce8d8057803ed918f88 Author: pancake Date: Tue Feb 27 01:21:34 2007 +0100 * '?' alias for 'help' in libps2fd * do not history everything!! interpreted stuff doesn't need to be stored * Cleaner 'seek' command output. commit c557813ca88d60308ab1a331d582d5704326fba9 Author: pancake Date: Tue Feb 27 00:10:10 2007 +0100 * Initial import of the embedded perl scripting * Add --without-usb-sniffer and --without-perl flags to configure * Fix some acr related bugs * Oops, missing readline autocompletion for '/m' commit 2a74c7dd3f46fce0d2532ed8e2b7df4ea0e482e3 Author: pancake Date: Mon Feb 26 00:27:26 2007 +0100 * End of the ACR weekend chaos commit 98cc50a8d6a9997ad6fdfc87c3e2bbcf065bb9a3 Author: pancake Date: Sun Feb 25 20:25:35 2007 +0100 * Fix the .! command to be compatible with the debugging layer (this can probably break something) needs testing * Refixes for the acr stuff * default VISUALCMD for radaredbg is ".!regs*" * radaredbg starts radare with -w and -u flags * show pid information on load * new debugger command 'info' * fix chomp flag names and better flag name filter * Fix the verbosity lossage under certain conditions commit e71ef1b3bcda386f4f2a8fedf29bbf076f7d294c Author: pancake Date: Sun Feb 25 08:20:30 2007 +0100 * Oops. acr is b0rken. recover old working version * radare_command should return bool commit 819077d8e0e2f53d335e6c7c70a404a9fbb1e80d Author: pancake Date: Sun Feb 25 04:50:23 2007 +0100 * Initial import of libusbsniff * acr fixups for sunos awk stuff * Do not segfault in !load debugger layer * Catch @CC@ in src/Makefile * Minor code cleanup * insert command in visual mode shows an error msg in ro commit b91b91e9d894cd6840367e2d88ce7453a578260b Author: pancake Date: Sat Feb 24 19:48:34 2007 +0100 * Implement masked removal of flags 'f -foo*' * Major cleanup of the gui build warnings * Minor fixups in radare * Remove flag_array_clear("foo"), replaced with flag_clear("foo*") commit 15df9d7e9ad711a175d5c35eef668f2f42b413e4 Author: pancake Date: Sat Feb 24 18:40:48 2007 +0100 * Fixes for the flagging array management * Remove search hits after each new search commit 277fe96e3ee730991aacaf3c5878d16d45871781 Author: pancake Date: Sat Feb 24 07:38:47 2007 +0100 * Implement `, and | commands. * Enhace the doc/shell document * Minor simplification of net-tcp. Needs testing * Flags database is buggy, minor fixups commit f570772edaa976154ba758d80e11a36e0681aafe Author: pancake Date: Fri Feb 23 00:56:04 2007 +0100 * Initial import of networking rsc scripts (net-icmp, net-tcp, net-udp) -- thx sha0 * Initial import of raw pixmap visualization with image-magick (Display) -- thx esteve * 'px' command has appeared again * Initial fixups for the environment pwnage to reduce the number of commands -- thx esteve * SYNTAX is att by default (env_init) * Fix flag redefinition bug (thx sha0 for the advisory) * Cosmetic hexadecimal stuff: Data is lowercase and Offsets are uppercase * :pX command does not shows the space chars between hex pairs * OFF_FMT now is "0x%014", this should show a 0x prefix everywhere we use an OFFset commit 419bca9b1f9ec0eadf357efbd789a07951f9059c Author: pancake Date: Mon Feb 19 01:06:34 2007 +0100 * Implement %HITCMD * Support for unsetting environ variables (use '-' or '(null)') * vb replaced by :pb 1 * vx replaced by :px 1 commit c165b4f2a316ab35672a85ea9d87c5c5a7c7ebbf Author: pancake Date: Mon Feb 19 00:25:25 2007 +0100 * Create ~/.radare/toolbar on startup * Check for vte in ACR * Disable gtk if no gtkdialog program found * Missing .El in manpages commit 838f0842e9f998377a02fbb8d0ebdf789986d8f4 Author: pancake Date: Sun Feb 18 03:39:03 2007 +0100 * Major gui improvements * Implement binary mask for the search engine (/m) (Thanks esteve) * Implement the %HITCMD functionality * Lot of new grsc commands * New command 'bytediff' * Fix some variable initialization bugs * acr-ize the GUI build (new flag --without-gui) * gradare supports a personal toolbar (~/.radare/toolbar) * fix a bug when no output when parsing the execution of a command (.!) * integrat gradare with acr to be used system-wide * install grsc scripts into libexec/gradare/* * fix write command (non-verbose mode does not needs 'y') * Oops, fix some bugs in environ commit 86359f720d929bd7317cdd361b993da2e7c181d0 Author: pancake Date: Sat Feb 17 17:05:09 2007 +0100 * New radare shell for the gui * Support for intex syntax in objdump use '%SYNTAX intel' * Allow flags to be quite * Fix 'pd' command in debugging mode * search hits renamed to hit[%d] commit 633dc4f5752bcccd9036e41656b441f8e54638d8 Author: pancake Date: Wed Feb 14 02:31:33 2007 +0100 * More work on libps2fd, major fixups. Needs more work. * Add "unload" command for the debugger. commit 2719397bf97d3a2629f8738a0d6dd57827a15f76 Author: pancake Date: Tue Feb 13 14:31:12 2007 +0100 * Implement support for ptrace_attach (pid:// URI) * debug:// URI is too long. Changed to dbg:// * Fix some bugs that makes build unhappy on Ubuntu commit 725dc742fa5f24c791987a980a3a899c1537bb09 Author: pancake Date: Tue Feb 13 00:56:33 2007 +0100 * Add search-asm rsc script (thanks sha0) * Minor syntax cleanup and stupid stuff (nothing has really changed) commit 03ca0266ba03b05b73e6e1a0b975f80c2ab0601b Author: pancake Date: Mon Feb 12 02:14:00 2007 +0100 * Initial integration of gradare actions in the GUI commit 09dee979e9ff8e427c4a4076c162e8b632ec0c31 Author: pancake Date: Sat Feb 10 21:33:29 2007 +0100 * Initial ARM support for tab2gml * Add debugging, help and nocalls-trace support for tab2gml commit 91e23fc4d64e7945eb1f2fc50495740a79dc2ddb Author: pancake Date: Sat Feb 10 06:32:05 2007 +0100 * Initial idea for libgdb2fd * Oops in xc! not yet! commit e68c82e5f0958b5786e2691ae4ff59cc7924fc97 Author: pancake Date: Sat Feb 10 06:28:37 2007 +0100 * Some important improvements into the gtk frontend * Initial per cpu splitage for the debugging layer * xc is going to be inside radare now * Avoid noisy 10240 limit for the block size * $BYTES only exported when required commit 603e45753d8c0105b337f15f7a1ba1f5e9a50c5d Author: pancake Date: Sat Feb 10 03:29:58 2007 +0100 * Implement mathematical gramatics for seeks * flags output for registers in libps2fd * Temporally offset for single commands suffixing with '@' * get_offset handles flags too commit 8461506726ec81c657c4d7f43ecc35219213fb4b Author: pancake Date: Fri Feb 9 20:33:26 2007 +0100 * Minor code cleanup commit f6c2f6465a9cc21e611361ff92049c42201b69e7 Author: pancake Date: Fri Feb 9 20:11:36 2007 +0100 * Initial implementation of %VISUALCMD allows to run commands before the prompt * 'D' key removes the current flag in visual mode * Replace 'S' command with 'i * > file'. KiSS! * eyecandier info command output * accept user-defined block size in all print commands. * Add FMT_VISUAL in the print cycle of the visual mode * ':' prefix command allows to avoid verbose stuff commit 0e67dd7a8f187836751ec1dbfe136ee17596c430 Author: pancake Date: Fri Feb 9 00:39:16 2007 +0100 * New %VISUALCMD environ. it's the visual print mode. * %VISUALCMD works as a prompt callback too * %VISUALCMD can contain ':' prefixed to be a single command * Split radare_interpreter and radare_prompt * Split radare.c into cmds.c * Minor cleanup of error and warning messages * intro and backspace aliases 'j' and 'k' commit cc790f6fe658fdc1c1c2eaa3f235fb1ff8fb8290 Author: pancake Date: Thu Feb 8 20:11:42 2007 +0100 * Import the binary support patch for 'xc'. Thanks xscript for the contrib! * Update xc manpage * OFFSET environ not properly defined * Avoid creation of conflictive flags (non printable chars and starting with '+0-9' (Thanks esteve for this tip!) * Script commands not stored in history * flag '*' command, now uses 64 bit * Minor fixup in data_print for strange length cases commit 7acf061e57ade6e3162960ab7b6df2b53fc251e6 Author: pancake Date: Tue Feb 6 15:08:41 2007 +0100 * Up to 0.7.0-git * Fix a nasty bug in hexstr2bin * Check correct syntax for 'wx' command. * xc can convert bin stdin to hex pairs to stdout commit 853b1d845e3ef538518ef97b7be77635d0c32695 Author: User Date: Mon Feb 5 16:24:09 2007 +0100 * Implement support for hashing from stdin. Use '-' as filename. commit c82211e427e08f243bdbb6ef59aa8475aae449bf Author: pancake Date: Mon Feb 5 16:23:36 2007 +0100 * Poke command now happy with 'count' (thx esteve) * 'count' as alias of 'c'. * Cosmetic fixups in radare_write and radare_poke operations * Minor checkups in libexec/move * rsc now handles more than 4 args (buggy stuff) commit 04b635807bfd94755c7cb12ce266f092822d090d Author: pancake Date: Sun Feb 4 06:58:26 2007 +0100 * Arrow keys and re/av.pag keys working in visual mode * xcs octal values now can be prefixed with '0' (fex: 023) commit bae7fa6f14839ffabade531d7c68fa5cc6bd1a2a Author: pancake Date: Sun Feb 4 05:31:16 2007 +0100 * Remove 'EDITOR' and 'PAGER' environment variables * ENDIAN environ is not "little" or "big" (not 0, 1) * Minor cosmetic fixups for the previous commit * disassembly keystroke in visual mode now pauses commit e2cd50160e8fee6986326063c691dfa2d68ba4d7 Author: pancake Date: Sun Feb 4 05:19:40 2007 +0100 * Documentation for the radare shell environment variables * Documentation for script interpretation * rfile-foreach happy with ansi * write command now uses the 'count' variable. * Minor cleanup * Fix exoscripting pipe insanity when using libreadline * search engine looks like working again. Testers required * split into a new function the regexp search * search messages going to stderr * New '[' and ']' commands for changing the terminal width. * Initial simplification tests for the console width handling commit fdf511aeb9b0025ef1d9ad537012cd1054b4fd35 Author: pancake Date: Sat Feb 3 04:58:55 2007 +0100 * Some abi changes. requires make clean. * Implement eta and progress bar in rfile-foreach utility * Make libps2fd happy with gentoo. Needs more work * Add -u flag (unknown file size) * Fix block size < 0 bug in visual mode * Allow to change the terminal width using '[' and ']' keys. * rfile doesn't have to show me the $EME! * make radare be lseek aware * 'P' command is the inverse of 'p' in visual mode. * Visual mode is now displayed at top of the terminal commit ce85d83cb696a3e7b42c6b258a1a122bbc60c2ed Author: pancake Date: Sat Feb 3 03:27:47 2007 +0100 * Initial import of the flag documentation * Fix ugly bug in 'wx' command. Working again. Thanks esteve! * Some fixups and enhacements for the 'flag' command * Show escapped caracters using 'px' command. useful for 'w' * Fix hex2int conversion warning messages commit a34afc066ca21ddbb5490e9a8468c783b384fd2e Author: pancake Date: Fri Feb 2 21:20:21 2007 +0100 * bin2tab and tab2gml working nice with 2.16 and all kind of binaries. * Oops. missing system.h in previous commit commit eccacf0bbe0e86ad4b2216f27d70265e5451e20b Author: pancake Date: Fri Feb 2 20:39:17 2007 +0100 * Fixups on documentation for the new commands * bin2tab and tab2gml now completely fixed for non-stripped binaries * Some minor fixups for the debugging layer * Minor beuty for help commit a40ee4444c52e23ddfbc0c95abe942379e04e0a0 Author: pancake Date: Sun Jan 28 18:58:07 2007 +0100 * Minor cleanup of next/prev aligned block * Also install *tab* rsc libexec scripts commit dc6abd221ce80a419d8010f302ccfe85d5a011c7 Author: pancake Date: Sun Jan 28 05:20:46 2007 +0100 * Initial import of bin -> tab -> gml utilities for graphing binaries commit 89637e87d20b6e33039f4d7ad93aaba90e7def76 Author: pancake Date: Sun Jan 28 00:47:30 2007 +0100 * Prepare environment for .! command * Support for >>>> and <<< times command. commit 4b959261e73e48cec4072c28c27f36823cdc8936 Author: pancake Date: Sat Jan 27 23:57:15 2007 +0100 * RADARE_PRINT renamed to PRINTCMD * Add --without-readline configure flag * asm and dasm rsc commands now use random temporally file names (fixes race condition) * Prepare environment before command execution * Major cleanup of RADARE_ environment variables. Delegated to rsc * Externalize the make_tmp_file() functionality commit ac373dfc25a277434ca8e43aefaa653729c2bf8d Author: pancake Date: Sat Jan 27 14:41:22 2007 +0100 * Add --with-java configure flag * Strip down the changelog file * Make java stuff be able to build/install * Major rsc scripts renaming * Some minor fixups for some rsc scripts commit 5e71e2d2fbcfde4edfa8668fabf641ceb243b84d Author: pancake Date: Sat Jan 27 03:19:27 2007 +0000 * Major code syntax cleanup * Drop RADARE_MAGIC and RADARE_SCRIPTS. kissize * rsc command now supports ~/.radare/scripts too * Minor modularization of xrefs commit e329b0f975470c6bfc55670a96b3abcc50d4b7e1 Author: pancake Date: Thu Jan 25 18:38:24 2007 +0000 * Add some x86-64 fixups. Thanks wzzx! (needs more testing before release) commit 671fbfeb11da7beb0816e6a421906a93772c2a74 Author: User Date: Thu Jan 25 10:42:12 2007 +0100 * Initial import of the ffftoneg script * Show negative commented values on 0xffff bin2txt output * bin2txt now uses $OBJDUMP environ and fixes the md5 bin path commit baaee8ebff1c76dad7dab41920fb8933a13a6f42 Author: pancake Date: Thu Jan 25 02:25:07 2007 +0000 * Implement the .! command * Fix flag command (no read before caching) * beutify the flag output format commit 4866b6c55a05fc3c551d6d7572c9b9237de65b09 Author: pancake Date: Wed Jan 24 23:01:02 2007 +0000 * Fix no-readline build commit fabca8d154eeac28782e7a797b92e8ca38cf5aea Author: pancake Date: Wed Jan 24 21:53:33 2007 +0000 * Fix some configuration tips (gnu-readline+debugger related) * Some notes of the debugger on bsd and gentoo-gnu-linux * Add new flag --with-debugger that enables the build of the libps2fd commit 31549ae5d676caa4b595145801a6d9a744713598 Author: pancake Date: Tue Jan 23 17:24:02 2007 +0000 * Oops(2) missing Makefile for libps2fd makes build unhappy commit 9c6ac40eb5140ebcd68d7b80ea242743a0758a7c Author: pancake Date: Tue Jan 23 00:03:03 2007 +0100 * Oops. missing Makefile.acr in previous commit * New debugger command "pid" * Some minor fixups on doc and code for the debugger commit 5945ddd74b6346ed9f2e03e860291500f1442c55 Author: pancake Date: Sun Jan 21 21:15:18 2007 +0100 * Minor cosmetic changes * Start thinking on a better design for breakpoints commit 6519bb9b689297d36781be6a54c1a65a2d40581a Author: pancake Date: Sun Jan 21 18:09:08 2007 +0100 * rfile not supports ~/.radare/magic/ database too * change rfile argument order (magic file is optional now) * mrproper must clean all files generated by acr * debian.sh happy with libexec (avoid install wrong files) * findrawsyms fixed (perl -> rsc) * spcc now prints a template example with -t * pU command is now launched from dump_and_process (FMT_USER) * Minor memory leak fixed * fix 'bsize' command. arg0 && for each loop * Add -V to hasher * hasher short help message fixed commit 9a8eee0c830ea1b06d0de0edc7e8f1f5dfac29fd Author: pancake Date: Sun Jan 21 16:27:36 2007 +0100 * Wrapper for the write() command * Help message for debugger is in previous commit commit befadaf119ab9729bd9b902b1dd6e2d4075ced26 Author: pancake Date: Sun Jan 21 16:20:51 2007 +0100 * debian.sh cleanup to avoid manual changes * debug_write() implementation * basic breakpoint implementation for libps2fd * minor debugger code cleanup * use breakpoints inthe demo commit 6748b130a15d20cd099945b0a72870735ad3f96a Author: pancake Date: Sun Jan 21 05:25:03 2007 +0100 * Fix some minor bugs. double free still there. * Add syms-dbg-flag to map symbols of running processes * Beutify the error messages of radare when working with unbounded files commit 79cfe1a8aa31b94dab38b0ad9705f4454937cf32 Author: pancake Date: Sun Jan 21 04:37:25 2007 +0100 * Initial import of the debian package builder commit 22b9c42378322320aa6c953d000e9b025a75b0ec Author: pancake Date: Sun Jan 21 03:47:46 2007 +0100 * Initial import of radaredbg: the debugging frontend for radare * Update version to 0.6.7 * Oops on previous commit commit 968c7cc9c8b8f8ccf77b335447b5b9c61975f602 Author: pancake Date: Sun Jan 21 03:32:03 2007 +0100 * Initial import of the ps2fd library. (debugging support for radare) * commit 3002cce48a2eab8e4d01098289ce95e00b5d4022 Author: pancake Date: Sat Jan 20 16:44:21 2007 +0100 * Initial implementation of the wrapped line parser for pipe support * Pipes allows me to remove commands like 'dump'. Use 'pr > file' instead * Implement language wrappers for user-defined data block parsers * spcc = structure parser for C. Implemented as an 'rsc' command * Documentation for the new readline command parser. (doc/shell) * Fix syms-flag utility. * Remove config.input variable everywhere! * New print format FMT_USER available from 'pU' using the %RADARE_PRINT environ commit 48cb49f7fa6193358ade1524a74a6d4d1e327ea9 Author: User Date: Wed Jan 17 17:04:09 2007 +0100 * Implement the 'S' command aka StoreState for easy load/store projects * Documentate the way to flag symbols in doc/elf-tutorial * libexec/syms is now happy with -h. Avoid automatic a.out handler * Status info 'i' command dups the write_mode variable. Shorter columns * New rsc helper commands: syms-flag and elf-base-addr commit d15e14f0396d182dcace42fcdfa2b9e47e334b2c Author: User Date: Tue Jan 16 22:28:16 2007 +0100 * Implement next/prev keys for moving between flags in visual mode * Autocomplete the 'm' command as 'move' * Autocomplete the 's' command as 'seek' * The move command can only be used in write mode * Kissize and fix the '<' and '>' commands * Restore config.seek when the search is finished * Show flag name (if exists in current offset) in visual mode * Avoid redraw screen when invalid key is pressed. commit 6529032ef6fcc13095d4d81c8ae1f88f130f079b Author: User Date: Tue Jan 16 18:08:54 2007 +0100 * support for octal-hexa conversions in 'xc'. * split search stuff from radare.c to search.c * 'b' command is now autocompleted as 'bsize' * uchar[1] -> uchar fixup on visual.c * initial map-struct documentation (requires rfile changes) commit 05fcf465acc747bac1b538a9de5d1bc28d520a49 Author: User Date: Tue Jan 16 11:06:46 2007 +0100 * Search engine is now happy with -v * Cleanup warnings in xrefs.c * Implement ~/.radare_history stuff (thx pof) * Fix get_offset stack noise. (inititalize ret = 0) (thx viric) * Up to 0.6.6 commit 58b2ff91b10b27c04e89b3f223448f000f804edd Author: pancake Date: Sun Jan 14 03:39:58 2007 +0100 * Create and install bug manpage * Minor eyecandy rsc scripts fixups commit d2fa9216de74e5e5e016302890c4da4472035b81 Author: pancake Date: Sat Jan 13 22:42:31 2007 +0100 * Initial import of the gdl2gml utility * Initial import of rfile-foreach, for file-like carving * Some minor syntax upgrades on perl scripts * Fix rfile to be used by rfile-foreach * Fixup for tracelf. Happy with the share/scripts -> libexec movement (oops) commit b3d53cabe6b845a7aa967b82b3b1813fc4443346 Author: pancake Date: Mon Jan 8 02:22:09 2007 +0100 * Initial import of the viriks 'bug' utility for bugtracking. * Help fixed on read and write commands. * Fix make clean (xc and xrefs not removed) commit f3245c0605ab6928a4c0dc862665118e741ce891 Author: pancake Date: Sat Jan 6 18:45:47 2007 +0100 * Write out and install the rest of manpages * Minor fixups in bindiff and bdcolor * Standarize no-args help message in radare and hasher * Make rfile happy at a desired offset * Move print-related stuff to print.o commit 3703b96f6fff46381e14b17a370091fcb34df47f Author: pancake Date: Sat Jan 6 06:08:45 2007 +0100 * Use $libexecdir/radare instead of $datadir/radare/scripts * Initial import of the major part of the radare manpage * Drop usable command from the command line interface (scroll sux) * Force a certain environment * Fix 'open' in read-write to avoid problems when commit 1c86527cfe677654d797efa7fd13fc44325d4341 Author: pancake Date: Thu Jan 4 18:41:19 2007 +0100 * Initial working stuff for the bindiff utility * Rename bdiff to objdiff to avoid missinterpretations * Fix Makefiles to install xrefs, xc and bindiff * Add 'bdcolor' script to colorize bindiff output commit 8d7c9aa20db8798f278f3eee59e85226c2eb0012 Author: pancake Date: Wed Jan 3 00:13:32 2007 +0100 * Import of the offline workage at 23c3 * Initial import of xrefs and xc utilities * New rsc helper utilities: add, syms and symxrefs commit abb1b864b195e77a8399700361475f917873442b Author: pancake Date: Fri Dec 8 02:53:03 2006 +0100 * include termios.h to use struct winsize * add some missing readline autocompletion commands * note for future libedit support * check build on gnusolaris, netbsd, freebsd, bluewall and ubuntu * acr 0.5.2 fixups for portability commit ea93b20c361b8b0ce1bf9e4803b71eb18f9ff8fb Author: pancake Date: Thu Dec 7 02:04:35 2006 +0100 * initial import of the java-radare API * seek to flag as a keystroke callback * better use of internal conversion functions (code cleanup) * fixes for char -> unsigned char * fix build on BSD systems (do the cleanup) commit 1dcb3cc6d995e990396b349a0fc9da0891c1e84c Author: pancake Date: Wed Nov 29 00:09:28 2006 +0100 * cleaner dump output string * radare_dump_and_process moved to utils.c * array-based format cycling of visual mode * disassembly is now a print format (pd) * cleanup for radare cmdline flags (drop -n and -W) * beutify README and initial manpage skel * more kisses: drop '(' command (math) commit e59789d068d478b344e46226f2b9e235422565bc Author: pancake Date: Tue Nov 28 22:03:12 2006 +0100 * kissize some output strings to make pipes happy * cleanup major hasher code and help * write string command now escapes \x hexa strings too * make hasher happy again * add more security checks in the hasher header * KiSS: Drop the networking stuff. Use 'nc -c 'radare file' -l -p 9999' instead commit 126a841a5235ac56f60653a25d76787d1da34966 Author: pancake Date: Tue Nov 28 18:29:40 2006 +0100 * refix xtrace script for better cmdline experience * show_help_message moved to commands.c * initial implementation of the command infracture for visual mode. * support for file creation with -w * initial implementation * fix 32 bit endian swap overflow commit 85d4df7e8fc9e7260ffa9c7a246afa1dfb97e762 Author: pancake Date: Mon Nov 27 20:34:09 2006 +0100 * Add '<' and '>' commands for the visual mode * Real import of the xtrace rsc command * Better syntax indentation for readline.c commit 11823b93dd56c3049193304418727f13414e63eb Author: pancake Date: Mon Nov 27 01:58:08 2006 +0100 * Initial import of xtrace * drop script filename extensions * Some minor fixups on sockets commit 34d9a4da957a771b07449d26eaa3b8f729eb8eaa Author: pancake Date: Sun Nov 26 13:38:17 2006 +0100 * Fixups for the rsc caller for non-shell scripts. * Fix pX command. * Initial import of read.sh commit cc59d74b8eea0bb384a704b2732720aefee125ce Author: pancake Date: Fri Nov 24 00:49:10 2006 +0100 * minor fixups on asm.sh * initial import of rsc and rfile commands to ease magic and scripts usage. * initial import of 'write.sh' script commit cb02cefb1d46806736c14c13551247e72767450e Author: pancake Date: Wed Nov 22 01:55:29 2006 +0100 * initial import of 'write.sh' script * '*' command has been deprecated in pro to '!echo' usage * 'm' command in visual mode magics the current block commit 6a122cd991f238c3f3ea73ad5c1b4694767423cb Author: pancake Date: Sun Nov 19 16:32:52 2006 +0100 * import scripts/ objdump-output-beutifier.pl and make_symbolmap.sh * shellcode printage 'FMT_ASHC' * readline autocompletion for boolean values * move visual stuff to visual.* * 'flag -' command clears all flags. * environ is now prefixed as '%' instead of '$' * fix unlimited files support (f.e: /dev/mem) * add octal dump printage * drop '-e' flag from hasher * move config stuff to config.* commit b7eaed270432be1d139cfb9c4d6cbea3caf56d3b Author: pancake Date: Tue Nov 14 23:32:30 2006 +0100 * fix search engine again (n) * better regexp support for searches commit 3e4a47feef2bc79f1d65ce5036d9ce9eb02f0a1c Author: pancake Date: Sat Nov 11 12:08:09 2006 +0100 * add 'i' insert mode for visual mode * initial regexp support for searches * fix help messages for Poke, ps and flag commands * integrate environ as default configuration layout * flag list now shows the index * allow to remove/clear flags using the '-' prefix * add '$' command for environment handling commit 20322118b1ee2fbb36661c00c35807a2aaf50365 Author: pancake Date: Fri Nov 10 18:46:02 2006 +0100 * fixed -v (drop verbose) writes. * fix some memory allocation bugs provided by the readline history * avoid integer overflow bug * fix relative seeks commit 3181c43ccfc51df2f2b318718104666701b2d9fb Author: pancake Date: Tue Nov 7 02:27:53 2006 +0100 * Fix small bug in configure script * drop verbosity on searches for better cmdline sensation * initial import of 'findrawsyms' and 'symdump' commit ae04121a6b4a5db012873d780adfd8698a12699d Author: pancake Date: Sun Nov 5 15:02:53 2006 +0100 * Some fixups on tracelf, add support for script comments (';') * Add minor disassembly documentation. * OWN->PWN typo fixup in README x"D commit 9d503fb708744db49f900e81387b9a7920581480 Author: pancake Date: Sun Nov 5 14:19:28 2006 +0100 * More workage on tracelf. commit 7e99e843dfa74874312a71c40f6a34dbf337e9cb Author: pancake Date: Sun Nov 5 04:08:29 2006 +0100 * initial import of scripts/tracelf.pl * add 'pX' print format (hexadecimal string) (c&p friendly) commit 7c0255f45a7eb7d46076c0ceae4dda252112a3c2 Author: pancake Date: Sat Nov 4 18:17:49 2006 +0100 * Install scripts, magic and documentation stuff too * Use PAGER and RADARE_SCRIPTS env for better disassembly pleasure. commit b6f9601aef64c2348e4ea9f3cef25a384d600c00 Author: pancake Date: Sat Nov 4 16:43:48 2006 +0100 * take care on out of band searches, got ^C inside internal loop too. * 'H' and 'L' keys in visual mode allows you to move by words (2 bytes) commit c3806887e852e73e66143ccadf0f65bc22bfa31a Author: pancake Date: Sat Nov 4 16:12:38 2006 +0100 * fixes for file size = -1 (/dev/mem for example) * 'p' key inside visual mode changes between bin,hex,string modes * fix zero-div bug in hasher * new command called "Poke" (inverse dump) commit a9936f77f23c5e9c7e9d8ba2dde751e4ba4c795d Author: pancake Date: Sun Oct 29 15:23:02 2006 +0100 * visual search between search results 's#' (0-9) * flag search results * fix 32-64 bit off_t stuff using OFF_FMT defines * Add help message and stdin asm read for asm.sh commit 92502d09a7406122f11b521b05c7c84f3e7caff4 Author: pancake Date: Sun Oct 29 03:43:21 2006 +0100 * add 'G' key and help message to the visual mode * avoid segfaults when opening large files * fix 32/64 bits bug, start sanitize process via cpp commit 4368f128bfd884ebc37ee2e9a698341b7c8fa10a Author: pancake Date: Sun Oct 29 02:17:00 2006 +0100 * enforce disassembly features inside the visual mode * alias for limit, resize, endian, flag, seek and help * cleanup starting spaces * some fixes on input parsing for short and long command names * implement '(' command for math ops * implement visual help commit ebbfd47fa738917b5b77f121217abca040a17a73 Author: pancake Date: Sat Oct 28 20:36:50 2006 +0200 * Up to 0.4 * 's' aliased as 'seek' commit 41b004205d938d343b2b344aceaafd013198dc2b Author: pancake Date: Sat Oct 28 20:26:30 2006 +0200 * Major warn cleanup * Initial import of the Visual mode * commit 58be5b4c7f03281f5cf027488e14cf4e662c176d Author: pancake Date: Sat Oct 28 04:48:29 2006 +0200 * Support for binary printint and viewing (to hubble ;) * Fix bug in decimal endian (drop 'vd' in pro to 'vi') * 'd' command is now aliased as 'd*' like 'dump' commit d7ba6a53f2790f7b646e020af2d81cda5ec3bd1f Author: pancake Date: Thu Oct 26 18:29:27 2006 +0200 * Initial import of the bdiff tool * Initial workage on file magic db commit b8313c85ba0fef2f46af7cce1ff99b3f0cf31081 Author: pancake Date: Tue Oct 24 12:52:30 2006 +0200 * Woops, looks like something is wrong, in relative offsets. must be fixed commit 2db20de3805ae4234b088a1f63a899e3efb6a3f4 Author: pancake Date: Tue Oct 24 12:18:11 2006 +0200 * Store and show a piece of each flagged data in hexa commit cf6cd2f170958bb931c4cbbdcd33c6986f776b00 Author: pancake Date: Mon Oct 23 00:00:11 2006 +0200 * Add flagable ELF header script * More flag-related fixups. valgrind says: valgrind: the 'impossible' happened: Killed by fatal signal commit 62c491adb962ea098fdd73088bcd22a54e6bbfcb Author: pancake Date: Sun Oct 22 18:35:05 2006 +0200 * Initial import of the flags stuff * Autocomplete offsets with flag names too * Some fixups on read/seek stuff broken yesterday O:) commit 357f8e3786e72471315406f8ffd821b0095dc5ae Author: pancake Date: Sun Oct 22 05:02:31 2006 +0200 * Fix the -b -s -x conjunction for command line dumps * Add a simple example (elf-dump-header) for cmdline dumps commit 7de6ce80b1202c861d013e28d4d7a3a0efa08c0a Author: pancake Date: Sat Oct 21 20:36:50 2006 +0200 * Initial readline() support * Some fixups for cmdline entries * Upgrade version to 0.3.3 * Fix minor acr bugs commit acfd11f986cd57a2df96990bd878ea55314ac5f0 Author: pancake Date: Sun Oct 1 17:05:44 2006 +0200 * add -V flag (version information) * implement the -S flag(strings like with utf16 and verbose output)(mmap only) * print HEXB header before data_print (-v drops't) commit bb0e03814ae5168065dcfbc319a9d02cb5d18d62 Author: pancake Date: Mon Aug 28 15:15:07 2006 +0200 * Merge changes from the pluna repository. * Implement a hex pair string conversor. (/x) commit 3ac65fa3841ef7b5d247c88b1024372e1fa03b20 Author: pancake Date: Sun Aug 27 20:59:04 2006 +0200 * Some more fixups and code cleanup commit 19156bc7caae5b24ed8b24f81a3fa0defcf0b83a Author: pancake Date: Sun Aug 27 02:04:51 2006 +0200 * Fix search engine with binary string support commit 8b98463474e43d85427ef1b8b599f1d08d628d6b Author: pancake Date: Mon Jul 10 23:42:09 2006 +0200 * add command to interpret external files '.' * add '-v' flag to drop verbosity * echo echo command '*' * flag some prints as verbose to match -v flag commit 009093e9708bc5072cda7e9cfb8be2ec3a848921 Author: pancake Date: Mon Jul 10 21:20:11 2006 +0200 * Fix 'write' command for hexa strings. * Add support for comments ';' (useful for scripts) commit 43102b60303bb1e14634f495b3a037c398682717 Author: foo Date: Sun Jun 4 02:35:32 2006 +0200 * Add 'URL' encoding for the 'print' command. commit bfedb08ecb1b92caafb221eacac1b257e4687ca4 Author: foo Date: Fri Jun 2 11:30:05 2006 +0200 * call radare_read when seeking * warn when no whitespace after the 's' command. commit 4bee7bf0481266e9ed55eeeec37e4da5c898cf76 Author: pancake Date: Fri Jun 2 01:31:57 2006 +0200 * Bump version to 0.2.8 * Whoops, I was using a very old and buggy acr. commit a21b509a1d6fce5e1477fb2781eb6c2427b20b49 Author: pancake Date: Fri Jun 2 01:00:24 2006 +0200 * Initial import of the asm/dasm scripts commit ba4e27033c9fb313d8b0eaa5040cfab72ed7af5b Author: foo Date: Thu Jun 1 20:31:08 2006 +0200 * Fix data_print in HEX mode for odd sizes commit 66ccff70578d3146d472b5ea98a45f2ba090292d Author: foo Date: Thu Jun 1 00:39:55 2006 +0200 * Fix limits to <0 commit cf971873ef654f5febbbd765caf2393fa2a56996 Author: foo Date: Thu Jun 1 00:05:56 2006 +0200 * Add FMT_CSRC print format * Fix a more logical way to use the 'p' command. commit 758e771092e72e74409f226834153f0092e7d624 Author: pancake Date: Wed May 31 00:50:24 2006 +0200 * Implement hasher inside radare. * Add some notes about hasher. commit 15c63521ee108195cd483252004a1e6a8534c36b Author: pancake Date: Wed May 31 00:10:22 2006 +0200 * Implement unix and dos timestamps viewers * Fix 'd' command, that was buggy after the reformat. * Initial recoding for the search (strike 3) commit a9af966d904d7a87ddaa06eb3e912cf1b25ea995 Author: foo Date: Wed May 17 13:31:59 2006 +0200 * Implementation of 'm' command. * Fix 'wx' command * QuadWord and Dword views for 'v' command. * Drop the '/' separator for most commands. * Some minor internal fixups. * Drop '-y' flag. So it's senseless. commit e2951ff6267afab63b96c99d3fc22cb283475ad6 Author: foo Date: Wed May 17 00:19:10 2006 +0200 * Re-implementation of write command with hexa and string support. commit 9aed1c0d225feada9b5c9472a9d2e9105b6f56d6 Author: foo Date: Tue May 16 00:18:51 2006 +0200 * Fix offsets and seeks in hasher (now is working) * Fix the offset stuff in radare * Rename mode_t -> print_mode_t * Fix block size when resizing * Add '-s' seek flag to radare * Limit boundaries for seeks (>0) commit 9fb8d4441e0e8598834efa0b99c644af5db8688c Author: pancake Date: Sun May 14 16:54:18 2006 +0200 * Implement -x on radare * Implement -s on hasher * Up to 0.2.6 commit 57b273b4043fd5702c88e5945dd5bbf7c9316f1e Author: pancake Date: Sun May 14 15:07:16 2006 +0200 * Initial support of SHA1 support for hasher. commit aafe6a6adcd3f8e6f8f4efc25deb0122bb8fbd19 Author: pancake@pl2-netbsd Date: Sun May 14 04:14:11 2006 +0200 * Endian-aware hash file * Add crc32 support to the hasher * Offset and length support * Add '-o' to view the contents of a hash file * New header for hash-files with MAGIC commit eaa28c600ad9f530823a673e6ad171db242ca5a3 Author: xscript Date: Sat May 13 02:03:35 2006 +0200 * Non-working ultra code refactoring commit f866ea999a53589cc4943750aee26fecf69b8d78 Author: pancake Date: Mon May 8 23:40:40 2006 +0200 * Fix the 64bit-endian fight against GLIBC * Force the use of a 64 bit POSIX-OS. ( byebye w32! ) commit cb7bd107f1d8c83e97c6a5c5840a085124e2b2d1 Author: pancake Date: Sat May 6 16:19:25 2006 +0200 * Fix 64 bit endian problems. * Too huge changelog to describe commit d3ad8f7e318a9d774471807a00a30db3f31619b1 Author: foo Date: Wed May 3 15:08:41 2006 +0200 * Adopt a portable strategy for the GNU dprintf() commit 534e2091e0aa99dea84a21731a5754c9ac270c5c Author: pancake Date: Wed May 3 00:56:20 2006 +0200 Upgrade to 0.2.2 * TCP remoting finished and working. * CafeBabe.sh script example is now working. * Implement -q and -L for command line scripts. commit 351201986f0b7b447702445d3234301deccacb5e Author: pancake Date: Mon May 1 04:10:50 2006 +0200 * Initial import of the remote scripting commit 38298ca8e705205b0fdac89d6f37af2ee9e699bc Author: pancake Date: Mon May 1 04:09:47 2006 +0200 * Add 'v' (view) command * Manage endiannes * Initial remote TCP support commit 69c395b8475688a308795e1a607265d8976a0c39 Author: pancake Date: Mon May 1 03:55:41 2006 +0200 * Check for endiannes in ACR commit fdfb4ebfd8464a63a75b003b8ba4a4e392afc122 Author: root Date: Thu Apr 13 00:45:07 2006 +0200 * Fix distfile generation ignoring .git files commit 829ca4d578f33669c7c3af5ef09f6175ebc6c111 Author: root Date: Wed Apr 12 16:56:44 2006 +0200 * Initial import of radare into the git. /* older hand-made history */ 0.1.2 - Add 'hasher' utility - Fix perms of the creation files - Drop '-f' flag from radare - Fix segfault on small files 0.1 - initial release radare-1.5.2/HISTORY000066400000000000000000000022171141417717500140530ustar00rootroot00000000000000radare started in 2006 aiming to write an hexadecimal editor capable to find data on large volume disks to recover a file from an HFS+ partition. Lot of things has changed since then. The project has grown to try to provide a complete framework for working with binary files. The framework can be understood as a reverse engineering tool, but it is in essence an assembler/disaseembler, debugger, code analyzer for arm, java and intel, audit tool, data recoverer, usb sniffer, process tracer, forensics.. --pancake Here's a little timeline of the radare release history: 1.4.1 - 2009-06-12 1.4.0 - 2009-06-03 1.3.0 - 2009-04-25 1.2.2 - 2009-03-07 1.2.0 - 2009-01-26 1.1.0 - 2008-12-31 1.0.0 - 2008-11-08 0.9.8 - 2008-07-19 0.9.7 - 2008-06-21 0.9.6 - 2008-05-21 0.9.4 - 2008-03-13 0.9.2 - 2008-01-12 0.9.1 - 2007-12-25 0.9.0 - 2007-12-13 0.8.8 - 2007-10-27 0.8.6 - 2007-08-27 0.8.2 - 2007-07-22 0.8.0 - 2007-04-28 0.7.2 - 2007-03-18 0.6.8 - 2007-02-05 0.6.4 - 2007-01-14 0.6.2 - 2007-01-07 0.4.0 - 2006-10-28 0.3.3 - 2006-10-21 0.2.8 - 2006-06-02 0.2.6 - 2006-05-14 0.2.2 - 2006-05-03 0.1.0 - 2006-02-12 radare-1.5.2/INSTALL000066400000000000000000000026571141417717500140300ustar00rootroot00000000000000================== Installation notes ================== radare supports two kind of build systems: ACR and WAF ACR is basically a minimalistic replacement of autotools written in shellscript. You can get more information about it in: http://nopcode.org/wk.php/Acr or: hg clone http://hg.youterm.com/acr WAF is a modern work-in-progress python-based build system. Currently both systems are known to work on most systems, but there are some issues for ACR on Windows, OpenSolaris, and other proprietary systems. But it should properly work on all Free *nix systems like GNU/Linux, NetBSD, OpenBSD, FreeBSD on 32/64 bits. I recommend If you experience any problem building radare. Please ping me to pancake HOW TO COMPILE: Standard way: $ ./configure --prefix=/usr $ make $ sudo make install Alternative (going to be deprecated, and probably buggy) $ ./waf configure $ ./waf to clean the build, update waf or cleaning the db: $ ./waf distclean COMPILATION TIPS: OpenSolaris (SunOS): $ ./configure --prefix=/usr $ gmake && gmake install INSTALL=ginstall Mingw32: $ CC=mingw32-gcc ./configure --enable-w32 --prefix=/usr/ --without-vala --without-gui Desktop GNU/Linux: $ ./configure --prefix=/usr --with-sysproxy NetBSD box: $ CFLAGS=-I/usr/pkg/include LDFLAGS=-Wl,-R/usr/pkg/lib ./configure --prefix=/usr/pkg Other unixes $ ./configure --prefix=/usr --without-vala --without-gui radare-1.5.2/Makefile.acr000066400000000000000000000152771141417717500152050ustar00rootroot00000000000000include config.mk DESTDIR?=/ VERSION=@VERSION@ VPATH=${DESTDIR}@VPATH@ BINDIR=${DESTDIR}@BINDIR@ SHAREDIR=${DESTDIR}@DATADIR@ MANDIR=${DESTDIR}@MANDIR@ LIBDIR=${DESTDIR}@LIBDIR@ LIBEXECDIR=${DESTDIR}@LIBEXECDIR@ .PHONY: all clean mrproper install deinstall w32dist dist distfree omni arm release uninstall all: ##HAVE_GUI## cd vala/ && ${MAKE} all ##HAVE_GUI## cd src && ${MAKE} all ##USBSNF## -cd libusbsniff && ${MAKE} all ##USBSNF## cd src/rabin && ${MAKE} all cd src/rasm && ${MAKE} all ##HAVE_GUI## cd gui && ${MAKE} all ##HAVE_GUI## # Use ^X^O and ^N / ^P in vim omni: exuberant-ctags **/*.c **/*.h clean: cd vala/ && ${MAKE} clean cd src && ${MAKE} clean cd src/rabin && ${MAKE} clean cd gui && ${MAKE} clean cd src/dbg && ${MAKE} clean cd java && ${MAKE} clean cd vala/grava && ${MAKE} clean cd libusbsniff && ${MAKE} clean w32dist: mkdir -p w32-build cp src/radare.exe w32-build cp src/rax.exe w32-build cp src/xrefs.exe w32-build cp src/rahash/rahash.exe w32-build cp src/rabin/rabin.exe w32-build cp src/javasm/javasm.exe w32-build cp src/radiff/radiff.exe w32-build cp src/radiff/rdbdiff.exe w32-build -cp src/radiff/bdiff/bdiff.exe w32-build cp src/rasm/rasm.exe w32-build mv w32-build radare-${VERSION}-w32 zip -r radare-${VERSION}-w32.zip radare-${VERSION}-w32 scp radare-${VERSION}-w32.zip radare.org:/srv/http/radareorg/get arm: all mkdir -p pkg ${MAKE} install DESTDIR=pkg/ mkdir -p pkg/usr/lib -cp /usr/lib/libreadline.so.5 pkg/usr/lib -cp /usr/lib/libtermcap.so.2.0.8 pkg/usr/lib cd pkg && tar czvf ../radare-${VERSION}-arm.tar.gz * mrproper: clean -rm -f src/Makefile Makefile dist: FILES=`hg status -mc|cut -c 3-|sed -e s,^,radare-${VERSION}/,`; \ cd .. && mv radare radare-${VERSION} && \ tar czvf radare-${VERSION}.tar.gz $${FILES} ;\ mv radare-${VERSION} radare #scp radare-${VERSION}.tar.gz radare.org:/srv/http/radareorg/get/shot distfree: FILES=`hg status -mc|grep -v ppc_disasm|cut -c 3-|sed -e s,^,radare-${VERSION}-free/,`; \ cd .. && mv radare radare-${VERSION}-free && \ tar czvf radare-${VERSION}-free.tar.gz $${FILES} ;\ mv radare-${VERSION}-free radare shot: DATE=`date '+%Y%m%d'` ; \ FILES=`hg status -mc|cut -c 3-|sed -e s,^,radare-$${DATE}/,`; \ cd .. && mv radare radare-$${DATE} && \ tar czvf radare-$${DATE}.tar.gz $${FILES} ;\ mv radare-$${DATE} radare && \ scp radare-$${DATE}.tar.gz radare.org:/srv/http/radareorg/get/shot release: mrproper FILES=`hg status -mc|cut -c 3-|sed -e s,^,radare-${VERSION}/,`; \ cd .. && mv radare radare-${VERSION} && \ tar czvf radare-${VERSION}.tar.gz $${FILES} ;\ mv radare-${VERSION} radare && \ scp radare-${VERSION}.tar.gz news.nopcode.org:/home/www/radarenopcode/get/ install: cd src/rsc && ${MAKE} install DESTDIR=${DESTDIR} mkdir -p ${BINDIR} ${MANDIR}/man1 ${MANDIR}/man5 ${SHAREDIR}/radare/ ${SHAREDIR}/doc/radare ${LIBEXECDIR}/radare ${INSTALL_SCRIPT} src/rsc/rsc ${BINDIR} ${INSTALL_PROGRAM} src/radare ${BINDIR} -${INSTALL_PROGRAM} src/radiff/radiff ${BINDIR} ${INSTALL_PROGRAM} src/rabin/rabin ${BINDIR} ${INSTALL_PROGRAM} src/rasm/rasm ${BINDIR} ${INSTALL_DATA} src/arch/arm/aasm/mnemonics ${SHAREDIR}/radare/ ${INSTALL_PROGRAM} src/rasc/rasc ${BINDIR} ${INSTALL_PROGRAM} src/rahash/rahash ${BINDIR} ${INSTALL_PROGRAM} src/rax ${BINDIR} cd src/rsc && ${MAKE} install ${INSTALL_PROGRAM} src/lsbstego ${LIBDIR}/radare/bin ${INSTALL_PROGRAM} src/javasm/javasm ${LIBDIR}/radare/bin -${INSTALL_PROGRAM} src/arch/arm/aasm/armasm ${LIBDIR}/radare/bin -${INSTALL_SCRIPT} src/radiff/bindiff-ng/bindiff-ng ${LIBDIR}/radare/bin -${INSTALL_PROGRAM} src/radiff/bdiff/bdiff ${LIBDIR}/radare/bin mkdir -p ${LIBDIR} # install plugins mkdir -p ${LIBDIR}/radare cd src/plug/hack/ && ${MAKE} install # TODO remove? -mkdir ${LIBDIR}/radare cd api && ${MAKE} install DESTDIR=${DESTDIR} #-cp -rf src/plug/hack/*.${SHARED_EXT} ${LIBDIR}/radare if [ -e libaff2fd/libaff2fd.so ]; then ${INSTALL_LIB} libaff2fd/libaff2fd.so ${LIBDIR} ; fi ##DEBUGGER## # ${INSTALL_LIB} src/dbg/libps2fd.so ${LIBDIR} ##DEBUGGER## ##USBSNF## -${INSTALL_LIB} libusbsniff/libusbsniff.so ${LIBDIR} ##USBSNF## if [ -e libusbsniff/libfdsniff.so ]; then ${INSTALL_LIB} libusbsniff/libfdsniff.so ${LIBDIR} ; fi ${INSTALL_SCRIPT} src/xrefs ${BINDIR} ${INSTALL_SCRIPT} src/radiff/radiff ${BINDIR} #${INSTALL_SCRIPT} src/rdb/rdbdiff ${BINDIR} ${INSTALL_SCRIPT} src/rfile ${BINDIR} ${INSTALL_MAN} man/rasc.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rasm.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/radiff.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/gradare.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rabin.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/radare.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rahash.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rsc-bindiff.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/xrefs.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rsc.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rfile.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/rax.1 ${MANDIR}/man1/ ${INSTALL_MAN} man/radarerc.5 ${MANDIR}/man5/ ${INSTALL_DIR} ${SHAREDIR}/radare/ ${INSTALL_DIR} ${SHAREDIR}/radare/magic ${INSTALL_DATA} magic/* ${SHAREDIR}/radare/magic/ ${INSTALL_DIR} ${SHAREDIR}/doc/radare -${INSTALL_DATA} doc/* ${SHAREDIR}/doc/radare/ ${INSTALL_DIR} ${SHAREDIR}/doc/radare/xtra ${INSTALL_DATA} doc/xtra/* ${SHAREDIR}/doc/radare/xtra ##HAVE_GUI## cd gui && ${MAKE} install DESTDIR=${DESTDIR} ##HAVE_GUI## install-strip: install -strip -s ${BINDIR}/gradare -strip -s ${BINDIR}/radare -strip -s ${BINDIR}/rahash -strip -s ${BINDIR}/radiff -strip -s ${BINDIR}/rabin -strip -s ${BINDIR}/xrefs -strip -s ${BINDIR}/rasm -strip -s ${BINDIR}/rasc -strip -s ${BINDIR}/rax uninstall deinstall: -rm -f ${BINDIR}/gradare -rm -f ${BINDIR}/radare -rm -f ${BINDIR}/rahash -rm -f ${BINDIR}/rasm -rm -f ${BINDIR}/rasc -rm -f ${BINDIR}/rax -rm -f ${BINDIR}/xrefs -rm -f ${BINDIR}/rsc -rm -f ${BINDIR}/rfile -rm -f ${BINDIR}/rabin -rm -f ${BINDIR}/bdiff -rm -f ${BINDIR}/lsbstego -rm -f ${BINDIR}/armasm -rm -f ${BINDIR}/javasm -rm -f ${BINDIR}/radiff -rm -f ${LIBDIR}/libps2fd.so -rm -f ${LIBDIR}/libaff2fd.so -rm -f ${LIBDIR}/libusbsniff.so -rm -f ${LIBDIR}/libfdsniff.so -rm -f ${LIBDIR}/python2.5/radare.py # TODO: remove ruby/lua/perl bindigns here -rm -f ${DESTDIR}/${SHAREDIR}/radare -rm -rf ${LIBDIR}/radare -rm -rf ${SHAREDIR}/radare -rm -rf ${SHAREDIR}/doc/radare -rm -rf ${LIBEXECDIR}/gradare/ -rm -rf ${LIBEXECDIR}/radare/ -rm -f ${MANDIR}/man1/rabin.1 -rm -f ${MANDIR}/man1/rfile.1 -rm -f ${MANDIR}/man1/xrefs.1 -rm -f ${MANDIR}/man1/gradare.1 -rm -f ${MANDIR}/man1/rax.1 -rm -f ${MANDIR}/man1/radiff.1 -rm -f ${MANDIR}/man1/rasm.1 -rm -f ${MANDIR}/man1/rsc.1 -rm -f ${MANDIR}/man1/radare.1 -rm -f ${MANDIR}/man1/rsc-bindiff.1 -rm -f ${MANDIR}/man1/rahash.1 -rm -f ${MANDIR}/man1/rasc.1 -rm -f ${MANDIR}/man5/radarerc.5 radare-1.5.2/README000066400000000000000000000145211141417717500136500ustar00rootroot00000000000000 __--~. .-'_ ,' | .' \ | / | |> ) / \ | /." _ _ _ _ _ .-^_| |\ \ |_| | \ |_| |_/ /_ \/ -| '. ' | | |_/ | | | \ \_ pwn them all SHORT radare is a commandline hexadecimal editor. DESCRIPTION Radare is a toolkit framework for working with binary files having the unix philosphy in mind. It was born with simplicity in mind. The core of it remains on the command line hexadecimal editor that it aims to provide a helper tool for reverse engineering, exploiting, fuzzing, binary and data analysis. hasher is a hashing utility that allows to hash pieces of files and generate reports of changes. This is useful for hard disk analysis, reversing, binary diffs, system programs integrity, etc. radare comes with a set of IO plugins that wraps all open/read/write /seek/close/system calls. This way several plugins has been implemented: $ radare -L haret Read WCE memory ( haret://host:port ) debug Debugs or attach to a process ( dbg://file or pid://PID ) gdb Debugs/attach with gdb (gdb://file, gdb://PID, gdb://host:port) gdbx GDB shell interface 'gdbx://program.exe args' ) shm shared memory ( shm://key ) mmap memory mapped device ( mmap://file ) malloc memory allocation ( malloc://size ) remote TCP IO ( listen://:port or connect://host:port and rap:// ) winedbg Wine Debugger interface ( winedbg://program.exe ) socket socket stream access ( socket://host:port ) serial serial port access ( serial:///path/to/dev:speed ) gxemul GxEmul Debugger interface ( gxemul://program.arm ) ewf EnCase EWF file support ( ewf:// ) posix plain posix file access Currently I'm working on a Vala frontend to provide an object oriented api for directly interfacing with the core of radare and provide a complete graphical frontend. FEATURES rasc - shellcode helper tool - generates paddings with A's, nops, CCs and enumerations (00, 01, 02, ..) - most common use shellcodes hardcoded inside - x86 32/64, arm, powerpc - linux, bsd, solaris, darwin, w32 - HOST, PORT, CMD shellcode alteration - syscall proxy server - output in - raw - hexpairs - C unsigned char array - execute shellcode (for local testing) rasm - commandline assembler/disassembler - supports x86, olly, java, powerpc... - can support any other arch supported by GAS using 'rsc asm' - assembling from text file to raw object - you can specify the offset and endian manually - can disassemble from an hexpair string rabin - show information about ELF/PE/MZ/CLASS files - entrypoint - imports - exports - symbols - libraries - sections - checksums - integration with radare core rahash - generates and checks block checksums of a file - can hash from stdin - supports multiple hashing algorithms - md4, md5 - crc16, crc32 - sha1 - par, xor, xorpair - hamdist - entropy radiff - integrates bdiff, bindiff, bytediff and rdbdiff into a single program - generates a raw binary difference between two files - recommended to use together with bdcolor $ bindiff a b | bdcolor 3 rsc - contains helper scripts for working with binary files - asm/dasm - asm->hexpairs / hexpairs->asm - bdcolor - colorizes and filters the bindiff output - bytediff - byte per byte binary diff (faster than bindiff, less accurate) - spcc - structure parser c compiler - rfile-foreach - find magic signatures on a raw file - adict - assembly dictionary - bin2txt - generates a template text file with info and disasembly of a binary - bin2tab | tab2gml - generate a graphml with the program reference calls - syms-xrefs - find crossed references to each symbol of a binary ... and much more ... radare - cli and visual modes - yank and paste - perl/python scripting support - virtual base address for on-disk patching - vi-like environment and command repetition (3x) - debugger for x86-linux/bsd and arm-linux - data bookmarking (flags) - scripting (no branches or conditionals yet) - own magic database (rfile) - little/big endian conversions - data search - multiple keywords at the same time - binary masks - input format: ascii/binary/widechar - ranged searches ( /r 0-2 ) - show xrefs on arm, x86 and ppc binaries - data type views: - integer/long/longlong/float/double - binary dos/unix timestamps - octal - hexadecimal (byte, word, dword, qword) - data block views: - hexadecimal - octal - binary - ascii string - widechar strings - url encoding - shellcode (gas format) - c char* array - analysis (pA 30 @ esp) - disassembly - native x86/arm - allows to use objdump or any other external command - pseudocode syntax - colorization - inline comments and labels - visual mode commands - gotoxy command to create your own composed views - screen fit - colorization of almost everything - on the fly disassembly - apply magic on current block - hjkl-style scrolling - print format cycling - cursor mode and yank/paste feature debugger - support for x86-linux/bsd and arm-linux - next planed ports: x86.64-linux, w32 and x86.solaris - tracing with multiple verbose levels - dump/restore of the process - full filedescriptor control - backtrace viewer - attach/detach - code injection - breakpoints (software, hardware) - watchpoints (software, hardware) - raw drx control - full gpregs and fpregs control - continue until user code - step into, step over - continue until syscall (strace like) - supports ktrace on openbsd and netbsd - raw memory management of the target process - common hacks can be automatized with keybindings - full signalling control of the target process - /proc/pid/maps info support - ollydbg-like keybindings (F7 step , F9 continue, ...) -- Dedicated to the girl I have loved, hated and loved. AUTHOR pancake <@youterm.com> radare-1.5.2/TODO000066400000000000000000000522171141417717500134640ustar00rootroot00000000000000 ___________ _____ ______ _____ \___ ___/ _==_ \' ._ \/ _==_ \ \' '// \ ' \ \ for radare \___/ \________/.______/_______/ =========================================================== * Remove tm dependency for winedbg backend - or just check it and warn the user - implement .!reg* and so * mark jumps that evaluate to true * 'ag' window does not works to get command output :??? * vm.eip (vm in static doesnt works well.. check and fix :) * Cannot debug signal handlers??? * DEPRECATE !set dbg system command (!reg xx=yy works beter) TODO 1.4.2 ========== * IO tracer (logs all access to memory (address+content)) f.ex: 0x80481020 READ 0xbf883000 10203040 'ascii' 0x80481022 READ 0xbf883004 10203040 'ascii' 0x80481024 READ 0xbf883008 10203040 'ascii' * Show exit value of process * BUG: write on virtualized addresses (like the LOAD ELF regions) is not ok * TODO: implement file.dbg_arg * TODO: add documentation for file.dbg_env and dbg.env_ldso * Allow to easily store the stack contents and get a diff * show info where register points to - px 16@@=`!reg*~[1]` ---- bugs * disasm is incorrect. always returns the negative value :OO - 03 e4 f0 = and esp, 0xf0 but must be= and esp, 0xfffffff0 * RASM is buggy about relative/absolute offsets ---- bugs * Allow to edit flags in Vt * grep multiple strings: (only for r2 or backport?) pdf ~call,ebp * Handle ^C in print hexdump ?huh! cannot break huge reads - We have to split the io_read() calls in blocks of 64k - This way the kernel will be locking less and ^C is possible *) r2's r.db with delete and update (merge here plz) *) refactoring r_bin_pe r_bin_elf: remove dupped code (r2) *) add r_bin_msil * do the remote API has something to do with FDs? (only open+close?) * set fpregs (yep, ineedit for process store/restore) * stack analysis - track esp register - when it changes record an item in a list { old_esp, esp, size, oeip, data } - repeated items are deleted (we can use a linked list here) - overwrites can be notified (useful?) - we can disassemble the instruction at oeip - store all the stack analysis info in a struct per-function and before removing it store a comment or metadata at the begginging of it. - analize previous pushes or stack accesses before a call to a function (identify function arguments) - not only by the ones accessed in the code) - as IRA module - show pm xxxxxxxx @ esp (show esp-ebp bytes here or so) * resume functions - show only calls - show size of function - show number of math ops - show stackframe size - number of conditionals - show refs * set fpregs, mmregs and xmmregs * FULLY implement radiff -f and -t (doesnt takes sense on non-b modes) CALLING CONVENTIONS =================== 1) for functions (depends on compiler and arch) 2) for syscalls (depends on kernel and arch) f.ex: syscall 0,1,2,3,4 args using eax,ebx,ecx,edx on x86-32 - generic actions to be done: - set indexed registers - write in memory (restore used memory after usage) - get result of function (return value is in eax most) ---- refactoring * syscall-flag using userdefined table (in file) - must use asm.os to get proper syscall table - must be implemented in code analysis!! * Add !int opcode to call a syscall f.ex: !int eax=30 ebx=0x8048400 - store/restore regs - shows return value in eax before restoring regs * call arg arg arg - done with lua/python OPTIMIZATIONS ============= * Optimizations everywhere!11cos(0) - config.c, data.c, flags.c - Implement btree for flags and so on * do not dump on tmp files (use popen or so) * flag_get (23%) * Optimize string_flag_offset (24%) - abuses strstr * config_node_get (1%) TODO 1.5 ======== * greplace... ~ is grep, but ~~ is greplace! \o/ pd~~eax/EAX,ebx/EBX # example syntax * LSDJ-like interface Visual mode [x]dkdl -> Q allows to hjkl on those modes +---+ <- enable cmd.vprompt* +---|---|-----------+ | x | d | o | d | l | <- disabled cmd.vprmpt +-------------------+ ^._____________________ hexa, disasm, octal, ... * implement serial:// for '=' command * implement main prompt (rash?? rashell??) - rarun - listen at a port waiting for commands - can be used to remotely upload files * show labels of all jumps/calls (not only bookmarked ones) * Invert doesnt works for disassembly!!! - manually done disassembly instruction by instruction! - negative block size is used to invert (deprecate invert?) * !fork should be fixed * write shellcode to dump a buffer in hexa (inline jump) * regexp search?? (backport from r2) * full support for inner radare_cmd_str (two nested calls breaks the console buffer) * drop sdk dependency for osx-arm --- * set flags to jumps to the middle of instructions while analyzing code (.af*) * Better 'cD' command (use gnu diff method, but take as size the smaller file) * Better integration with -P (projects) (do not analyze twice...) * rax should support different sizes double/base64/7bit/LSBstego/... * cfg.vbar = p% * remove the ':' command -> use it to drop colors instead of verbose? * Add disassembler for - ParrotVM - DalvikVM - CUDA - Flash10 *++++++++++ binary masks (enums, bitmasks) > aB rwx R:4 W:2 X:1 > aBb rwx 777 RWX,RWX,RWX > aBm rwx @ $$:1 > aB -rwx * Support to undefine variables * mov dword[ebp+0xfff], eax -> this is not mov dword[0xffff] code analysis! * Screen column grep should skip escaped sequences (ansi*) * Documentate visual cursor with marks ',' and '.' keys * documentate the change of the execstack protection in program section of ELF * doc4 'g' and 'x' in visual * Added cached filtered IO layer for r_io ... accelerate debug! - we should have a flag to invalidate the cached memory * Use modify_ldt(2) on x86 as IO for the debugger * Added at% like ar% * fer q libr.syscall suporti lectura dsd fitxers =========================================================== * !contsc should allow return value not error * r_io_map_join() > o connect://1.1.1.3:9999//bin/ls 0x100000 > o /bin/ls 0x200000 > join 0x200000 // WTF writes /bin/ls file info over under io layers * '<' and '>' commands converted in prefix modifiers * Add !log command for serial:// and socket:// * rsc monitor implemented as a gui plugin * .rfile.$FOO and .radare.tmp.$FOO are not removed!! * support string print mode for [len][str] formats * organize Functions (RDBs) in visual mode ala 't' or 'e' ---- debugger * !dall should pseudo-initialize the !maps internal structures - identify page type by contents (ELF header and so) - export info as S commands * trace.libcode = trace libcode or not? - dbg.steplibs = true|false ?? * dbg.stepolibs = true ; step over non-user code? - automatic stepu * !bpc -> execute command when hitting breakpoint - stop on breakpoint after N hits * breakpoint callbacks: - integrated with !wp too A hook to an api can be emulated from the debugger, no need to inject code everywhere, just BP and change regs - ptrace layer make't support syscall proxying for remote debugging!!1 rasc -l rulez * Watchpoints: - Make !wp work with ? conditionals - Make dbg.wptrace = make it stop when there's a breakpoint - support for %eax = %ebx f.ex - ^C should be always catched!! * !contuh doesnt works :O - implement continue until cursor - implement !bpt properly java bug: 0x000001EE | b80007 invokestatic java/lang/Object (null) -> this should be a call to callme() =========== >1.5 STUFF * Allow to run shellcodes on debugged process. (autodetect .s or raw binary) - read shellcode from a file should support .c or .s or raw or elf _start * add margin right to the text - or margin left to the shell code - cut all lines at column scr.width - add screen.hshift (horitzontal scrolling) * 'x' char should not be accepted as hexpair * !lib /lib/libm.so.1 ; use 'uselib' on linux and dlopen on *bsd MUAHA - implement !call - must allocate strings * support to remove fixed nodes - show comments in a separated toggleable box: * Signal handling should idenitfy backtracing and siginfo and so from here or so static void handler(int sig, siginfo_t *si, void *unused) { printf("Got SIGSEGV at address: 0x%lx\n", (long) si->si_addr); exit(EXIT_FAILURE); } Debugger: * when attaching sets .rdb ..should be .rdb? * !contu must use '!mp rw- 0x8048000 0x4045' if supported * load libraries on the child process * !contall * !cont ??? * breakpoints - command - stop at count - log (trace) - enable/disable Rasc: * rasc - helper for format strings (orly?) * rasc : send file and execute (pitbull inside!) * add selfsigstop/stackperm shellcodes in lua script or rasc Core: * reload project file if changes Rsc: - fer un binpatch a traves del contexte del asm que sigui muahah (LUA) * pcap/radare for fun * autodetect references to flags with aop.ref on - aop.ref must get more ref types (write checks) a1acc30508 mov eax, [0x805c3ac] 3d00800000 cmp eax, 0x8000 833d0cc4050803 cmp dword [0x805c40c], 0x3 bf0d9b0508 mov edi, 0x8059b0d Radare: + Dwarf support: - dwarfdump parser??? - natively use libwarf in rabin * Allow to draw new lines manually (static defined arch_aop lines_t) DWARF ===== /* Merge libdwarf inside rabin ?? */ /* This is dwarfdump -G */ ============================================================== * Funroll mode - stacked disassembly * Add 'strings-cmt' to add comments in strings and use Cs to convert them - Make 'Cs' be more intelligent for multiple strings - Support for cursor range split - Without argument must find the end of string from curseek * function hooker in C (dbg.hooker) - some C macros or so to create a .so and LD_PRELOAD't - if static...should inject trampolines to our code. - or just manage the breakpoints - if bp == 1 !jmp 0x8084840 - redirect code execution on certain points - stored in file [from-address] \t [to-address] * 'ar' -> anal reset -> reset vm * populate the use of cmd.flag (in prompt and so) * graphically draw data structures in memory (adg, aD)? * add nanosleep shellcode - using nanosleep -> nanosleep(&foo, NULL); call +1 pop ebx push 3 push 0 mov eax, 162 mov ebx int 0x80 * options for trace - trace.depth = 0 - trace.alarm = 0 * ^C doesnt works with trace * shellcode to get cur eip in eax de call +1 pop eax mv [deplaz+eax], restore_value * add !status to get last crash info and stuff like that * fix autocomplete stuff for readline-flags * add full autocompletion support for dietline * Use SIGHUP to dump monitor stuff to files * blinking byte at cursor * support for search and replace * support for oprofile (via rsc or so) Gui === * implement start/pause/continue/stop/reload button for a pid * frontend for hasher (Vala api for hashing) * the gui must listen:// and connect:// too! Open streams ============ * radare pcap://"eth0/port 4000" ///////////////////////////////////////////////////////////////////////// /* Fetch the thread-local storage pointer for libthread_db. */ ps_err_e ps_get_thread_area (const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base) { if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) return PS_ERR; /* IDX is the bias from the thread pointer to the beginning of the thread descriptor. It has to be subtracted due to implementation quirks in libthread_db. */ *base = (void *) ((char *)*base - idx); return PS_OK; } PTRACE_GET_THREAD_AREA_3264: ///////////////////////////////////////////////////////////////////////// DONE? ===== * variable block size - config.block_size as default - tries to find another flag after cfg.vbsize = true -> variable block size (until next flag) (with a similar name to cur one?) Core ===== * allow to run without opening a file (useful for batch mode) * make fdsniff and usbsniff generate a project file and a binary one. (gdb) break ptrace if $r3 == 31 -> !wp equivalent. better docu/integration ARM === * arm backtrace - when runnin to bp says invalid address (uh?) - step over doesnt works on arm/mips BUGS: ===== * !pids must control non-printable chars * keybinding assignment dosnt workz - UGLY * wa doesnt handle file resize * rsc monitor doesnt works as expected * !ret should use !bt if possible Random: ======= * support to append data (without getting out of the block_size) (or so..) * cfg.invdelta = inverses the delta (<=1024 ..-> >=1024) (or delta range) deltamin deltamax * implement insert data inda core * graph.body=asm,flags,symcalls,description, trace execution data * define block size by hit1[0]-hit0[0] rollo begin-end (buscar i ) * invert pel disasm * inv -> make offsets take sense - make cursor bytes take sense too * /a algorithm defined by search.algorithm it flags if search.flag - armfuncsearch - aes - token [from] [to] (dinamic block size) - x86funcsearch - from file formatted as search db - carver (find from-to,maxlen, ...) - plugin * RDBs stored into Projects project.rdb = false ; store or not use [delimiters] to embed rdbs inside rps * MSB stego Graphs ====== * identify nodes with 'ret' in graph * identify nodes with 'cmp' in graph +-------------+ | 0x0804483 |-----------. +-------------+ | | mov eax, 3 | sys_write | | int 0x80 | | +-------------+-----------' - line clicking must be supported! - avoid out of context bytes * tracecc - useful to walk to user code - copy the program code on another buffer - overwrite all code with 0xcc - not portable, coz arm mixes data and code - continue until breakpoints * virtual machine decompilation -> helpers for debugging soft VM opcodes (new user-defined archs) /* done in lua? */ * analize input/output of function calls - bp enter - bp exit - useful to reverse packer VMs - see what changes in register and memory * exception frame information (try { ... } catch stuff) * ram dump driver for w32 * dinamic block size defined by: - height of screen - (set inigial and end binary tags) - allow to move forward/backward between 'bintags' + EH - event handling (event type + source pid) * add '!eh' command, how to handle an event ((ignore?), log, bypass, handle) * cfg.dbgbsize (default block size for debugger) * RDB TO GML * circle to group looped code blocks in graph view --------------------------- * do not sigalarm in visual * new flag type: temporal - they will not survive a project save - they are destroyed after a timeout Search ====== * cfg.limit must be size of current maps section by default (file size?) useful for memory searchs * add map search doing a search inside the process maps only * search for head and foot - for each head finds a foot and defines block size Core ==== * Add views/states/.. (S (switch) command) (open multiple files) - A view is just a stored copy of the config_t structure - and store different states for the same file - think on how to allocate new states (linked list of config_t structs) - S 0 /bin/ls 0x0000000 ; comment 1 /bin/ls 0x0000123 ; comment2 - S [number] Tracer ====== * store more info in trace (output of command) * timeline of a trace |----------------| - available as a zoom view - in rsc script? - can dump traces on separated files? slow? bloat? - single file is better - allow to view frame windows inside the timeline - extended 'f' and 'F' keys mode * List viewer (get offset as index fr cursor, right view shows the contents of th selected offset - linked list browser * cmd.trace -> command to execute when tracing - trace.log should be parsed insiide radare visual (next/next-->prev...) - trace extra regs info: (show bytes where they point) eax 0x8048484 bytes... - blank line means a trace step - program_t -> asign name and color -> useful to merge graphs of code analysis and code execution * tracepoints - allow to execute a command (!dump?) - follow some variables * colorize traces in vala graphs * trace graph - debug.c -> implement a while(debug_step()) loop to arch_aop() each instruction and draw a graph until a breakpoint or ^C - creates a program_t graphable with vala Debugger ======== * Show FPU stack contents * Support for MMX register manipulation * dosdebug:// to debug dosemu-based applications - semi done..not finished. should be integrated as a plugin * qemu:// plugin to connect to qemus :D * windbg:// for serial port (w32 kernel debugger) * code injector for accessing non GP registers like mmx, fp, etc and other's section segments. (%ss, ..) off_t value = get_reg_inline("m0"); - store a struct containing char * register_name; uchar *shellcode - all shellcodes must be coded and injected in the same way * make libgdb2fd work * xrefs does not works for string references - make xrefs support base address =========================================================== TOTHINK ======= * Add 'e scr.xy' as a replacment for the old 'g' command // XXX no way * Filesystem support * emulate filesystems from a defined seek * can be done with losetup? not portable * use fuse emulation? * use linux kernel emulation? * shell with grub-like commands to extract and insert files? * Implement libcaca/aalib backend for grava! :D * new search engine allowing AES and RSA key (so...predefined algos for signature searches) - must think on! - entropia = 1 en un block (tots numeros primers) * implement process freze and bootup * use 'tm' (terminal mixer) to run the target debugged program - allows multiple interactives consoles over the program, keeping the debugger window clean - we need to know the pid of the child process of tm. - maybe a debug flag to tm would be nice - i will talk to the author - must be hardcoded inside the core - handle ^C properly , to allow to stop the process with any signal * Indentify, parse and show the auxv_t structure * LD_AUXV_SHOW=1 /bin/ls before start to debug * dbg.auxv = true // WHY? * output of rsc help should start with ';' * asm.offset must be for all print modes? - renamed to scr.offset? * Really? * define default print format per flags (useful to find strings, code,etc..) :D * rename -v to -q (quiet or -s silent) - cfg.verbose = integer (autosetup scr.color and asm.color) - cfg.quiet = false * make !dump incremental using bindiff (too complicated approach) - support to enable full dump (with hashing for reducing sizes) - ultra slow ? i should analyze code to enhace this FileDescriptors =============== * read/write from/to child filedescriptor * sniff filedescriptor (dumping to file or socket) - using CONTSC ? - hooks read/write/ syscalls and gets buf and so - can be done in lua - !contsc needs lua interface Random Stuff ============ * use libasm to get metadata from each opcode (why? :) * Do not use the char '(' in asm.lines. just use - or = * record radare commands - all commands executed within a recording time are stored on a single script file - you can later repeat it or edit - history control must be back! * executable offsets // flag command/grep? - execute a command on a certain offset - show funtion frames and arguments on the fly - automatize unpacks and so * performance counters: - inject code into the child process - mmap to backup code from the hooked functions - each hooked function should do something like: [mmap_addr+func_off]++; - these counters can be resetted - the mmap is only defined once - show statistics of time range and the count of times a function has been called. - timers: - inject code into the child process to define from-to zones - these from-to zones have an mmap address assigned - uses rdtsc to get time // 'from' hook push eax rdtsc mov [mmap_addr+my_func], eax pop eax // 'to' hook push eax rdtsc mov [mmap_addr+my_func+4], eax pop eax - statistics will show the time spend to run a determined piece of code Imports: ======== * import pdi-tool from gerardo to inject code * import esteve's object injector * import libdwarf * http://reality.sgiweb.org/davea/dwarf.html * add 'list' gdb -like command * parse dwarfdump output in perl BSD_SYSCALL_PTRACE: =================== .global foo foo: mov $2, %ebx mov $1, %eax push %ebx push %eax int $0x80 mips: li $v0, syscall li $v1, arg0 syscall ____ ___ ____ ___ ____ ___ ______ ____ | _ \/ \' \/ \ _ \/ _ \ \__ | / \ | < V . T . V < _/ .--'_/ | () | |_|\__|_|__|___/|_|_|_|\__\___/ |_____(_)____/ /* ONGOING 2.0 */ * full charsets support (search strings in utf8, etc) using iconv * multithread traces : * implement 'commit' command. delayed write operations with bindiff output - using the 'u' command * pD -> 'decompile or sthg like that' * search for strings in disassembly - pd 1 -> strstr(cons_buffer, mystr) * next pel debugger (next source line) -- needs dwarf integration? plugins - small plugin descriptor that loads the real plugin - avoid unnecesasry library loading (gtk and so) * total world domination radare-1.5.2/api/000077500000000000000000000000001141417717500135365ustar00rootroot00000000000000radare-1.5.2/api/Makefile000066400000000000000000000007741141417717500152060ustar00rootroot00000000000000include ../config.mk all: @echo Nothing to do install: # ruby -mkdir -p ${DESTDIR}${LIBDIR}/ruby/1.8 -cp -rf ruby/radare ${DESTDIR}${LIBDIR}/ruby/1.8 # python -mkdir -p ${DESTDIR}${LIBDIR}/python2.5/site-packages -mkdir -p ${DESTDIR}${LIBDIR}/python2.6/site-packages -cp -rf python/radare ${DESTDIR}${LIBDIR}/python2.5/site-packages -cp -rf python/radare ${DESTDIR}${LIBDIR}/python2.6/site-packages # XXX lua -cp -rf lua/radare/api.lua ${DESTDIR}${LIBDIR}/radare/radare.lua .PHONY: all install radare-1.5.2/api/README000066400000000000000000000015641141417717500144240ustar00rootroot00000000000000 +--------------+ | API BINDINGS | +--------------+ --pancake This directory contains subdirectories with the required APIs implementing interfaces on top of radare for accessing remote radares or implementing radare servers (rap://). There is also a standard API interface providing simpler APIs for managing the debugger, code analysis, and other. The idea is to keep all this code as similar as possible to be able to reconstruct bindings automatically without having to implement all them all the time. Current supported bindings are: python - radare/api - radare/remote - radare/analysis ruby - radare/api - radare/remote - radare/analysis (TODO) perl - radare/api - radare/remote (TODO) - radare/analysis (TODO) The root directory of every language contain example programs testing the APIs. radare-1.5.2/api/TODO000066400000000000000000000001171141417717500142250ustar00rootroot00000000000000* Refactor server API like in ruby (to be used by extending a RapServer class) radare-1.5.2/api/lua/000077500000000000000000000000001141417717500143175ustar00rootroot00000000000000radare-1.5.2/api/lua/anal.lua000066400000000000000000000003471141417717500157410ustar00rootroot00000000000000-- Example of lua script using the code analysis API foo = Radare.Analyze.opcode() print("Key Values of table returned by a.opcode()") for k,v in pairs(foo) do print (" - "..k.." = "..v) end print("Opcode size: "..foo["size"]) radare-1.5.2/api/lua/fuzzer-loop.lua000077500000000000000000000025761141417717500173330ustar00rootroot00000000000000-- -- 2008 th0rpe -- -- P0C loop entry -- -- entry_addr = "0x00401050" jump_addr = "0x004010b7" do local ret; local buf_addr; local lebuf_addr; local param_addr; local addr; -- set breakpoint at entry address cmd("!bp "..entry_addr); -- continue execution cmd("!cont"); -- remove breakpoint at entry address cmd("!bp -"..entry_addr); --alloc memory buf_addr = string.format("0x%x", cmd("!alloc 4096")); --get stack frame address param_addr = string.format("0x%x", cmd("!get esp") + 12); -- translate to little endian lebuf_addr = "0x"..string.sub(buf_addr, 9, 10).. string.sub(buf_addr, 7, 8).. string.sub(buf_addr, 5, 6).. string.sub(buf_addr, 3, 4); --seek at 3 arg cmd("s "..param_addr); --write buffer address(allocated) cmd("w "..lebuf_addr); -- init randomize seed math.randomseed(os.time()); --seek at buffer cmd("s "..buf_addr); --write random sequence cmd("w "..string.format("0x%x%x",math.random(1,255), math.random(1,255))); --begin loop ret = cmd("!loop 0x"..jump_addr); while(ret == 0) do cmd("w "..string.format("0x%x%x",math.random(1,255), math.random(1,255))); -- call again ret = cmd("!loop 0x"..jump_addr); end if ret == 3 then print "fatal exception (possible bug)"; else if ret == 2 then print "exit program"; end end end radare-1.5.2/api/lua/fuzzer-target.c000077500000000000000000000006371141417717500173050ustar00rootroot00000000000000void ver(int l, int b, char *buff) { char *v = (char *)0; if(buff[0] == 0x13 && buff[1] == 0x32) { printf("BINGO: %x %x\n", (unsigned char)buff[0], (unsigned char)buff[1]); /* invalid address exception */ *v = 0; } printf("data %x %x\n", (unsigned char)buff[0], (unsigned char)buff[1]); } int main(int argc, char **argv) { char buff[] = {'1', '2'}; ver(1, 2, buff); return 0; } radare-1.5.2/api/lua/opcleaner.lua000066400000000000000000000047131141417717500167770ustar00rootroot00000000000000--------------------------------------------- -- Radare-Lua script to clean trash opcodes -- -- Osu Tatakae! Sexy Pandas! -- -- 2008 --pancake --------------------------------------------- function opcleaner_configure() -- get sections print "Loading sections..." print "" r.cmd(".!rsc flag-sections ${FILE}"); -- configure disassembler Radare.Config.verbose(1) -- size + opcode end -- get opcode information function opcleaner_update_opcode() opline = Radare.Print.dis(1, addr) opsize = tonumber(string.sub(opline,0,2)) opcode = string.sub(opline, 3) end function opcleaner_range(from, to) addr = from while addr JMP if (string.match(opcode, "retn") and (string.match(old_opcode, "push"))) then jump = Radare.Print.hex(4, addr) Radare.Write.hex("e9"..jump.."90", addr) opcleaner_update_opcode() print (string.format("0x%08x: push+ret patched",addr)) -- INC + DEC => NOP + NOP -- XXX: WARNING: does not detects inc eax dec edx !!! elseif (string.match(opcode, "inc") and (string.match(old_opcode, "dec"))) then jump = Radare.Print.hex(4, addr) Radare.Write.hex("90 90") opcleaner_update_opcode() print (string.format("0x%08x: inc+dec patched",addr)) -- JZ + JNZ => elseif ((string.match(opcode, "jz") and (string.match(old_opcode, "jnz"))) or (string.match(opcode, "jnz") and (string.match(old_opcode, "jz")))) then jump = Radare.Print.hex(1, addr) Radare.Write.hex("eb", old_addr) Radare.Write.hex("90 90", addr) opcleaner_update_opcode() print (string.format("0x%08x: jz+jnz patched", addr)) end old_opcode = opcode old_addr = addr; addr = addr + opsize end end -- analyze a section function opcleaner_section(name) print("FROM: "..r.get("section_"..name)) from = r.get("section_"..name) to = r.get("section_"..name.."_end") old_opcode = '' print (string.format("Segment "..name.." at 0x%x",from)) opcleaner_range(from, to) end ------------------------------------------ -- MAIN ---------------------------------- ------------------------------------------ print "" print "OPCODE CLEANER FOR X86/RADARE" print "" trace = 1 base_address = 0x8048000 --Radare.debug("/bin/ls") opcleaner_configure() opcleaner_section("text") --Radare.quit() radare-1.5.2/api/lua/posix/000077500000000000000000000000001141417717500154615ustar00rootroot00000000000000radare-1.5.2/api/lua/posix/Makefile000066400000000000000000000005061141417717500171220ustar00rootroot00000000000000include ../../../config.mk LIBS=${LUA_LIBS} all: posix.so @echo posix.so: -${CC} ${LIBS} -fPIC posix.c -shared -o posix.so #posix.so: posix.o # ${CC} -fPIC ${LIBS} -shared -o posix.so posix.o: ${CC} -fPIC -shared -c posix.c install: mkdir -p /usr/lib/lua/5.1 cp posix.so /usr/lib/lua/5.1/ clean: -rm -f *.o *.so radare-1.5.2/api/lua/posix/modemuncher.c000066400000000000000000000111201141417717500201260ustar00rootroot00000000000000/* Mode Muncher -- modemuncher.c 961110 Claudio Terra munch vb [ME monchen, perh. influenced by MF mangier to eat --more at MANGER] :to chew with a crunching sound: eat with relish :to chew food with a crunching sound: eat food with relish --munch-er n The NeXT Digital Edition of Webster's Ninth New Collegiate Dictionary and Webster's Collegiate Thesaurus */ /* struct for rwx <-> POSIX constant lookup tables */ struct modeLookup { char rwx; mode_t bits; }; typedef struct modeLookup modeLookup; static modeLookup modesel[] = { /* RWX char Posix Constant */ {'r', S_IRUSR}, {'w', S_IWUSR}, {'x', S_IXUSR}, {'r', S_IRGRP}, {'w', S_IWGRP}, {'x', S_IXGRP}, {'r', S_IROTH}, {'w', S_IWOTH}, {'x', S_IXOTH}, {0, (mode_t)-1} /* do not delete this line */ }; static int rwxrwxrwx(mode_t *mode, const char *p) { int count; mode_t tmp_mode = *mode; tmp_mode &= ~(S_ISUID | S_ISGID); /* turn off suid and sgid flags */ for (count=0; count<9; count ++) { if (*p == modesel[count].rwx) tmp_mode |= modesel[count].bits; /* set a bit */ else if (*p == '-') tmp_mode &= ~modesel[count].bits; /* clear a bit */ else if (*p=='s') switch(count) { case 2: /* turn on suid flag */ tmp_mode |= S_ISUID | S_IXUSR; break; case 5: /* turn on sgid flag */ tmp_mode |= S_ISGID | S_IXGRP; break; default: return -4; /* failed! -- bad rwxrwxrwx mode change */ break; } p++; } *mode = tmp_mode; return 0; } static void modechopper(mode_t mode, char *p) { /* requires char p[10] */ int count; char *pp; pp=p; for (count=0; count<9; count ++) { if (mode & modesel[count].bits) *p = modesel[count].rwx; else *p='-'; p++; } *p=0; /* to finish the string */ /* dealing with suid and sgid flags */ if (mode & S_ISUID) pp[2] = (mode & S_IXUSR) ? 's' : 'S'; if (mode & S_ISGID) pp[5] = (mode & S_IXGRP) ? 's' : 'S'; } static int mode_munch(mode_t *mode, const char* p) { char op=0; mode_t affected_bits, ch_mode; int doneFlag = 0; #ifdef DEBUG char tmp[10]; #endif #ifdef DEBUG modechopper(*mode, tmp); printf("modemuncher: got base mode = %s\n", tmp); #endif while (!doneFlag) { /* step 0 -- clear temporary variables */ affected_bits=0; ch_mode=0; /* step 1 -- who's affected? */ #ifdef DEBUG printf("modemuncher step 1\n"); #endif /* mode string given in rwxrwxrwx format */ if (*p== 'r' || *p == '-') return rwxrwxrwx(mode, p); /* mode string given in ugoa+-=rwx format */ for ( ; ; p++) switch (*p) { case 'u': affected_bits |= 04700; break; case 'g': affected_bits |= 02070; break; case 'o': affected_bits |= 01007; break; case 'a': affected_bits |= 07777; break; /* ignore spaces */ case ' ': break; default: goto no_more_affected; } no_more_affected: /* If none specified, affect all bits. */ if (affected_bits == 0) affected_bits = 07777; /* step 2 -- how is it changed? */ #ifdef DEBUG printf("modemuncher step 2 (*p='%c')\n", *p); #endif switch (*p) { case '+': case '-': case '=': op = *p; break; /* ignore spaces */ case ' ': break; default: return -1; /* failed! -- bad operator */ } /* step 3 -- what are the changes? */ #ifdef DEBUG printf("modemuncher step 3\n"); #endif for (p++ ; *p!=0 ; p++) switch (*p) { case 'r': ch_mode |= 00444; break; case 'w': ch_mode |= 00222; break; case 'x': ch_mode |= 00111; break; case 's': /* Set the setuid/gid bits if `u' or `g' is selected. */ ch_mode |= 06000; break; /* ignore spaces */ case ' ': break; default: goto specs_done; } specs_done: /* step 4 -- apply the changes */ #ifdef DEBUG printf("modemuncher step 4\n"); #endif if (*p != ',') doneFlag = 1; if (*p != 0 && *p != ' ' && *p != ',') { #ifdef DEBUG printf("modemuncher: comma error!\n"); printf("modemuncher: doneflag = %u\n", doneFlag); #endif return -2; /* failed! -- bad mode change */ } p++; /*if (!ch_mode) return -2;*/ /* failed! -- bad mode change */ if (ch_mode) switch (op) { case '+': *mode = *mode |= ch_mode & affected_bits; break; case '-': *mode = *mode &= ~(ch_mode & affected_bits); break; case '=': *mode = ch_mode & affected_bits; break; default: return -3; /* failed! -- unknown error */ } } #ifdef DEBUG modechopper(*mode, tmp); printf("modemuncher: returning mode = %s\n", tmp); #endif return 0; /* successful call */ } radare-1.5.2/api/lua/posix/posix.c000066400000000000000000000613431141417717500167760ustar00rootroot00000000000000/* * lposix.c * POSIX library for Lua 5.1. * Luiz Henrique de Figueiredo * 07 Apr 2006 23:17:49 * Clean up and bug fixes by Leo Razoumov 2006-10-11 * Based on original by Claudio Terra for Lua 3.x. * With contributions by Roberto Ierusalimschy. */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #define MYNAME "posix" #define MYVERSION MYNAME " library for " LUA_VERSION " / Jan 2008" #ifndef ENABLE_SYSLOG #define ENABLE_SYSLOG 1 #endif #include "lua.h" #include "lualib.h" #include "lauxlib.h" #include "modemuncher.c" /* compatibility with Lua 5.0 */ #ifndef LUA_VERSION_NUM static int luaL_checkoption (lua_State *L, int narg, const char *def, const char *const lst[]) { const char *name = (def) ? luaL_optstring(L, narg, def) : luaL_checkstring(L, narg); int i = luaL_findstring(name, lst); if (i == -1) luaL_argerror(L, narg, lua_pushfstring(L, "invalid option '%s'", name)); return i; } #define lua_pushinteger lua_pushnumber #define lua_createtable(L,a,r) lua_newtable(L) #define LUA_FILEHANDLE "FILE*" #define lua_setfield(l,i,k) #define lua_getfield(l,i,k) #endif static const struct { char c; mode_t b; } M[] = { {'r', S_IRUSR}, {'w', S_IWUSR}, {'x', S_IXUSR}, {'r', S_IRGRP}, {'w', S_IWGRP}, {'x', S_IXGRP}, {'r', S_IROTH}, {'w', S_IWOTH}, {'x', S_IXOTH}, }; static void pushmode(lua_State *L, mode_t mode) { char m[9]; int i; for (i=0; i<9; i++) m[i]= (mode & M[i].b) ? M[i].c : '-'; if (mode & S_ISUID) m[2]= (mode & S_IXUSR) ? 's' : 'S'; if (mode & S_ISGID) m[5]= (mode & S_IXGRP) ? 's' : 'S'; lua_pushlstring(L, m, 9); } typedef void (*Selector)(lua_State *L, int i, const void *data); static int doselection(lua_State *L, int i, int n, const char *const S[], Selector F, const void *data) { if (lua_isnone(L, i) || lua_istable(L, i)) { int j; if (lua_isnone(L, i)) lua_createtable(L,0,n); else lua_settop(L, i); for (j=0; S[j]!=NULL; j++) { lua_pushstring(L, S[j]); F(L, j, data); lua_settable(L, -3); } return 1; } else { int k,n=lua_gettop(L); for (k=i; k<=n; k++) { int j=luaL_checkoption(L, k, NULL, S); F(L, j, data); lua_replace(L, k); } return n-i+1; } } #define doselection(L,i,S,F,d) (doselection)(L,i,sizeof(S)/sizeof(*S)-1,S,F,d) static int pusherror(lua_State *L, const char *info) { lua_pushnil(L); if (info==NULL) lua_pushstring(L, strerror(errno)); else lua_pushfstring(L, "%s: %s", info, strerror(errno)); lua_pushinteger(L, errno); return 3; } static int pushresult(lua_State *L, int i, const char *info) { if (i==-1) return pusherror(L, info); lua_pushinteger(L, i); return 1; } static void badoption(lua_State *L, int i, const char *what, int option) { luaL_argerror(L, 2, lua_pushfstring(L, "unknown %s option '%c'", what, option)); } static uid_t mygetuid(lua_State *L, int i) { if (lua_isnone(L, i)) return -1; else if (lua_isnumber(L, i)) return (uid_t) lua_tonumber(L, i); else if (lua_isstring(L, i)) { struct passwd *p=getpwnam(lua_tostring(L, i)); return (p==NULL) ? -1 : p->pw_uid; } else return luaL_typerror(L, i, "string or number"); } static gid_t mygetgid(lua_State *L, int i) { if (lua_isnone(L, i)) return -1; else if (lua_isnumber(L, i)) return (gid_t) lua_tonumber(L, i); else if (lua_isstring(L, i)) { struct group *g=getgrnam(lua_tostring(L, i)); return (g==NULL) ? -1 : g->gr_gid; } else return luaL_typerror(L, i, "string or number"); } static int Perrno(lua_State *L) /** errno([n]) */ { int n = luaL_optint(L, 1, errno); lua_pushstring(L, strerror(n)); lua_pushinteger(L, n); return 2; } static int Pbasename(lua_State *L) /** basename(path) */ { char b[PATH_MAX]; size_t len; const char *path = luaL_checklstring(L, 1, &len); if (len>=sizeof(b)) luaL_argerror(L, 1, "too long"); lua_pushstring(L, basename(strcpy(b,path))); return 1; } static int Pdirname(lua_State *L) /** dirname(path) */ { char b[PATH_MAX]; size_t len; const char *path = luaL_checklstring(L, 1, &len); if (len>=sizeof(b)) luaL_argerror(L, 1, "too long"); lua_pushstring(L, dirname(strcpy(b,path))); return 1; } static int Pdir(lua_State *L) /** dir([path]) */ { const char *path = luaL_optstring(L, 1, "."); DIR *d = opendir(path); if (d == NULL) return pusherror(L, path); else { int i; struct dirent *entry; lua_newtable(L); for (i=1; (entry = readdir(d)) != NULL; i++) { lua_pushstring(L, entry->d_name); lua_rawseti(L, -2, i); } closedir(d); lua_pushinteger(L, i-1); return 2; } } static int Pglob(lua_State *L) /** glob(pattern) */ { const char *pattern = luaL_optstring(L, 1, "*"); glob_t globres; if (glob(pattern, 0, NULL, &globres)) return pusherror(L, pattern); else { int i; lua_newtable(L); for (i=1; i<=globres.gl_pathc; i++) { lua_pushstring(L, globres.gl_pathv[i-1]); lua_rawseti(L, -2, i); } globfree(&globres); return 1; } } static int aux_files(lua_State *L) { DIR **p = (DIR **)lua_touserdata(L, lua_upvalueindex(1)); DIR *d = *p; struct dirent *entry; if (d == NULL) return 0; entry = readdir(d); if (entry == NULL) { closedir(d); *p=NULL; return 0; } else { lua_pushstring(L, entry->d_name); return 1; } } static int dir_gc (lua_State *L) { DIR *d = *(DIR **)lua_touserdata(L, 1); if (d!=NULL) closedir(d); return 0; } static int Pfiles(lua_State *L) /** files([path]) */ { const char *path = luaL_optstring(L, 1, "."); DIR **d = (DIR **)lua_newuserdata(L, sizeof(DIR *)); if (luaL_newmetatable(L, MYNAME " dir handle")) { lua_pushliteral(L, "__gc"); lua_pushcfunction(L, dir_gc); lua_settable(L, -3); } lua_setmetatable(L, -2); *d = opendir(path); if (*d == NULL) return pusherror(L, path); lua_pushcclosure(L, aux_files, 1); return 1; } static int Pgetcwd(lua_State *L) /** getcwd() */ { char b[PATH_MAX]; if (getcwd(b, sizeof(b)) == NULL) return pusherror(L, "."); lua_pushstring(L, b); return 1; } static int Pmkdir(lua_State *L) /** mkdir(path) */ { const char *path = luaL_checkstring(L, 1); return pushresult(L, mkdir(path, 0777), path); } static int Pchdir(lua_State *L) /** chdir(path) */ { const char *path = luaL_checkstring(L, 1); return pushresult(L, chdir(path), path); } static int Prmdir(lua_State *L) /** rmdir(path) */ { const char *path = luaL_checkstring(L, 1); return pushresult(L, rmdir(path), path); } static int Punlink(lua_State *L) /** unlink(path) */ { const char *path = luaL_checkstring(L, 1); return pushresult(L, unlink(path), path); } static int Plink(lua_State *L) /** link(old,new,[symbolic]) */ { const char *oldpath = luaL_checkstring(L, 1); const char *newpath = luaL_checkstring(L, 2); return pushresult(L, (lua_toboolean(L,3) ? symlink : link)(oldpath, newpath), NULL); } static int Preadlink(lua_State *L) /** readlink(path) */ { char b[PATH_MAX]; const char *path = luaL_checkstring(L, 1); int n = readlink(path, b, sizeof(b)); if (n==-1) return pusherror(L, path); lua_pushlstring(L, b, n); return 1; } static int Paccess(lua_State *L) /** access(path,[mode]) */ { int mode=F_OK; const char *path=luaL_checkstring(L, 1); const char *s; for (s=luaL_optstring(L, 2, "f"); *s!=0 ; s++) switch (*s) { case ' ': break; case 'r': mode |= R_OK; break; case 'w': mode |= W_OK; break; case 'x': mode |= X_OK; break; case 'f': mode |= F_OK; break; default: badoption(L, 2, "mode", *s); break; } return pushresult(L, access(path, mode), path); } static int myfclose (lua_State *L) { FILE **p = (FILE **)lua_touserdata(L, 1); int rc = fclose(*p); if (rc == 0) *p = NULL; return pushresult(L, rc, NULL); } static int pushfile (lua_State *L, int id, const char *mode) { FILE **f = (FILE **)lua_newuserdata(L, sizeof(FILE *)); *f = NULL; luaL_getmetatable(L, LUA_FILEHANDLE); lua_setmetatable(L, -2); lua_getfield(L, LUA_REGISTRYINDEX, "POSIX_PIPEFILE"); if (lua_isnil(L, -1)) { lua_pop(L, 1); lua_newtable(L); lua_pushvalue(L, -1); lua_pushcfunction(L, myfclose); lua_setfield(L, -2, "__close"); lua_setfield(L, LUA_REGISTRYINDEX, "POSIX_PIPEFILE"); } lua_setfenv(L, -2); *f = fdopen(id, mode); return (*f != NULL); } static int Ppipe(lua_State *L) /** pipe() */ { int fd[2]; if (pipe(fd)==-1) return pusherror(L, NULL); if (!pushfile(L, fd[0], "r") || !pushfile(L, fd[1], "w")) return pusherror(L, "pipe"); return 2; } static int Pfileno(lua_State *L) /** fileno(filehandle) */ { FILE *f = *(FILE**) luaL_checkudata(L, 1, LUA_FILEHANDLE); return pushresult(L, fileno(f), NULL); } /* helper func for Pdup */ static const char *filemode(int fd) { const char *m; int mode = fcntl(fd, F_GETFL); if (mode < 0) return NULL; switch (mode & O_ACCMODE) { case O_RDONLY: m = "r"; break; case O_WRONLY: m = "w"; break; default: m = "rw"; break; } return m; } static int Pdup(lua_State *L) /** dup(old,[new]) */ { FILE **oldf = (FILE**)luaL_checkudata(L, 1, LUA_FILEHANDLE); FILE **newf = (FILE **)lua_touserdata(L, 2); int fd; const char *msg = "dup2"; fflush(*newf); if (newf == NULL) { fd = dup(fileno(*oldf)); msg = "dup"; } else { fflush(*newf); fd = dup2(fileno(*oldf), fileno(*newf)); } if ((fd < 0) || !pushfile(L, fd, filemode(fd))) return pusherror(L, msg); return 1; } static int Pmkfifo(lua_State *L) /** mkfifo(path) */ { const char *path = luaL_checkstring(L, 1); return pushresult(L, mkfifo(path, 0777), path); } static int runexec(lua_State *L, int use_shell) { const char *path = luaL_checkstring(L, 1); int i,n=lua_gettop(L); char **argv = lua_newuserdata(L,(n+1)*sizeof(char*)); argv[0] = (char*)path; for (i=1; i -- ========== -- -- -- -- Namespaces -- -- -- -- ========== -- Radare = {} Radare.Analyze = {} Radare.Print = {} Radare.Search = {} Radare.Config = {} Radare.Code = {} Radare.Hash = {} Radare.Debugger = {} Radare.Write = {} Radare.Utils = {} -- ================= -- -- -- -- Namespace aliases -- -- -- -- ================= -- r = Radare a = Radare.Analyze p = Radare.Print cfg = Radare.Config code = Radare.Code hash = Radare.Hash s = Radare.Search d = Radare.Debugger w = Radare.Write u = Radare.Utils -- ================ -- -- -- -- Helper functions -- -- -- -- ================ -- function help(table) if table == nil then print "Use help(Radare), help(Radare.Debugger) or help(Radare.Print)" print "These namespaces has been aliased as 'r', 'd' and 'p'." else for key,val in pairs(table) do print(" "..key) end end return 0 end function list(table) local i i = 0 if table == nil then print "List the contents of a table" else --for key,val in pairs(table) do print(" "..key) end for k,v in pairs(table) do if v == nil then print(" "..k) -- XXX crash else print(" "..k..": "..v) -- k('?') end i = i + 1 end end return n end -- join strings from a table function join(delimiter, list) local len = getn(list) if len == 0 then return "" end local string = list[1] for i = 2, len do string = string .. delimiter .. list[i] end return string end -- split a string by a separator function split(text, sep) sep = sep or "\n" text = chomp(text) local lines = {} local pos = 1 while true do local b,e = text:find(sep, pos) if not b then table.insert(lines, text:sub(pos)) break end table.insert(lines, text:sub(pos,b-1)) pos = e + 1 end return lines end function chomp(text) if text == nil then return "" end return string.gsub(text, "\n$", "") end function chop(text) if text == nil then return "" end text = string.gsub(text, "\ *$", "") return string.gsub(text, "^\ *", "") end function hexpairs(buf) for byte=1, #buf, 16 do local chunk = buf:sub(byte, byte+15) io.write(string.format('%08X ',byte-1)) chunk:gsub('.', function (c) io.write(string.format('%02X ',string.byte(c))) end) io.write(string.rep(' ',3*(16-#chunk))) io.write(' ',chunk:gsub('%c','.'),"\n") end end function hexdump(buf) for i=1,math.ceil(#buf/16) * 16 do if (i-1) % 16 == 0 then io.write(string.format('%08X ', i-1)) end io.write( i > #buf and ' ' or string.format('%02X ', buf:byte(i)) ) if i % 8 == 0 then io.write(' ') end if i % 16 == 0 then io.write( buf:sub(i-16+1, i):gsub('%c','.'), '\n' ) end end end -- ==================== -- -- -- -- Radare API functions -- -- -- -- ==================== -- function Radare.get(value) -- | cut -d ' ' -f 1"); foo = split( string.gsub( cmd_str("? "..value),'(0x[^ ])', function(x)return x end),';') return tonumber(foo[1]) end Radare.bytes_help = 'Radare.bytes(addr)\tReturn hexpair string with block_size bytes at [addr]' function Radare.bytes(addr) local res = split(Radare.cmd("pX @"..addr), " ") -- TODO return res; end Radare.cmd_help = 'Radare.cmd(command)\tExecutes a radare command and returns its output' function Radare.cmd(cmd) return chomp(cmd_str(cmd)) end Radare.system_help = 'Radare.system(command)\tExecute an IO system command' function Radare.system(command) r.cmd("!!"..command) -- todo handle errors here return 0 end Radare.iosystem_help = 'Radare.iosystem(command)\tExecute an IO system command' function Radare.iosystem(command) r.cmd("!"..command) -- todo handle errors here return 0 end function Radare.open(filename) r.cmd("o "..filename) -- todo handle errors here return 0 end function Radare.attach(pid) return r.cmd("o pid://"..pid) end function Radare.debug(filename) return r.cmd("o dbg://"..filename) end function Radare.seek(offset) r.cmd("s "..offset) return 0 end function Radare.undo_seek() r.cmd("u") -- todo handle errors here return 0 end function Radare.redo_seek() r.cmd("uu") -- todo handle errors here return 0 end function Radare.resize(newsize) r.cmd("r "..newsize) -- todo handle errors here return 0 end function Radare.fortune() return r.cmd("fortune") end function Radare.interpret(file) -- control block size r.cmd(". "..file) return 0 end function Radare.copy(size,address) -- control block size if address == nil then r.cmd("y "..size) else r.cmd("y "..size.." @ "..address) end return 0 end function Radare.paste(address) -- control block size if address == nil then r.cmd("yy ") else r.cmd("yy @ "..address) end r.cmd("y "..offset) return 0 end function Radare.endian(big) r.cmd("eval cfg.bigendian = "..big) return 0 end function Radare.flag(name, address) -- rename to r.set() ? if address == nil then r.cmd("f "..name) else r.cmd("f "..name.." @ "..address) end return 0 end function Radare.flag_get(name) -- rename to r.get() ? local foo = str.split(r.cmd("? "..name), " ") return foo[1] end function Radare.flag_remove(name) -- rename to r.remove() ? r.cmd("f -"..name) return 0 end function Radare.flag_rename(oldname, newname) r.cmd("fr "..oldname.." "..newname) return 0 end function Radare.flag_list(filter) local list = split(r.cmd("f")) local ret = {} local i = 1 while list[i] ~= nil do local foo = split(list[i], " ") ret[i] = foo[4] i = i + 1 end return ret end function Radare.eval(key, value) if value == nil then return r.cmd("eval "..key) end return r.cmd("eval "..key.." = "..value) end function Radare.cmp(value, address) if address == nil then r.cmd("c "..value) else r.cmd("c "..value.." @ "..address) end -- parse output and get ret value return 0 end function Radare.cmp_file(file, address) if address == nil then r.cmd("cf "..file) else r.cmd("cf "..file.." @ "..address) end -- parse output and get ret value return 0 end function Radare.quit() r.cmd("q"); return 0 end function Radare.exit() return r.quit() end -- Radare.Analyze function Radare.Analyze.opcode(addr) if addr == nil then addr = "" else addr= "@ "..addr end local res = split(Radare.cmd("ao "..addr),"\n") local ret = {} for i = 1, #res do local line = split(res[i], "=") ret[chop(line[1])] = chop(line[2]) end return ret; end function Radare.Analyze.block(addr) if addr == nil then addr = "" else addr= "@ "..addr end local res = split(Radare.cmd("ab "..addr),"\n") local ret = {} for i = 1, #res do local line = split(res[i], "=") ret[chop(line[1])] = chop(line[2]) end return ret; end -- Radare.Debugger API function Radare.Debugger.step(times) r.cmd("!step "..times); return Radare.Debugger end function Radare.Debugger.attach(pid) r.cmd("!attach "..pid); return Radare.Debugger end function Radare.Debugger.detach(pid) r.cmd("!detach") return Radare.Debugger end function Radare.Debugger.jmp(address) r.cmd("!jmp "..address) return Radare.Debugger end function Radare.Debugger.set(register, value) r.cmd("!set "..register.." "..value) return Radare.Debugger end function Radare.Debugger.call(address) r.cmd("!call "..address) return Radare.Debugger end function Radare.Debugger.dump(name) r.cmd("!dump "..name) return Radare.Debugger end function Radare.Debugger.restore(name) r.cmd("!restore "..name) return Radare.Debugger end function Radare.Debugger.bp(address) r.cmd("!bp "..address) return Radare.Debugger end -- print stuff function Radare.Print.hex(size, address) if size == nil then size = "" end if address == nil then return r.cmd(":pX "..size) else return r.cmd(":pX "..size.." @ "..address) end end function Radare.Print.dis(nops, address) if nops == nil then nops = "" end if address == nil then return r.cmd("pd "..nops) else return r.cmd("pd "..nops.." @ "..address) end end function Radare.Print.disasm(size, address) if size == nil then size = "" end if address == nil then return r.cmd("pD "..size) else return r.cmd("pD "..size.." @ "..address) end end function Radare.Print.bin(size, address) -- size has no sense here if size == nil then size = "" end if address == nil then return r.cmd(":pb "..size) else return r.cmd(":pb "..size.." @ "..address) end end function Radare.Print.string(address) -- size has no sense here if address == nil then return r.cmd("pz ") else return r.cmd("pz @ "..address) end end function Radare.Print.oct(size,address) -- size has no sense here if size == nil then size = "" end if address == nil then return r.cmd(":po "..size) end return r.cmd(":po "..size.."@ "..address) end -- search stuff function Radare.Search.parse(string) local res = split(string,"\n") local ret = {} for i = 1, #res do local line = split(res[i], " ") ret[i] = line[3] end return ret; end function Radare.Search.string(string) return Radare.Search.parse(Radare.cmd("/ "..string)) end function Radare.Search.hex(string) return Radare.Search.parse(Radare.cmd("/x "..string)) end function Radare.Search.replace(hex_search, hex_write, delta) if delta == nil then Radare.Config.set("cmd.hit","wx "..hex_write) else Radare.Config.set("cmd.hit","wx "..hex_write.." @ +"..delta) end return Radare.Search.parse(Radare.cmd("/x "..hex_search)) end -- write stuff function Radare.Write.hex(string, address) if address == nil then return r.cmd("wx "..string) else return r.cmd("wx "..string.." @ "..address) end end function Radare.Write.string(string, address) if address == nil then return r.cmd("w ", string) else return r.cmd("w "..string.." @ "..address) end end function Radare.Write.wide_string(string, address) if address == nil then return r.cmd("ws "..string) else return r.cmd("ws "..string.." @ "..address) end end function Radare.asm(string) return r.cmd("!rasm '".. string.."'") end function Radare.Write.asm(string, address) if address == nil then return r.cmd("wa ".. string) else return r.cmd("wa "..string.." @ "..address) end end function Radare.Write.rscasm(string, address) if address == nil then return r.cmd("wA "..string) else return r.cmd("wA "..string.." @ "..address) end end function Radare.Write.from_file(filename, address) if address == nil then return r.cmd("wf "..filename) else return r.cmd("wf "..filename.." @ "..address) end end -- config stuff -- eval like function Radare.Config.verbose(level) Radare.Config.set("asm.syntax","intel") Radare.Config.set("asm.lines","false") Radare.Config.set("asm.offset","false") Radare.Config.set("asm.bytes","false") Radare.Config.set("asm.flags","false") Radare.Config.set("asm.split","false") Radare.Config.set("scr.color","false") Radare.Config.set("asm.comments","false") if level >= 1 then Radare.Config.set("asm.size", "true") end if level >= 2 then Radare.Config.set("asm.offset", "true") end if level >= 3 then Radare.Config.set("asm.lines", "true") Radare.Config.set("asm.bytes", "true") Radare.Config.set("asm.split", "true") Radare.Config.set("asm.flags", "true") Radare.Config.set("scr.color", "true") Radare.Config.set("asm.comments","true") end end -- TODO: store/restore eval config local Radare_Config_storage = {} function Radare.Config.store() local lines = split(r.cmd("e"),"\n") for i = 1, #lines do local a = split(lines[i],"=") if a[1] ~= nil then if a[2] == nil then a[2]="" end if (string.match(a[1], "file") ~= nil) then -- ignore else -- TODO. should store everything! (but no reopen :O) if (string.match(a[1], "asm") ~= nil) or (string.match(a[1], "scr") ~= nil) then Radare_Config_storage[a[1]] = a[2] Radare_Config_storage[a[1]] = a[2] end end end end end function Radare.Config.restore() for a,b in pairs(Radare_Config_storage) do Radare.Config.set(a,b) -- print (a.." = "..b) end end function Radare.Config.set(key, val) r.cmd("eval "..key.."="..val) return val end function Radare.Config.color(value) r.cmd("eval scr.color ="..value) return value end function Radare.Config.get(key) return r.cmd("eval "..key) end function Radare.Config.limit(sizs) return r.cmd("eval cfg.limit = "..size) end -- crypto stuff function Radare.Hash.md5(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#md5 "..size) end return r.cmd("#md5 "..size.."@"..address) end function Radare.Hash.crc32(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#crc32 "..size) end return r.cmd("#crc32 "..size.."@"..address) end function Radare.Hash.md4(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#md4 "..size) end return r.cmd("#md4 "..size.."@"..address) end function Radare.Hash.sha1(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#sha1 "..size) end return r.cmd("#sha1 "..size.."@"..address) end function Radare.Hash.sha256(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#sha256 "..size) end return r.cmd("#sha256 "..size.."@"..address) end function Radare.Hash.sha384(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#sha384 "..size) end return r.cmd("#sha384 "..size.."@"..address) end function Radare.Hash.sha512(size, address) if size == nil then size = "" end if address == nil then return r.cmd("#sha512 "..size) end return r.cmd("#sha512 "..size.."@"..address) end function Radare.Hash.hash(algo, size, address) if size == nil then size = "" end eval("#"..algo.." "..size) end function Radare.Hash.sha512(size, address) return hash("sha512", size, address) --if size == nil then size = "" end --if address == nil then return r.cmd("#sha512 "..size) end --return r.cmd("#sha512 "..size.."@"..address) end -- code api function Radare.Code.comment(offset, message) -- TODO: if only offset passed, return comment string r.cmd("CC "..message.." @ "..offset) return Radare.Code end function Radare.Code.code(offset, len) r.cmd("Cc "..len.." @ "..offset) return Radare.Code end function Radare.Code.data(offset, len) r.cmd("Cd "..len.." @ "..offset) return Radare.Code end function Radare.Code.string(offset, len) r.cmd("Cs "..len.." @ "..offset) return Radare.Code end -- change a signal handler of the child process function Radare.Debugger.signal(signum, sighandler) r.cmd("!signal "..signum.." "..sighandler) return Radare.Debugger end function Radare.Debugger.bp_remove(address) r.cmd("!bp -"..address); return Radare.Debugger end function Radare.Debugger.continue(address) if address == nil then r.cmd("!cont"); else r.cmd("!cont "..address); end return Radare.Debugger end function Radare.Debugger.step(num) r.cmd("!step "..num) return Radare.Debugger end function Radare.Debugger.step(num) r.cmd("!step "..num) return Radare.Debugger end function Radare.Debugger.step_over() r.cmd("!stepo"); return Radare.Debugger end function Radare.Debugger.step_until_user_code() r.cmd("!stepu"); return Radare.Debugger end function Radare.Debugger.add_bp(addr) r.cmd("!bp "..addr) return Radare.Debugger end function Radare.Debugger.remove_bp(addr) r.cmd("!bp -"..addr) return Radare.Debugger end function Radare.Debugger.alloc(size) return cmd_str("!alloc "..size) end function Radare.Debugger.free(addr) -- rename to dealloc? return cmd_str("!free "..addr) end function Radare.Debugger.dump(dirname) r.cmd("!dump "..dirname) return Radare.Debugger end function Radare.Debugger.restore(dirname) r.cmd("!restore "..dirname) return Radare.Debugger end function Radare.Debugger.jump(addr) r.cmd("!jmp "..addr) return Radare.Debugger end function Radare.Debugger.backtrace() local res = split(Radare.cmd("!bt"),"\n") local ret = {} for i = 1, #res do local line = split(res[i], " ") ret[i] = line[2] end return ret; end print "[radare.lua] Type 'help()' or 'quit' to return to radare shell." radare-1.5.2/api/lua/search-demo.lua000066400000000000000000000007751141417717500172220ustar00rootroot00000000000000print "" print "Welcome to the debugging in LUA" print "" -- show lua help --help(Radare) -- search lib and show results Radare.seek(0) local hits = Radare.Search.string("lib") for i = 1, #hits do print(" => "..hits[i]..": "..Radare.cmd("pz @ "..hits[i])) end print "" -- print("result: ("..result..")") r.eval("scr.width", "40") -- enter commandline loop while true do print "" line = io.read() -- regs = cmd_str("!regs") -- print(regs) print (cmd_str(line)) end -- exit cmd("q") radare-1.5.2/api/lua/vozme.lua000066400000000000000000000015471141417717500161710ustar00rootroot00000000000000-- vozme.lua -- -- author: pancake -- -- lua/radare script to read (using vozme web service) opcodes from current seek -- -- nicely for blind reversing. i did it for the lulz -- require 'posix' lang="es" n_opcodes = 4 url="vozme.com/text2voice.php?lang="..lang function play(text, bg) if bg then bg = "&" else bg="" end if text == "" then return end os.execute("mplayer -quiet -msglevel all=0 "..text.." > /dev/null 2>&1"..bg) print("mplayer -quiet -msglevel all=0 "..text.." > /dev/null 2>&1"..bg) end function play_queue(str, text) return str.."`curl -s -d \"text="..chop(text).."\" "..url.." | grep 'mp3\"' | cut -d '\"' -f 2` " end -- opcode player Radare.Config.verbose(0) local lines = split(Radare.Print.dis(n_opcodes),'\n') local str = "" for i = 1, #lines do str = play_queue(str, lines[i]) end play(str, true) Radare.Config.verbose(3) radare-1.5.2/api/perl/000077500000000000000000000000001141417717500145005ustar00rootroot00000000000000radare-1.5.2/api/perl/Radare/000077500000000000000000000000001141417717500156765ustar00rootroot00000000000000radare-1.5.2/api/perl/Radare/Remote.pm000066400000000000000000000001211141417717500174610ustar00rootroot00000000000000package Radare::Remote; sub connect_tcp { print "Connecting ..\n"; } sub 1; radare-1.5.2/api/perl/rscript.pl000066400000000000000000000004111141417717500165170ustar00rootroot00000000000000r("e scr.color=false"); r("e asm.profile=simple"); @pd = split(/\n/, r("pd 20")); for $i (0 .. $#pd) { $pd[$i]=~/([^\s]*)(.*)$/; chomp(my $offset = $1); chomp(my $opcode = $2); $opcode=~s/^[\t|\s]*//g; $offset=~s/^[\t|\s]*//g; print "$offset => $opcode\n"; } radare-1.5.2/api/perl/test.pl000066400000000000000000000001031141417717500160060ustar00rootroot00000000000000use Radare::Remote; #use Radare::Analysis; print "Hello World\n"; radare-1.5.2/api/python/000077500000000000000000000000001141417717500150575ustar00rootroot00000000000000radare-1.5.2/api/python/anal.py000066400000000000000000000030041141417717500163410ustar00rootroot00000000000000try: import r except: import radare.remote print "Food" import radare.api import sys sys.path.append('.') from radare.analysis import * print "---------------------------------" print r.cmd("e scr.color=0") print r.cmd("e graph.split=0") p = Program() print "File type: %s" % p.type print "File size: %d bytes" % p.size print "Entrypoint: 0x%x" % p.entrypoint print "Virtual address: 0x%x" % p.vaddr print "Physical address: 0x%x" % p.paddr print "OperatingSystem: %s" % p.os print "Architecture: %s" % p.arch print "Endian: %s" % p.bigendian print "Symbols:" ss = Symbols() for s in ss.list: print "0x%08x: size=%s name=%s"%(s.addr, s.size, s.name) Function.analyze(s.addr) print "Functions:" fs = Functions() for f in fs.list: print "0x%08x: size=%s name=%s"%(f.addr, f.size, f.name) bb = BasicBlocks(f.addr) print " ==> Basic blocks: %d"%len(bb.list) print " ==> Disassembly:" print r.cmd("pd@%d:%d"%(f.addr,f.size)) Graph.make_png(f.addr, "%s.png"%f.name) print "Imports:" ss = Imports() for s in ss.list: print "0x%08x: size=%s name=%s"%(s.addr, s.size, s.name) for x in CodeXrefs(s.addr).list: print " -> xref from 0x%08x"%(x.addr) print "Xrefs:" for x in CodeXrefs().list: print " -> code xref from 0x%08x -> to 0x%08x"%(x.addr, x.endaddr) for x in DataXrefs().list: print " -> data xref from 0x%08x -> to 0x%08x"%(x.addr, x.endaddr) print "Sections:" ss = Sections() for s in ss.list: print "0x%08x: size=%d %s"%(s.addr, s.size, s.name) print "---------------------------------" radare.api.quit(0) radare-1.5.2/api/python/bochs.py000066400000000000000000000103611141417717500165300ustar00rootroot00000000000000#!/usr/bin/python # pancake/sexy-pandas import cpu import dbg import bx import radapy from string import * PORT=9998 # physical memory phys=True bps=list() def reg_resolver(reg): return eval("cpu.%s"%upper(reg)) def fun_read(len): global phys if phys: return dbg.read_memory_block_physical(radapy.offset, len) return dbg.read_memory_block_linear(radapy.offset, len) def fun_write(buf): global phys if phys: return dbg.write_memory_block_physical(radapy.offset, buf) return dbg.write_memory_block_linear(radapy.offset, buf) def fun_system(str): global phys foo = str.split(' ') str = "" try: if foo[0] == "help" or foo[0] == "?" or foo[0] == "h": str = "Bochs-python remote debugger\n" str += " !? : alias for !help\n" str += " !reg [reg] ([value]) : get/set CPU registers\n" str += " !regs[*] : show CPU registers\n" str += " !cregs : show control registers\n" str += " !fpregs : show FPU registers\n" str += " !st : print stack\n" str += " !bp [[-]addr] : breakpoints\n" str += " !cont : continue execution\n" str += " !step [n] : perforn N steps\n" str += " !stepo [n] : step over\n" str += " !mem [physical|linear] : select memory addressing\n" str += " !exec [python-expr] : execute python expression remotely\n" elif foo[0] == "bp": try: if foo[1][0] == '-': addr = eval(foo[1][1:]) bx.del_breakpoint(addr) str = "Breakpoint removed at 0x%08x\n"%addr bps.remove(addr) else: try: addr = eval(foo[1]) if phys: bx.pbreakpoint(0, addr) else: bx.lbreakpoint(0, addr) str = "Breakpoint add at 0x%08x\n"%addr bps.append(addr) except: bx.info_bpoints() except: bx.info_bpoints() i = 0 str = "" for bp in bps: str += " %d 0x%08x\n"%(i,bp) i = i + 1 elif foo[0] == "st": # TODO bx.print_stack() elif foo[0] == "exec": exec(join(foo[1:])) elif foo[0] == "reg": try: reg = reg_resolver(foo[1]) try: cpu.set(reg, eval(foo[2])) return "" except: return "0x%08x\n"%cpu.get(reg) except: return "Usage: !reg eax 33\n" elif foo[0] == "cregs": bx.info_control_regs() str = "CR0 = 0x%x\n"%cpu.get(cpu.CR0) str += "CR2 = 0x%x\n"%cpu.get(cpu.CR2) str += "CR3 = 0x%x\n"%cpu.get(cpu.CR3) str += "CR4 = 0x%x\n"%cpu.get(cpu.CR4) elif foo[0] == "regs": str = " eax 0x%08x esi 0x%08x eip 0x%08x\n"%(cpu.get(cpu.EAX),cpu.get(cpu.ESI),cpu.get(cpu.EIP)) str += " ebx 0x%08x edi 0x%08x oeax 0x%08x\n"%(cpu.get(cpu.EBX),cpu.get(cpu.EDI),cpu.get(cpu.EAX)) str += " ecx 0x%08x esp 0x%08x eflags 0x%08x\n"%(cpu.get(cpu.ECX),cpu.get(cpu.ESP),cpu.get(cpu.EFLAGS)) str += " edx 0x%08x ebp 0x%08x cr0 0x%08x\n"%(cpu.get(cpu.EDX),cpu.get(cpu.EBP),cpu.get(cpu.CR0)) str += " dr0 0x%08x dr1 0x%08x dr2 0x%08x dr3 0x%08x\n"%(cpu.get(cpu.DR0),cpu.get(cpu.DR1),cpu.get(cpu.DR2),cpu.get(cpu.DR3)) elif foo[0] == "regs*": str = "f eip @ 0x%x\n"%(cpu.get(cpu.EIP)+cpu.get(cpu.CS_base)) str += "f esp @ 0x%x\n"%cpu.get(cpu.ESP) str += "f ebp @ 0x%x\n"%cpu.get(cpu.EBP) str += "f eax @ 0x%x\n"%cpu.get(cpu.EAX) str += "f ebx @ 0x%x\n"%cpu.get(cpu.EBX) str += "f ecx @ 0x%x\n"%cpu.get(cpu.ECX) str += "f edx @ 0x%x\n"%cpu.get(cpu.EDX) str += "f esi @ 0x%x\n"%cpu.get(cpu.ESI) str += "f edi @ 0x%x\n"%cpu.get(cpu.EDI) return str elif foo[0] == "fpregs": # TODO bx.info_registers(2) elif foo[0] == "cont": bx.cont() return "" elif foo[0] == "step": try: bx.stepN(int(foo[1])) except: bx.stepN(1) return "" elif foo[0] == "stepo": bx.step_over() return "" elif foo[0] == "mem": try: if foo[1] == "physical": phys = True return "Using physical memory addressing\n" if foo[1] == "linear": phys = True return "Using linear memory addressing\n" except: return "Use !mem [physical|linear]\n" except: str = "Oops" return str print "Listening at port %d\n"%PORT rs = radapy.RapServer() rs.handle_cmd_system = fun_system rs.handle_cmd_read = fun_read rs.handle_cmd_write = fun_write rs.listen_tcp (PORT) radare-1.5.2/api/python/client.py000066400000000000000000000003431141417717500167070ustar00rootroot00000000000000import sys sys.path.append('.') import radare.remote c = radare.remote.RapClient('localhost', 9999) #c = RapClient('localhost', 9999) fd = c.open("/bin/ls", 0) print c.cmd("px") print c.system("ls") c.close(fd) c.disconnect() radare-1.5.2/api/python/example.py000066400000000000000000000012321141417717500170620ustar00rootroot00000000000000""" Example radare python script pancake """ import string from radare.api import * seek(0x8048000) eval_set("asm.lines", "false") eval_set("asm.comments", "false") #eval_set("asm.bytes", "false") flag_space_set("sections") # enumerate flags for q in flag_list(): print "0x%08x: %s"%(q["addr"], q["name"]) print flag_get("entrypoint") print hex(3) write("90 90 90") print hex(3) print dis(1) print asm("mov eax,33") op = analyze_opcode() print "opcode string: %s"%op["opcode"] print "opcode size: %d"%op["size"] dbg_step(1) #dbg_bp_set(0x8049412) #dbg_continue() # check if we're there #eip = dbg_register_get("eip") #print eip quit() radare-1.5.2/api/python/radare/000077500000000000000000000000001141417717500163155ustar00rootroot00000000000000radare-1.5.2/api/python/radare/__init__.py000066400000000000000000000000001141417717500204140ustar00rootroot00000000000000radare-1.5.2/api/python/radare/analysis.py000066400000000000000000000156351141417717500205240ustar00rootroot00000000000000# move to rapy api try: import r except: pass class Program(): def update(self): self.arch = r.cmd("e asm.arch") self.bits = eval(r.cmd("e asm.bits")) self.os = r.cmd("e asm.os") self.type = r.cmd("e file.type") self.size = eval(r.cmd("i~size[1]#1")) self.vaddr = eval(r.cmd("e io.vaddr")) self.paddr = eval(r.cmd("e io.paddr")) self.bigendian = r.cmd("e cfg.bigendian") self.entrypoint = eval(r.cmd("?v entrypoint")) def __init__(self): self.update() # functions class Function(): def __init__(self): self.name = 0 self.addr = 0 self.size = 0 def analyze(addr): r.cmd(".af*@%s"%addr) analyze = staticmethod(analyze) def add(name, addr, size): r.cmd("CF %s@%s"%(size,addr)) r.cmd("f %s@%s"%(name,addr)) add = staticmethod(add) def remove(addr): r.cmd("CF-@%s"%addr) r.cmd("f -%s"%addr) remove = staticmethod(remove) class Functions(): def update(self): self.list = [] items = r.cmd("CF").split('\n') for a in items: words = a.split(' ') fun = Function() fun.size = eval(words[1]) fun.addr = eval(words[3]) fun.name = words[5] self.list.append(fun) def __init__(self): self.update() # comments class Comment(): def __init__(self): self.addr = 0 self.comment = '' def add(addr, str): r.cmd("CC %s@%s"%(str, addr)) add = staticmethod(add) def remove(addr, str): r.cmd("CC -%s@%s"%(str, addr)) remove = staticmethod(remove) class Comments(): def update(): self.list = [] for a in r.cmd("CC").split('\n'): words = a.split('@') c = Comment() c.addr = eval(words[1]) c.comment = words[0][3:] self.list.append(cmt) def __init__(self): self.update() class Xref(): def __init__(self): self.addr = 0 self.endaddr = 0 class CodeXrefs(): def update(self, addr): self.list = [] for a in r.cmd("Cx").split("\n"): words = a.split(' ') a_addr = eval(words[1]) a_endaddr = eval(words[3]) if addr == None or addr == a_endaddr: x = Xref() x.addr = a_addr x.endaddr = a_endaddr self.list.append(x) def __init__(self, addr=None): self.update(addr) class DataXrefs(): def update(self, addr): self.list = [] for a in r.cmd("CX").split("\n"): words = a.split(' ') if len(a) < 3: continue a_addr = eval(words[1]) a_endaddr = eval(words[3]) if addr == None or addr == a_endaddr: x = Xref() x.addr = a_addr x.endaddr = a_endaddr self.list.append(x) def __init__(self, addr=None): self.update(addr) # imports class Import(): def __init__(self): self.name = '' self.addr = 0 self.endaddr = 0 self.size = 0 class Imports(): # TODO: Use !rabin instead def update(self): self.list = [] items = r.cmd("f~imp.").split('\n') for a in items: # addr size name words = a.split(' ') sec = Symbol() sec.name = words[2].replace('imp.','') sec.addr = eval(words[0]) sec.size = eval(words[1]) sec.endaddr = sec.addr + sec.size self.list.append(sec) def __init__(self): self.update() class Symbol(): def __init__(self): self.name = '' self.addr = 0 self.endaddr = 0 self.size = 0 class Symbols(): # TODO: Use !rabin instead def update(self): self.list = [] items = r.cmd("f~sym.").split('\n') for a in items: # addr size name words = a.split(' ') sec = Symbol() sec.name = words[2].replace('sym.','') sec.addr = eval(words[0]) sec.size = eval(words[1]) sec.endaddr = sec.addr + sec.size self.list.append(sec) def __init__(self): self.update() # sections class Section(): def __init(self): self.name = '' self.addr = 0 self.endaddr = 0 self.size = 0 class Sections(): # TODO: Use !rabin instead def update(self): self.list = [] items = r.cmd("f~section.").split('\n') sec = Section() for a in items: words = a.split(' ') if a.find('_end') == -1: sec = Section() sec.addr = eval(words[0]) sec.name = words[2].replace('section.','') else: sec.endaddr = eval(words[0]) sec.size = sec.endaddr - sec.addr if sec.name != '': self.list.append(sec) def __init__(self): self.update() # basic blocks class BasicBlock(): def __init__(self): self.addr = 0 self.type = '' self.size = 0 self.bytes = '' self.j_true = 0 self.j_false = 0 self.calls = [] class BasicBlocks(): def update(self, addr): self.list = [] bb = BasicBlock() for line in r.cmd("ab 128 @ %s"%addr).split('\n'): words = line.split('=') words[0] = words[0][:-1] # strip ' ' if words[0] == 'offset': bb = BasicBlock() bb.addr = eval(words[1]) elif words[0] == 'type': bb.type = words[1] elif words[0] == 'size': bb.size = eval(words[1]) elif words[0] == 'true': bb.j_true = eval(words[1]) elif words[0] == 'false': bb.j_false = eval(words[1]) elif words[0] == 'bytes': bb.bytes = words[1] self.list.append(bb) elif words[0][:4] == 'call': bb.calls.append(eval(words[1])) def __init__(self, addr): self.update(addr); # opcodes class Opcode(): def assemble(addr, op): r.cmd("wa %s@%d"%(op,addr)) assemble = staticmethod(assemble) def disassemble(addr, n): return r.cmd("pd %s@%d"%(n,addr)) disassemble = staticmethod(disassemble) def __init__(self): self.opcode = '' self.addr = 0 self.size = 0 self.stackop = '' self.bytes = '' self.type = '' self.ref = 0 self.j_true = 0 self.j_false = 0 def __init__(self, addr): for line in r.cmd("ao@%s"%addr): words = line.split('=') words[0] = words[0][:-1] # strip ' ' if words[0] == 'opcode': self.opcode = words[1] elif words[0] == 'size': self.size = eval(words[1]) elif words[0] == 'stackop': self.stackop = words[1] elif words[0] == 'type': self.type = words[1] elif words[0] == 'bytes': self.bytes = words[1] elif words[0] == 'offset': self.addr = words[1] elif words[0] == 'ref': self.ref = eval(words[1]) elif words[0] == 'jump': self.j_true = eval(words[1]) elif words[0] == 'fail': self.j_false = eval(words[1]) class Opcodes(): def update(self, addr, endaddr): self.list = [] while addr < endaddr: op = Opcode(addr) self.list.append(op) addr = addr + op.size def __init__(self, addr, endaddr): self.update(addr, endaddr) # graph class Graph(): def make_dot(addr, file): r.cmd("s %s"%addr) r.cmd("agd %s"%file) make_dot = staticmethod(make_dot) def make_png(addr, file): r.cmd("s %s"%addr) r.cmd("agd %s.dot"%file) r.cmd("!!dot -Tpng -o %s %s.dot"%(file,file)); r.cmd("!!rm %s.dot"%file); make_png = staticmethod(make_png) def add_node(addr, size, cmd): r.cmd("gun %s %s %s"%(addr, size, cmd)) def add_edge(addr, endaddr): r.cmd("gue %s %s"%(addr, endaddr)) def reset(): r.cmd("gur") def view(): r.cmd("guv") def dot(file): r.cmd("gud > %s"%file) add_node = staticmethod(add_node) add_edge = staticmethod(add_edge) reset = staticmethod(reset) view = staticmethod(view) # vm class VM(): def __init__(self): print "VM : TODO" def idc_import(file): r.cmd(".!rsc idc2rdb %s"%file) radare-1.5.2/api/python/radare/api.py000066400000000000000000000170571141417717500174520ustar00rootroot00000000000000"""python api for it This is the API provided with radare to use python inside radare as scripting language for extending its features or automatize some tasks analyzing code, patching binaries or debugging programs. Here's a small example of use: from radare import * seek(0x1024) print hex(3) write("90 90 90") print hex(3) quit() """ # Already imported from radare's core try: import r except: print "Cannot find 'r' import. Importing ramote?" global r import string import binascii import array def hex2bin(str): """ Converts an ascii-hexpair based string into a binary array of bytes """ return binascii.a2b_hex(str.replace(' ','')) def bin2hex(binstr): """ Converts a binary array of bytes into an ascii-hexpair based string """ str = string.lower(binascii.b2a_hex(binstr)) return str # TODO: skip commented lines def slurp_hexpair(file): """ Returns the hexpair string contained in a hexpair-based file in a single line """ fd = open(file, 'r') str = join(fd.readlines(),'\n') fd.close() return str # slurp a raw file or a symbol, returning the hexpair string def slurp(file): """ Returns the hexpair-based representation of a binary file """ fd = open(file, 'r') str = bin2hex(fd.read()) fd.close() return str #def slurp_symbol(file,symbol): def __str_to_hash(str): list = str.split("\n") w = [] t = {} for i in range(1, len(list)): w = list[i].split("=") if (len(w)>1): a = w[0].strip() b = w[1].strip() if (b[0:2] == '0x'): t[a] = long(b,16) elif (b.find(' ') == -1) and (b[0]>='0' and b[0]<='9'): t[a] = long(b,10) else: t[a] = b return t def analyze_opcode(addr=None): """ Returns a hashtable containing the information of the analysis of the opcode in the current seek. This is: 'opcode', 'size', 'type', 'bytes', 'offset', 'ref', 'jump' and 'fail' """ if addr == None: return __str_to_hash(r.cmd("ao")) return __str_to_hash(r.cmd("ao @ 0x%x"%addr)) def analyze_block(addr=None): """ Returns a hashtable containing the information of the analysis of the basic block found in the current seek. This is: 'offset', 'type', 'size', 'call#', 'n_calls', 'true', 'false' and 'bytes' """ if addr == None: return __str_to_hash(r.cmd("ab")) return __str_to_hash(r.cmd("ab @ 0x%x"%addr)) def endian_set(big): r.cmd("eval cfg.bigendian=%d"%big) def read(addr, len): r.cmd("pX %s@%s"%(len,addr)) def disasm(addr, nbytes): r.cmd("pD %s@%s"%(nbytes,addr)) def disasm_ops(addr, n_ops): r.cmd("pd %s@%s"%(n_ops,addr)) def write(hexpair): r.cmd("wx %s"%hexpair) def write_asm(opcode): r.cmd("wa %s"%opcode) def write_string(str): r.cmd("w %s"%str) def write_wide_string(str): r.cmd("ww %s"%str) def write_from_file(file): r.cmd("wf %s"%file) def write_from_hexpair_file(file): r.cmd("wF %s"%file) def seek_undo(): r.cmd("undo") def seek_redo(): r.cmd("uu") def seek_history(): ret = [] list = r.cmd("u*").split("\n") for i in range(1, len(list)): w = list[i].split(" ") if len(w) > 3: t = {} t["addr"] = w[0].strip() ret.append(t) return ret def seek_history_reset(): r.cmd("u!") def write_undo(num): return r.cmd("uw %d"%num) def write_redo(num): return r.cmd("uw -%d"%num) def write_history(): ret = [] list = r.cmd("wu").split("\n") for i in range(1, len(list)): w = list[i].split(" ") if len(w) > 3: t = {} t["size"] = long(w[2].strip(),10) t["addr"] = long(w[3].strip(),16) # TODO moar nfo here ret.append(t) return ret def flag_space_set(name): r.cmd("fs %s"%name) def flag_list(mask): ret = [] list = r.cmd("f~%s"%mask).split("\n") for i in range(1, len(list)): w = list[i].split(" ") if len(w) > 3: t = {} t["addr"] = long(w[1].strip(),16) t["size"] = long(w[3].strip(),10) t["name"] = w[4].strip() ret.append(t) return ret def flag_set(name, addr=None): if addr == None: r.cmd("f %s"%name) else: r.cmd("f %s @ 0xx"%name, addr) def flag_rename(old_name, new_name): r.cmd("fr %s %s"%(old_name,new_name)) def flag_unset(name): r.cmd("f -%s"%name) def flag_get(name): return r.cmd("? %s"%name).split(" ")[0].strip() def meta_comment_add(msg): r.cmd("CC %s"%msg) def type_code(len): r.cmd("Cc %d"%len) def type_data(len): r.cmd("Cd %d"%len) def type_string(len): r.cmd("Cs %d"%len) def copy(num, addr=None): if addr == None: r.cmd("y %d"%num) else: r.cmd("y %d @ 0x%x"%(num,addr)) def paste(addr=None): if addr == None: r.cmd("yy"%num) else: r.cmd("yy @ 0x%x"%(num,addr)) def asm(opcode): """ Returns the hexpair strin representation of the assembled opcode """ return r.cmd("!rasm '%s'"%opcode) def dis(num, addr=None): """ Disassemble 'num' opcodes from the current seek and returns the output """ if addr == None: return r.cmd("pd %d"%num) return r.cmd("pd %d @ 0x%x"%(num,addr)) def bytes(addr=None): """ Returns a zero-terminated string found in current seek """ return r.cmd("pX") def str(addr=None): """ Returns a zero-terminated string found in current seek """ if addr == None: return r.cmd("pz").strip() return r.cmd("pz @ 0x%x"%addr).strip() def dword(num, addr=None): if addr == None: return r.cmd("p64 %d"%num).strip() return r.cmd("p8 %d @ 0x%x"%(num,addr)).strip() def word(num, addr=None): if addr == None: return r.cmd("p32 %d"%num).strip() return r.cmd("p4 %d @ 0x%x"%(num,addr)).strip() def half(num, addr=None): if addr == None: return r.cmd("p16 %d"%num).strip() return r.cmd("p2 %d @ 0x%x"%(num,addr)).strip() def hex(num, addr=None): if addr == None: return r.cmd("p1 %d"%num).strip() return r.cmd("p1 %d @ 0x%x"%(num,addr)).strip() def eval_get(key): return r.cmd("eval %s"%key).strip() def eval_set(key,value): r.cmd("eval %s = %s"%(key,value)) def eval_hash_get(): return __str_to_hash("e") def eval_hash_set(hash): list = hash.keys() for i in range (0, len(list)): key = list[i] value = hash[key] r.cmd("e %s=%s"%(key,value)) def get_byte(addr): return r.cmd("? [1:%s]~[0]"%addr) def write_to_files(file, size): r.cmd("wT %s %s", file, size) def seek(addr): r.cmd("s %s"%addr) def cmp(hexpairs, addr): r.cmd("c %s @ 0x%x"%(hexpairs,addr)) def cmp_file(file, addr): r.cmd("cf %s @ 0x%x"%(file,addr)) def dbg_attach(pid): print r.cmd("!attach %d"%pid) def dbg_detach(pid): print r.cmd("!detach %d"%pid) def dbg_continue(): print r.cmd("!cont") def dbg_step(num): if num < 1: num = 1 r.cmd("!step %d"%num) def dbg_step_over(num): if num < 1: num = 1 r.cmd("!stepo %d",num) def dbg_jmp(addr): r.cmd("!jmp "+addr) def dbg_call(addr): r.cmd("!call "+addr) def dbg_bp_set(addr, type): r.cmd("!bp "+addr) def dbg_bp_unset(addr, type): r.cmd("!bp -"+addr) def dbg_alloc(size): return r.cmd("!alloc %s"%size) def dbg_free(addr): r.cmd("!free %s"%addr) def dbg_backtrace(): ret = [] list = r.cmd("!bt").split("\n") for i in range(1, len(list)): w = list[i].split(" ") if len(w) > 3: t = {} t["addr"] = long(w[1].strip(),16) t["framesz"] = long(w[2].strip(),10) t["varsz"] = long(w[3].strip(),10) ret.append(t) return ret def dbg_dump(name): r.cmd("!dump %s"%name) def dbg_restore(name): r.cmd("!restore %s"%name) def dbg_register_get(name): r.cmd("!reg %s"%(name)) def dbg_register_set(name, value): r.cmd("!reg %s=%s"%(name,value)) def trace_at(addr): return __str_to_hash(r.cmd("at %s"%addr)) def trace_list(): return r.cmd("at*").split("\n") def trace_reset(): r.cmd("at-") def trace_ranges(): return r.cmd("at").split("\n") def hash(algo,size): return r.cmd("#%s %d"%(algo,size)) def graph(addr=None): if addr == None: r.cmd("ag") else: r.cmd("ag @ %s"%addr) def cmd(str): return r.cmd(str) def quit(num): r.cmd("q! %d"%num) radare-1.5.2/api/python/radare/remote.py000066400000000000000000000121671141417717500201710ustar00rootroot00000000000000#!/usr/bin/python # # Python implementation of the radare remote protocol # ##===================================================0 ## server api ##===================================================0 from socket import * from struct import * import traceback import sys RAP_OPEN = 1 RAP_READ = 2 RAP_WRITE = 3 RAP_SEEK = 4 RAP_CLOSE = 5 RAP_SYSTEM = 6 RAP_CMD = 7 RAP_REPLY = 0x80 # TODO: Add udp # TODO: allow to init funptrs with a tuple class RapServer(): def __init__(self): self.offset = 0 self.size = 0 self.handle_eof = None self.handle_cmd_system = None self.handle_cmd_seek = None self.handle_cmd_read = None self.handle_cmd_write = None self.handle_cmd_open = None self.handle_cmd_close = None def _handle_packet(self, c, key): ret = "" if key == RAP_OPEN: buffer = c.recv(2) (flags, length) = unpack(">BB", buffer) file = c.recv(length) if self.handle_cmd_open != None: fd = self.handle_cmd_open(file, flags) else: fd = 3434 buf = pack(">Bi", key|RAP_REPLY, fd) c.send(buf) elif key == RAP_READ: buffer = c.recv(4) (length,) = unpack(">I", buffer) if self.handle_cmd_read != None: ret = str(self.handle_cmd_read(length)) try: lon = len(ret) except: ret = "" lon = 0 else: ret = "" lon = 0; buf = pack(">Bi", key|RAP_REPLY, lon) c.send(buf+ret) elif key == RAP_WRITE: buffer = c.recv(4) (length,) = unpack(">I", buffer) buffer = c.recv(length) # TODO: get buffer and length if self.handle_cmd_write != None: length = self.handle_cmd_write (buffer) buf = pack(">Bi", key|RAP_REPLY, length) c.send(buf) elif key == RAP_SEEK: buffer = c.recv(9) (type, off) = unpack(">BQ", buffer) if self.handle_cmd_seek != None: seek = self.handle_cmd_seek(off, type) else: if type == 0: # SET seek = off; elif type == 1: # CUR seek = seek + off elif type == 2: # END seek = self.size; self.offset = seek buf = pack(">BQ", key|RAP_REPLY, seek) c.send(buf) elif key == RAP_CLOSE: if self.handle_cmd_close != None: length = self.handle_cmd_close (fd) elif key == RAP_SYSTEM: buf = c.recv(4) (length,) = unpack(">i", buf) ret = c.recv(length) if self.handle_cmd_system != None: reply = self.handle_cmd_system(ret) else: reply = "" buf = pack(">Bi", key|RAP_REPLY, len(str(reply))) c.send(buf+reply) else: print "Unknown command" c.close() def _handle_client(self, c): while True: try: buf = c.recv(1) if buf == "" and self.handle_eof is not None: self.handle_eof(c) break if len(buf) == 0: print "Connection closed\n" break self._handle_packet(c, ord(buf)) except KeyboardInterrupt: break def listen_tcp(self, port): s = socket(); s.bind(("0.0.0.0", port)) s.listen(999) print "Listening at port %d"%port while True: (c, (addr,port)) = s.accept() print "New client %s:%d"%(addr,port) self._handle_client(c) ##===================================================0 ## client api ##===================================================0 class RapClient(): def __init__(self, host, port): self.connect_tcp(host, port) def connect_tcp(self, host, port): fd = socket(); fd.connect((host, port)) self.fd = fd def disconnect(self): self.fd.close() self.fd = None def open(self, file, flags): b = pack(">BBB", RAP_OPEN, flags, len(file)) self.fd.send(b) self.fd.send(file) # response buf = self.fd.recv(5) (c,l) = unpack(">Bi", buf) if c != (RAP_REPLY|RAP_OPEN): print "rmt-open: Invalid response packet 0x%02x"%c return l def read(self, count): b = pack(">Bi", RAP_READ, count) #len(buf)) self.fd.send(b) # response buf = self.fd.recv(5) (c,l) = unpack(">Bi", buf) buf = self.fd.recv(l) return buf # TODO: not tested def write(self, buf): #self.fd.send(buf) b = pack(">Bi", RAP_WRITE, len(buf)) self.fd.send(b+buf) # response buf = self.fd.recv(5) (c,l) = unpack(">Bi", buf) if c != (RAP_REPLY|RAP_WRITE): print "rmt-write: Invalid response packet 0x%02x"%c def lseek(self, type, addr): # WTF BBQ? buf = pack(">BBQ", RAP_SEEK, type, addr) self.fd.send(buf) # read response buf = self.fd.recv(5) # XXX READ 5!?!?!? shouldnt be 9 ?!?!? WTF (c,l) = unpack(">Bi", buf) #print "Lseek : %d"%l return l def close(self, fd): buf = pack(">Bi", RAP_CLOSE, fd) self.fd.send(buf) # read response buf = self.fd.recv(5) (c,l) = unpack(">Bi", buf) if c != RAP_REPLY | RAP_CLOSE: print "rmt-close: Invalid response packet" def cmd(self, cmd): buf = pack(">Bi", RAP_CMD, len(str(cmd))) self.fd.send(buf + cmd) # read response buf = self.fd.recv(5) (c,l) = unpack(">Bi", buf) if c != RAP_CMD | RAP_REPLY: print "rmt-cmd: Invalid response packet" return "" buf = self.fd.recv(l) return buf def system(self, cmd): buf = pack(">Bi", RAP_SYSTEM, len(str(cmd))) self.fd.send(buf) self.fd.send(cmd) # read response buf = self.fd.recv(5) (c,l) = unpack(">Bi", buf) if c != RAP_SYSTEM | RAP_REPLY: print "rmt-system: Invalid response packet" return "" if l>0: buf = self.fd.recv(l) return buf radare-1.5.2/api/python/server.py000066400000000000000000000014121141417717500167350ustar00rootroot00000000000000#!/usr/bin/python # # python example using the radapy (remote radare API for python) # # -- pancake // nopcode .org # import radare.remote from string import * PORT = 8888 def fun_system(str): print "CURRENT SEEK IS %d"%radapy.offset return str def fun_open(file,flags): return str def fun_seek(off,type): return str def fun_write(buf): print "WRITING %d bytes (%s)"%(len(buf),buf) return 6 def fun_read(len): global rs print "READ %d bytes from %d\n"% (len, rs.offset) str = "patata" str = str[rs.offset:] return str # main #radapy.handle_cmd_open = fun_open #radapy.handle_cmd_close = fun_close rs = radare.remote.RapServer() rs.handle_cmd_system = fun_system rs.handle_cmd_read = fun_read rs.handle_cmd_write = fun_write rs.size = 10 rs.listen_tcp (PORT) radare-1.5.2/api/python/standalone.py000066400000000000000000000007101141417717500175570ustar00rootroot00000000000000hijack=1 import radare import ranal import radapy # r.cmd() hijacking if hijack: class Food: def cmd(str): global c print "Command to run is (%s)"%str return c.cmd(str) cmd = staticmethod(cmd) global r radare.r = Food c = radapy.RapClient("localhost", 9999) fd = c.open("/bin/ls", 0) print c.cmd("px") #r = Food #r.cmd("#test") print radare.r.cmd("pd 20") radare.seek(33) print radare.disasm(0, 10) # close c.close(fd) c.disconnect() radare-1.5.2/api/ruby/000077500000000000000000000000001141417717500145175ustar00rootroot00000000000000radare-1.5.2/api/ruby/Makefile000066400000000000000000000000561141417717500161600ustar00rootroot00000000000000all: ruby server.rb client: ruby client.rb radare-1.5.2/api/ruby/client.rb000066400000000000000000000002711141417717500163220ustar00rootroot00000000000000require 'radare/api' require 'radare/remote' rc = RapClient.new() rc.connect_tcp("127.0.0.1", 9999) fd = rc.open("/bin/ls", 0) buf = rc.read(10) print Radare.bin2hex(buf) rc.close(fd) radare-1.5.2/api/ruby/radare/000077500000000000000000000000001141417717500157555ustar00rootroot00000000000000radare-1.5.2/api/ruby/radare/api.rb000066400000000000000000000052271141417717500170610ustar00rootroot00000000000000=begin Ruby API for radare scripting plugin author: pancake =end # This class is instantiated as $r = Radare.new() class Radare def initialize() # TODO get 'r' instance here end # helpers def str2hash(str) t = {} list = str.split("\n") list.each do |item| w = item.split("=") if w.size > 1 then t[w[0]]=w[1] end end return t end def hex2bin(str) return [str].pack('H*') # return str.to_i(16).to_s(2) end def bin2hex(binstr) return binstr.unpack('C*').collect{|x| x.to_s 16} # return binstr.to_i(2).to_s(16).upcase end def slurp_hexpair(file) # XXX readlines loads whole file on memory, bad karma return File.readlines(file).map { |l| l.rstrip } end def slurp(file) # XXX outputs scaped shit f = File.open(file) str = "" str = bin2hex(f.read) # f.each_line do |l| # l.strip! # str.concat(bin2hex(l)) # end return str end # core def seek(addr) $r.cmd("s %s"%addr) end # code def comment_add(addr, str) $r.cmd("CC #{str} @ 0x%08llx"%addr) end def comment_del(str) $r.cmd("CC -#{str}"); end def analyze_opcode(addr) begin return str2hash($r.cmd("ao @ 0x%08x"%addr)) rescue return str2hash($r.cmd("ao @ #{addr}")) end end def analyze_block(addr) begin return str2hash($r.cmd("ab")) rescue return str2hash($r.cmd("ab @ 0x%x"%addr)) end end def endian_set(big) $r.cmd("eval cfg.bigendian=%d"%big) end def write(hexpair) $r.cmd("wx %s"%hexpair) end def write_asm(opcode) $r.cmd("wa %s"%opcode) end def write_string(str) $r.cmd("w %s"%str) end def write_wide_string(str) $r.cmd("ww %s"%str) end def write_from_file(file) $r.cmd("wf %s"%file) end def write_from_hexpair_file(file) $r.cmd("wF %s"%file) end def seek_undo() $r.cmd("undo") end def seek_redo() $r.cmd("uu") end =begin XXX def seek_history() ret = [] list = r.cmd("u*").split("\n") for i in range(1, len(list)): w = list[i].split(" ") if len(w) > 3: t = {} t["addr"] = w[0].strip() ret.append(t) return ret end =end def seek_history_reset() $r.cmd("u!") end def write_undo(num) return $r.cmd("uw %d"%num) end def write_redo(num) return $r.cmd("uw -%d"%num) end =begin XXX def write_history() ret = [] list = r.cmd("wu").split("\n") for i in range(1, len(list)): w = list[i].split(" ") if len(w) > 3: t = {} t["size"] = long(w[2].strip(),10) t["addr"] = long(w[3].strip(),16) # TODO moar nfo here ret.append(t) return ret # debugger end =end def step(addr) $r.cmd("!step") end def continue() $r.cmd("!cont") end def until(addr) $r.cmd("!cont #{addr}") end def quit() $r.cmd("q!") end end radare-1.5.2/api/ruby/radare/remote.rb000066400000000000000000000075631141417717500176100ustar00rootroot00000000000000require 'socket' RAP_OPEN = 1 RAP_READ = 2 RAP_WRITE = 3 RAP_SEEK = 4 RAP_CLOSE = 5 RAP_SYSTEM = 6 RAP_CMD = 7 RAP_REPLY = 0x80 class RapServer # constructor def initialize() # TODO end def handle_open(file, flags) print "FILE #{file}\n" print "FLAGS #{flags}\n" return 0 end def handle_system(cmd) print "SYSTEM #{cmd}\n" return "" end def handle_close(fd) print "Connection closed\n" return "" end def handle_cmd(cmd) print "CMD #{cmd}\n" return "" end def handle_read(length) print "READ #{length}\n" return "patata" end def handle_write(buffer) print "WRITE #{buffer.length}\n" return "patata" end def handle_lseek(offset, type) case type when 0 return offset when 1 return seek+offset when 2 return 6 end return offset end def handle_packet(c, packet) case packet[0] when RAP_OPEN flags = c.read(1)[0].to_i length = c.read(1)[0].to_i file = c.read(length) ret = handle_open(file, flags) buf = [RAP_OPEN|RAP_REPLY, ret].pack("CN") c.write(buf) when RAP_READ length = c.read(4).unpack("N")[0] ret = handle_read(length) buf = [RAP_READ|RAP_REPLY, ret.length].pack("CN").concat(ret) buf.slice(0, length) c.write(buf) when RAP_WRITE length = c.read(4).unpack("N")[0].to_i buf = c.read(length) ret = handle_write(buf) buf = [RAP_WRITE|RAP_REPLY, ret].pack("CN") c.write(buf) when RAP_SEEK type = c.read(1).unpack("C")[0].to_i offset = c.read(8).unpack("Q")[0] seek = handle_lseek(offset, type) # seek = seek.to_s.reverse.to_i # TODO: swap seek value (64 bit big endian!) sbuf = [seek].pack("Q").reverse #print "SBUF #{sbuf} (#{seek})\n" buf = [RAP_SEEK|RAP_REPLY].pack("C").concat(sbuf) c.write(buf) when RAP_SYSTEM length = c.read(4).unpack("N")[0].to_i buf = c.read(length) str = handle_system(buf) buf = [RAP_SYSTEM|RAP_REPLY, str.length].pack("CN").concat(str) c.write(buf) when RAP_CMD length = c.read(4).unpack("N")[0].to_i buf = c.read(length) str = handle_cmd(buf) buf = [RAP_CMD|RAP_REPLY, str.length].pack("CN").concat(str) c.write(buf) when RAP_CLOSE fd = c.read(4).unpack("N")[0].to_i handle_close(fd); buf = [RAP_SEEK|RAP_REPLY, 0].pack("CC") c.write(buf) end end def handle_client(client) while ((cmd=client.read(1)) != nil) handle_packet(client, cmd) end end def listen_tcp(port) server = TCPServer.new('0.0.0.0', port) while(client=server.accept) handle_client(client) end end end class RapClient fd = -1 # huh? def initialize() # TODO end def open(file, flags) print "Opening #{file}\n" buf = [RAP_OPEN, flags, file.length].pack("CCC") buf.concat(file) @fd.write(buf) # parse reply buf = @fd.read(1) fh = @fd.read(4).unpack("N")[0] print "FH=#{fh}\n" fh end def connect_tcp(host, port) print "==> Connecting to #{host}:#{port}\n" @fd = TCPSocket.new(host, port) end def disconnect() @fd.close end def lseek(addr, type) print "lseek #{addr}\n" buf = [RAP_SEEK, type].pack("CC") sbuf = [addr].pack("Q").reverse # big endian u64 buf.concat(sbuf) @fd.write(buf) # read reply buf = @fd.read(1) ret = @fd.read(8).reverse.unpack("Q")[0] print "lseek #{ret}\n" ret end def write(buffer) # TODO print "WRITE #{buffer.length}\n" buf = [RAP_WRITE,buffer.length].pack("CN").concat(buffer) @fd.write(buf) # read reply @fd.read(1) # must be RAP_WRITE|RAP_REPLY ret = @fd.read(4).unpack("N")[0] print "WRITE RET IS %d\n"%ret ret end def read(len) buf = [RAP_READ,len].pack("CN") #print @fd.methods.join("\n") @fd.write(buf) # read reply @fd.read(1) # must be RAP_READ|RAP_REPLY len = @fd.read(4).unpack("N")[0] buf = @fd.read(len[0].to_i) return buf end def close(fh) print "==> Close\n" buf = [RAP_CLOSE, fh].pack("CN") @fd.write(buf) buf = @fd.read(1) ret = @fd.read(4).unpack("N")[0] ret end end radare-1.5.2/api/ruby/server.rb000066400000000000000000000004531141417717500163540ustar00rootroot00000000000000require 'radare/api' require 'radare/remote' #print "#{bin2hex("\x90\x12\x33")}\n" port = 9999 class MyRapServer < RapServer def handle_open(file, args) print "OPEN HOOKED\n" return super(file, args) end end print "Listening at #{port}\n" rs = MyRapServer.new() rs.listen_tcp(port) radare-1.5.2/autogen.sh000066400000000000000000000002511141417717500147610ustar00rootroot00000000000000#!/bin/sh acr -p if [ ! $? = 0 ]; then echo "No 'acr' found. You can download it from:" echo " http://www.lolcathost.org/b/acr-0.7.2.tar.gz" exit 1 else exit $? fi radare-1.5.2/config.mk.acr000066400000000000000000000030311141417717500153240ustar00rootroot00000000000000ROOT?=/ CC=@CC@ CXX=@CXX@ VALAC=@VALAC@ HAVE_GUI=@HAVE_GUI@ HAVE_VALAC=@HAVE_VALAC@ CFLAGS=@CFLAGS@ LDFLAGS=@LDFLAGS@ JAVAC=javac -source 1.5 -Xlint:unchecked HAVE_LUA_H=@HAVE_LUA_H@ HAVE_LIB_PYTHON2_5=@HAVE_LIB_PYTHON2_5@ HAVE_LIB_PYTHON2_6=@HAVE_LIB_PYTHON2_6@ W32=@W32@ DARWIN=@DARWIN@ MAEMO=@MAEMO@ SOLARIS=@SOLARIS@ NONFREE=@NONFREE@ DEBUGGER=@DEBUGGER@ SYSPROXY=@SYSPROXY@ #CFLAGS+=-Wall # TODO move these stuff to config.h.acr #CFLAGS+=-DVERSION=\"@VERSION@\" #CFLAGS+=-DLIL_ENDIAN=@LIL_ENDIAN@ RADARE_LIBS=@RADARE_LIBS@ -lm ##HAVE_LIB_EWF## RADARE_OBJ+=plug/io/ewf.o RADARE_LIBS+=-lewf ##HAVE_LIB_EWF## BINSFX= DL_LIBS=@DL_LIBS@ ##W32## BINSFX=.exe DL_LIBS= ##W32## HAVE_LANG_LUA=@HAVE_LANG_LUA@ LUA_LIBS=@LUA_LIBS@ ##SOLARIS## OSOLIBS=-lsocket -lnsl ##SOLARIS## ##SYSPROXY## CFLAGS+=-DSYSPROXY #SYSPROXY_OBJ+=sysproxy.o rpc.o syscall.S syscall-linux.o SYSPROXY_OBJ+=syscall.o rpc.o syscall-linux.o ##SYSPROXY## ##SOLARIS## RADARE_LIBS+=-lsocket ##SOLARIS## CPU=@TARGET_CPU@ TARGET=@TARGET@ SHARED_CFLAGS=@SHARED_CFLAGS@ SHARED_EXT=@SHARED_EXT@ INSTALL=@INSTALL@ INSTALL_DIR=${INSTALL} -d INSTALL_LIB=${INSTALL} -c INSTALL_MAN=${INSTALL} -m 444 INSTALL_DATA=${INSTALL} -m 644 INSTALL_PROGRAM=${INSTALL} -m 755 INSTALL_SCRIPT=${INSTALL} -m 755 GTK_FLAGS=@GTK_FLAGS@ VTE_FLAGS=@VTE_FLAGS@ GTK_LIBS=@GTK_LIBS@ VTE_LIBS=@VTE_LIBS@ PREFIX=${ROOT}@PREFIX@ LIBDIR=${ROOT}@LIBDIR@ DATADIR=${ROOT}@DATADIR@ LIBEXECDIR=${ROOT}/@LIBEXECDIR@ SIZEOF_OFF_T=@SIZEOF_OFF_T@ HAVE_LIB_READLINE=@HAVE_LIB_READLINE@ HAVE_LIB_EWF=@HAVE_LIB_EWF@ VERBOSE?=1 radare-1.5.2/configure000077500000000000000000000423311141417717500146770ustar00rootroot00000000000000#!/bin/sh # This script was automatically generated by ACR v0.8 # @author: pancake # @url: http://news.nopcode.org/pancake/acr.html do_remove() { if [ "${ACR_RMFILES}" ]; then printf "cleaning temporally files... " rm -f ${ACR_RMFILES} echo "done" fi } control_c() { printf "\n\n^C control-c : script execution interrupted.\n" do_remove exit 1 } trap control_c 2 READLINE=1 USBSNF=1 NONFREE=1 DEBUGGER=1 JAVA=0 WII=0 W32=0 SYSPROXY=0 VALA=1 WANT_EWF=1 MAEMO=0 HAVE_GUI=1 split_host() { S="$" while : ; do ENVWORDS="${ENVWORDS} $1_CPU $1_OS" STR=`eval "echo ${S}$1"` SPLIT_CPU="`echo "$STR" | cut -d - -f 1`" SPLIT_OS="`echo "$STR" | cut -d - -f 3`" eval "$1_CPU=\"$SPLIT_CPU\"" eval "$1_OS=\"$SPLIT_OS\"" shift [ -z "$1" ] && break done } VPATH=`dirname ${0}` if [ "${VPATH}" = "." ]; then WODIS=current else if [ "${VPATH}" = "${PWD}" ]; then VPATH=. WODIS=current else WODIS=crosspath CURDIR=$PWD cd $VPATH VPATH="${PWD}/" cd $CURDIR fi fi guess_os() { if [ -e "${VPATH}/config.guess" ]; then sh ${VPATH}/config.guess return fi CPU="`uname -m|sed -e 's, ,,g'`" OS="`uname -s|awk '{print(tolower($0))}'`" GNU="`uname --help 2>&1 | grep gnu`" [ "${GNU}" ] && OS="${OS}-gnu" [ "${CPU}" = ppc ] && CPU="powerpc" echo "${CPU}-unknown-${OS}" } SEARCHPATH="/usr /usr/local /usr/pkg /sw" : ${PREFIX:=/usr/local} CROSSBUILD=0 BUILD=`guess_os` HOST="${BUILD}" TARGET="${HOST}" SYSCONFDIR="" create_environ() { : ${EPREFIX:=${PREFIX}} : ${SPREFIX:=${PREFIX}} : ${BINDIR:=${SPREFIX}/bin} : ${SBINDIR:=${PREFIX}/sbin} : ${SYSCONFDIR:=${SPREFIX}/etc} : ${LIBDIR:=${SPREFIX}/lib} : ${LIBEXECDIR:=${SPREFIX}/libexec} : ${DATADIR:=${SPREFIX}/share} : ${INCLUDEDIR:=${SPREFIX}/include} : ${INFODIR:=${SPREFIX}/info} : ${MANDIR:=${SPREFIX}/man} : ${LOCALSTATEDIR:=${SPREFIX}/var} for A in `echo ${PATH} | sed -e 's,:, ,g'` ; do if [ -e $A/install ]; then : ${INSTALL:=$A/install} fi done : ${INSTALL_DIR:=${INSTALL} -d} : ${INSTALL_DATA:=${INSTALL} -m 644} : ${INSTALL_SCRIPT:=${INSTALL} -m 755} : ${INSTALL_PROGRAM:=${INSTALL} -m 755 -s} : ${INSTALL_MAN:=${INSTALL} -m 444} : ${INSTALL_LIB:=${INSTALL} -c} PKGNAME='radare' ; VERSION='1.5.2' ; CONTACT_MAIL="pancake@youterm.com" ; CONTACT_NAME="pancake" ; CONTACT="pancake " ; } show_usage() { cat < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor CXX C++ compiler command CXXFLAGS C++ compiler flags RUBY Ruby interpreter path or binary name. LUA path to lua interpreter\n" printf "\nReport bugs to: pancake " echo "" exit 0 } take_environ() { : ${SH:=/bin/sh} : ${CPP:=cpp} : ${CC:=gcc} : ${CPP:=cpp} : ${CXX:=g++} : ${LUA:=lua} : ${PREFIX:=/usr/local/} } show_version() { echo "radare-1.5.2 configuration script done with acr v0.8. The 'Free Software Foundation' message is only for autodetection. Originally written by pancake ." exit 0 } parse_options() { flag=`echo $1| cut -d = -f 1` value=`echo $1| awk 'BEGIN{FS="=";}{print $2}'` flag2=`echo $flag|cut -f2- -d -| sed -e 's,-,_,g' -e 's,^_,,g'|tr '[a-z]' '[A-Z]'` case $flag in "-h"|"--help"|"--hel"|"--h"|"--he"|"-help") show_usage ; ;; "-V"|"-version"|"--version") show_version ; ;; "-r"|"--r"|"--report") echo "PKGNAME: radare" echo "VERSION: 1.5.2" echo "LANGS: c c++ ruby python lua" echo "REQUIRED: libdl lib>=vala-1.0 libvala-1.0>=0.5.0" echo "OPTIONAL: libewf" echo "PKG-CONFIG: gtk+-2.0 vte" echo "FLAGS: --without-readline --without-usb-sniffer --without-nonfree --without-debugger --with-java --with-wii --enable-w32 --with-sysproxy --without-vala --without-ewf --with-maemo --without-gui" exit 0 ;; "--cache-file") # ignored: acr have no cache ;; "--build") BUILD="$value"; ;; "--host") CROSSBUILD=1 HOST="$value"; ;; "--target") TARGET="$value"; ;; "--prefix") PREFIX="$value"; ;; "--exec-prefix") EPREFIX="$value"; ;; "--sandbox"|"--sprefix") SPREFIX="$value"; ;; "--bindir") BINDIR="$value"; ;; "--sbindir") SBINDIR="$value"; ;; "--libexecdir") LIBEXECDIR="$value"; ;; "--datadir") DATADIR="$value"; ;; "--sysconfdir") SYSCONFDIR="$value"; ;; "--sharedstatedir") SHAREDSTATEDIR="$value"; ;; "--localstatedir") LOCALSTATEDIR="$value"; ;; "--libdir") LIBDIR="$value"; LDFLAGS="${LDFLAGS} -L$value -Wl,-R$value"; ;; "--includedir") INCLUDEDIR="$value"; CFLAGS="${CFLAGS} -I$value"; ;; "--infodir") INFODIR="$value"; ;; "--mandir") MANDIR="$value"; ;; "--without-readline") READLINE="0"; ;; "--without-usb-sniffer") USBSNF="0"; ;; "--without-nonfree") NONFREE="0"; ;; "--without-debugger") DEBUGGER="0"; ;; "--with-java") JAVA="1"; ;; "--with-wii") WII="1"; ;; "--enable-w32") W32="1"; ;; "--with-sysproxy") SYSPROXY="1"; ;; "--without-vala") VALA="0"; ;; "--without-ewf") WANT_EWF="0"; ;; "--with-maemo") MAEMO="1"; ;; "--without-gui") HAVE_GUI="0"; ;; *) if [ "$value" ]; then eval "`echo $flag2=$value`" ; else echo ; echo "WARNING: Unknown flag '$flag'." >&2 ; echo ; fi ;; esac } # MAIN # take_environ split_host BUILD HOST TARGET [ -z "$ACRHOOK" ] && ACRHOOK=./configure.hook [ -e "$ACRHOOK" ] && . ${ACRHOOK} while : ; do [ -z "$1" ] && break parse_options $1 shift done ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS LDFLAGS HAVE_LANG_C CXX CXXFLAGS HAVE_LANG_CXX LIL_ENDIAN BIG_ENDIAN BYTEORDER HAVE_LIB_DL DL_LIBS SOLARIS DARWIN SHARED_EXT SHARED_CFLAGS WINDOWS READLINE HAVE_RL_COMPLETION_MATCHES RADARE_LIBS HAVE_LIB_READLINE HAVE_USB_H USBSNF NONFREE DEBUGGER JAVA WII W32 SYSPROXY RUBY RUBY_VERSION PYTHON HAVE_LANG_PYTHON HAVE_INSTALL VALA HAVE_VALAC VALAC HAVE_VALA_1_0_VERSION_0_5_0 _CFLAGS SIZEOF_OFF_T HAVE_LIB_EWF WANT_EWF HAVE_LIB_PYTHON2_5 HAVE_LIB_PYTHON2_6 MAEMO HAVE_GUI GTK_FLAGS GTK_LIBS HAVE_PKGCFG_GTK_2_0 VTE_FLAGS VTE_LIBS HAVE_PKGCFG_VTE HAVE_VALA HAVE_LUA_H LUA HAVE_LANG_LUA LUA_LIBS HAVE_LIB_LUA HAVE_LIB_LUA5_1" create_environ echo "checking build system type... ${BUILD}" echo "checking host system type... ${HOST}" echo "checking target system type... ${TARGET}" [ "${CROSSBUILD}" = 1 ] && echo "using crosscompilation mode." #split_host BUILD HOST TARGET [ -n "${prefix}" ] && PREFIX=${prefix} echo "checking for working directories... ${WODIS}" echo "using prefix '${PREFIX}'" ACR_RMFILES=" test.c a.out a.exe test.cxx a.out a.exe" : COMPILER=CC printf "checking for c compiler... " HAVE_LANG_C=1 if [ "${CROSSBUILD}" = 1 ]; then (command -v ${HOST}-${CC} >/dev/null 2>&1) if [ $? = 0 ]; then CC="${HOST}-${CC}"; fi fi echo "main(){}" > test.c (exec ${CC} ${CFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1) if [ $? = 0 ]; then echo ${CC}; else echo no ; HAVE_LANG_C=0 do_remove echo "ERROR: ${CC} cannot create executables" >&2 ; exit 1 ; fi COMPILER=CXX HAVE_LANG_CXX=1 printf "checking for c++ compiler... " if [ "${CROSSBUILD}" = 1 ]; then (command -v ${HOST}-${CXX} 2>&1 >/dev/null) if [ "$?" = 0 ]; then CXX="${HOST}-${CXX}"; fi fi echo "#include " > test.cxx echo "main(){ std::cout << ""; }" >> test.cxx (exec ${CXX} ${CXXFLAGS} ${LDFLAGS} test.cxx -lstdc++ >/dev/null 2>&1) if [ 0 = 0 ]; then echo ${CXX}; else HAVE_LANG_CXX=0 echo no ; fi printf "checking host endianness... " echo 'main(){int a=1;char *b=(char*)&a;printf("%d",b[0]);}' > test.c ${CC} ${CFLAGS} ${LDFLAGS} -o a.out test.c >/dev/null 2>&1 if [ ! $? = 0 ]; then echo unexpected error do_remove exit 1 fi LIL_ENDIAN=$(./a.out) if [ "${LIL_ENDIAN}" = 1 ]; then BYTEORDER=1234 BIG_ENDIAN=0 echo little else BYTEORDER=4321 BIG_ENDIAN=1 LIL_ENDIAN=0 echo big fi printf "checking for dynamic library... " HAVE_LIB_DL=0 for OS in linux syllable sunos darwin beos solaris ; do if [ "${HOST_OS}" = "${OS}" ]; then HAVE_LIB_DL=1 break; fi done if [ "${HAVE_LIB_DL}" = 1 ]; then DL_LIBS="-ldl" echo "required" else DL_LIBS="" echo "libc" fi SOLARIS="0" DARWIN="0" if [ "$HOST_OS" = "sunos" ]; then SOLARIS="1"; fi if [ "$HOST_OS" = "solaris" ]; then SOLARIS="1"; fi if [ "$HOST_OS" = "darwin" ]; then DARWIN="1" SHARED_EXT="dylib" SHARED_CFLAGS="-dynamiclib" else SHARED_EXT="so" SHARED_CFLAGS="-fPIC -shared"; fi if [ "$HOST_OS" = "mingw" ]; then WINDOWS="1"; fi if [ "$WINDOWS" = "1" ]; then SHARED_EXT="dll"; fi printf "checking function rl_completion_matches() in readline... " echo "main(){ rl_completion_matches(0); }" > test.c ${CC} ${CFLAGS} ${LDFLAGS} -lreadline test.c >/dev/null 2>&1 if [ $? = 0 ]; then echo yes ; HAVE_RL_COMPLETION_MATCHES=1 else HAVE_RL_COMPLETION_MATCHES=0 ; echo no ; fi RADARE_LIBS="" HAVE_LIB_READLINE="0" if [ "$HAVE_RL_COMPLETION_MATCHES" = "1" ]; then HAVE_LIB_READLINE="1" RADARE_LIBS="-lreadline"; fi if [ "$READLINE" = "0" ]; then HAVE_LIB_READLINE="0"; fi check_include() { VAR=$1 INC=$2 _REQUIRED=$3 printf "checking for $2... " echo > test.c echo "#include <${INC}>" >>test.c echo "main(){}" >>test.c eval \$${COMPILER} ${CFLAGS} test.c >/dev/null 2>&1 if [ $? = 0 ]; then eval ${VAR}=1 echo yes else eval ${VAR}=0 echo no ; fi } check_include HAVE_USB_H usb.h 0 if [ "$HAVE_USB_H" = "0" ]; then USBSNF="0"; fi printf "checking for ruby... " HAVE_LANG_RUBY=0 for A in `echo ${PATH} | sed -e 's,:, ,g'`; do RUBY=`ls ${A}/ruby* 2>/dev/null` if [ "${RUBY}" ]; then RUBY=`echo ${RUBY} | cut -d\ -f 1` RUBY_VERSION=`echo ${RUBY} ${A} | awk '{ print substr($1,length($2)+6) }'` echo ${RUBY} ; HAVE_LANG_RUBY=1 ; break fi done if [ -z "${RUBY}" ]; then echo no ; fi printf "checking for python... " HAVE_LANG_PYTHON=0 for A in `echo ${PATH} | sed -e 's,:, ,g'` ; do PYTHON=`ls ${A}/python* 2>/dev/null` if [ "${PYTHON}" ]; then PYTHON=`echo ${PYTHON} | awk '{print $1; }'` echo ${PYTHON} ; HAVE_LANG_PYTHON=1 ; break ; fi done if [ -z "${PYTHON}" ]; then echo no ; fi printf "checking for install... " if [ -x "${INSTALL}" ]; then FIND=${INSTALL} else FIND="" for A in `echo ${PATH} | sed -e 's,:, ,g'`; do if [ -x "${A}/install" ]; then FIND="${A}/install" break; fi done fi if [ -n "${FIND}" ]; then echo ${FIND}; HAVE_INSTALL=1 INSTALL=${FIND} else HAVE_INSTALL=0 INSTALL=install echo no ; fi printf "checking for valac... " if [ -x "${VALAC}" ]; then FIND=${VALAC} else FIND="" for A in `echo ${PATH} | sed -e 's,:, ,g'`; do if [ -x "${A}/valac" ]; then FIND="${A}/valac" break; fi done fi if [ -n "${FIND}" ]; then echo ${FIND}; HAVE_VALAC=1 VALAC=${FIND} else HAVE_VALAC=0 VALAC=valac echo no ; fi HAVE_VALA_1_0_VERSION_0_5_0=0 printf "checking version of library vala-1.0 >= 0.5.0... " pkg-config --atleast-version=0.5.0 vala-1.0 >/dev/null 2>&1 if [ $? = 0 ]; then HAVE_VALA_1_0_VERSION_0_5_0=1 ; echo ok; else echo "no" ; fi if [ "$HAVE_VALA_1_0_VERSION_0_5_0" = "0" ]; then echo " Needs vala 0.5.0 at least" >&2 HAVE_VALAC="0 VALAC = ''"; fi _CFLAGS="$CFLAGS" CFLAGS="${CFLAGS} -include /usr/include/sys/types.h -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64" SIZEOF_OFF_T="1" printf 'checking size of off_t... ' echo 'main(){printf("%d",sizeof(off_t));}' >test.c ${CC} ${CFLAGS} -o a.out test.c >/dev/null 2>&1 if [ 0 = $? ]; then SIZEOF_OFF_T=$(./a.out) echo ${SIZEOF_OFF_T} HAVE_SIZEOF_OFF_T=1 else SIZEOF_OFF_T=0 ; echo error HAVE_SIZEOF_OFF_T=0 fi CFLAGS="$_CFLAGS" check_library() { VAR=$1 S="$" _REQUIRED=$3 _CHKLIB_NAME=$2 _CHKLIB_LIBS=$(echo "-l${_CHKLIB_NAME}" | sed 's,\+, -l,g') printf "checking for lib${_CHKLIB_NAME} ... " echo "main(){ }" > test.c eval ${S}${COMPILER} ${CFLAGS} ${LDFLAGS} ${_CHKLIB_LIBS} test.c >/dev/null 2>&1 if [ $? = 0 ]; then eval ${VAR}=1 echo yes else eval ${VAR}=0 echo no ; fi } check_library HAVE_LIB_EWF ewf 0 if [ "$WANT_EWF" = "0" ]; then HAVE_LIB_EWF="0"; fi check_library HAVE_LIB_PYTHON2_5 python2.5 0 check_library HAVE_LIB_PYTHON2_6 python2.6 0 printf 'checking pkg-config flags for gtk+-2.0... ' tmp=`pkg-config --cflags gtk+-2.0 2>/dev/null` if [ $? = 1 ]; then echo no ; HAVE_PKGCFG_GTK_2_0=0; else GTK_FLAGS=$tmp; tmp=`pkg-config --libs gtk+-2.0 2>/dev/null` if [ ! $? = 1 ]; then echo yes; HAVE_PKGCFG_GTK_2_0=1; GTK_LIBS=$tmp; fi; fi if [ "$GTK_FLAGS" = "" ]; then HAVE_GUI="0"; fi printf 'checking pkg-config flags for vte... ' tmp=`pkg-config --cflags vte 2>/dev/null` if [ $? = 1 ]; then echo no ; HAVE_PKGCFG_VTE=0; else VTE_FLAGS=$tmp; tmp=`pkg-config --libs vte 2>/dev/null` if [ ! $? = 1 ]; then echo yes; HAVE_PKGCFG_VTE=1; VTE_LIBS=$tmp; fi; fi if [ "$VTE_FLAGS" = "" ]; then HAVE_GUI="0"; fi HAVE_VALAC="1" HAVE_VALA="1" VALAC="1" if [ "$HAVE_GUI" = "0" ]; then VALAC="0" HAVE_VALA="0" echo " Vala build disabled, no gtk-dev or libvte-dev found" >&2 ; fi check_include HAVE_LUA_H lua.h 0 printf "checking for lua... " HAVE_LANG_LUA=0 ${LUA} -v > /dev/null 2>&1 if [ $? = 0 ]; then echo ok ; HAVE_LANG_LUA=1 ; echo "checking for lua libs... " check_library HAVE_LIB_LUA lua 0 check_library HAVE_LIB_LUA5_1 lua5.1 0 if [ "${HAVE_LIB_LUA}" = 1 ]; then LUA_LIBS=-llua fi if [ "${HAVE_LIB_LUA5_1}" = 1 ]; then LUA_LIBS=-llua5.1 fi else echo no ; fi SEDFLAGS=" -e '" COUNT=0 for A in ${ENVWORDS} ; do [ "${A}" = VPATH ] && continue [ "${A}" = srcdir ] && continue eval "VAR=\$${A}" VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`" [ $COUNT = 10 ] && COUNT=0 && SEDFLAGS="${SEDFLAGS}' -e '" COUNT=$(($COUNT+1)) SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;" done SEDFLAGS="${SEDFLAGS}'" for A in . ./global.h ./config.mk src src/rsc/rsc src/rfile ; do # SUBDIRS if [ -f "${VPATH}/${A}.acr" ]; then SD_TARGET=${A} else if [ -d "${VPATH}/${A}" ]; then SD_TARGET=${A}/Makefile mkdir -p ${A} else echo "ERROR: Cannot find ${VPATH}/${A}.acr" >&2 exit 1 fi fi echo "creating ${SD_TARGET}" mkdir -p $(echo ${A} | sed -e "s,/`basename ${A}`$,,g") cat ${VPATH}/${SD_TARGET}.acr | \ eval sed -e "s,@VPATH@,${VPATH}/${A},g" ${SEDFLAGS} > ${SD_TARGET}.tmp for A in ${ENVWORDS}; do VALUE=`eval echo "$"${A}` if [ "$VALUE" = 0 ]; then ## FALSE MARK="##${A}##" if [ -n "`grep \"${MARK}\" ${SD_TARGET}.tmp`" ]; then mv ${SD_TARGET}.tmp ${SD_TARGET}.tmp2 cat ${SD_TARGET}.tmp2 | MARK=$MARK awk 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp fi fi done mv ${SD_TARGET}.tmp ${SD_TARGET} && rm -f ${SD_TARGET}.tmp2 if [ $? = 1 ]; then echo Cannot write target file ; control_c ; fi done do_remove echo echo "Final report:" for A in HAVE_GUI WII LUA_LIBS HAVE_LIB_LUA MAEMO VALA JAVA USBSNF SYSPROXY DEBUGGER HAVE_LIB_EWF HAVE_LIB_READLINE ; do # REPORT eval VAL="\$${A}" [ -z "${VAL}" ] && VAL="(null)" echo " - ${A} = ${VAL}" done radare-1.5.2/configure.acr000066400000000000000000000063671141417717500154510ustar00rootroot00000000000000PKGNAME radare VERSION 1.5.2 CONTACT pancake ; pancake@youterm.com LANG_C! LANG_CXX CHECK_ENDIAN USE_DL SOLARIS = 0 ; DARWIN = 0 ; IFEQ HOST_OS sunos ; { SOLARIS = 1 ; } IFEQ HOST_OS solaris ; { SOLARIS = 1 ; } IFEQ HOST_OS darwin ; { DARWIN = 1 ; SHARED_EXT = dylib ; SHARED_CFLAGS = -dynamiclib ; }{ SHARED_EXT = so ; SHARED_CFLAGS = -fPIC -shared ; } IFEQ HOST_OS mingw ; { WINDOWS = 1 ; } IFEQ WINDOWS 1 ; { SHARED_EXT = dll ; } (( Check for the GNU readline library )) ARG_WITHOUT READLINE readline disables the readline support ; CHKFNC readline rl_completion_matches RADARE_LIBS = '' ; HAVE_LIB_READLINE = 0 ; IF HAVE_RL_COMPLETION_MATCHES { HAVE_LIB_READLINE = 1 ; RADARE_LIBS = -lreadline ; } IFNOT READLINE { HAVE_LIB_READLINE = 0 ; } (( usb sniffer )) CHKINC usb.h ARG_WITHOUT USBSNF usb-sniffer disables the build of the libusb sniffer ; IFNOT HAVE_USB_H { USBSNF = 0 ; } (( acr option flags )) ARG_WITHOUT NONFREE nonfree disables the build of non-free sourcefiles ; ARG_WITHOUT DEBUGGER debugger disables the debugger layer ; ARG_WITH JAVA java builds the java api ; ARG_WITH WII wii builds the wii plugin for usbgecko ; ARG_ENABLE W32 w32 enables the build of w32 version using mingw32 ; ARG_WITH SYSPROXY sysproxy builds the syscall proxy plugin ; LANG_RUBY LANG_PYTHON CHKPRG INSTALL install (( This is required for Solaris (and maybe other) ============================================== CHKPRG GINSTALL ginstall IFNOTNULL GINSTALL { INSTALL ${GINSTALL} } )) ARG_WITHOUT VALA vala disables the build of all the vala-dependant parts ; CHKPRG VALAC valac CHKVER vala-1.0 0.5.0 (( temporary fix to avoid vala )) IFNOT HAVE_VALA_1_0_VERSION_0_5_0 { ECHO Needs vala 0.5.0 at least ; HAVE_VALAC = 0 VALAC = '' ; } (( IFEQ VALAC valac ; { WITH_VALA = 0 ; VALA = 0 ; HAVE_GUI = 0 ; ECHO No valac found ; } )) (( Check off_t size )) _CFLAGS = $CFLAGS ; CFLAGS += -include /usr/include/sys/types.h -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ; SIZEOF_OFF_T = 1 ; SIZEOF off_t ; CFLAGS = $_CFLAGS ; CHKLIB ewf ARG_WITHOUT WANT_EWF ewf disable EWF dependency ; IFNOT WANT_EWF { HAVE_LIB_EWF = 0 ; } (( PERL LANG_PERL CHECK_PERL_MODULE ExtUtils::Embed ARG_WITH HAVE_PERL perl build with embedded perl extension ; IFNOT HAVE_PM_EXTUTILSEMBED { HAVE_PERL = 0 ; } PYTHON LANG_PYTHON ARG_WITH HAVE_PYTHON python build with embedded python extension ; )) CHKLIB python2.5 CHKLIB python2.6 ARG_WITH MAEMO maemo build hildon interface ; (( HAVE_GUI )) ARG_WITHOUT HAVE_GUI gui radare without the gtk frontend ; (( CHKPRG GTKDIALOG gtkdialog IFEQ GTKDIALOG gtkdialog ; { ECHO You will need gtkdialog for the gui ; } )) PKGCFG GTK_FLAGS GTK_LIBS gtk+-2.0 IFNULL GTK_FLAGS { HAVE_GUI = 0 ; } PKGCFG VTE_FLAGS VTE_LIBS vte IFNULL VTE_FLAGS { HAVE_GUI = 0 ; } HAVE_VALAC = 1 ; HAVE_VALA = 1 ; VALAC = 1 ; IFNOT HAVE_GUI { VALAC = 0 ; HAVE_VALA = 0 ; ECHO Vala build disabled, no gtk-dev or libvte-dev found ; } CHKINC lua.h LANG_LUA REPORT HAVE_GUI WII LUA_LIBS HAVE_LIB_LUA MAEMO VALA JAVA USBSNF SYSPROXY DEBUGGER HAVE_LIB_EWF HAVE_LIB_READLINE ; (( subdirectories )) SUBDIRS . ./global.h ./config.mk src src/rsc/rsc src/rfile ; (( end-of-file )) (( ERR = 0 ; IFNOTEQ SIZEOF_OFF_T 8 ; ERR = 1 ; DIE ERR Radare requires a 64 bit POSIX OS to work properly ; )) radare-1.5.2/configure.hook000077500000000000000000000013451141417717500156360ustar00rootroot00000000000000#!/bin/sh # pancake // radare // nopcode # Does Radare Has Native Debugger support for this platform? ARCHOS="${TARGET_CPU}-${TARGET_OS}" SUPLIST=`cat <&1 | grep arm` TMPDIR=`mktemp /tmp/XXXXXXXX` PRG=${PWD} rm -f ${TMPDIR} mkdir -p ${TMPDIR} || exit 1 cd ${TMPDIR} || exit 1 mkdir -p DEBIAN usr/lib usr/bin usr/libexec/radare/ usr/share/radare/magic 2>&1 > /dev/null if [ -n "${MAEMO}" ]; then ARCH="armel" REPO="pool/mistral/user/" mkdir -p lib fi if [ -z "${VERSION}" ]; then echo "No version?" exit 1 fi # install cp ${PRG}/src/bug usr/bin/bug cp ${PRG}/src/rdb/rdbdiff usr/bin/rdbdiff cp ${PRG}/src/radare usr/bin/radare cp ${PRG}/src/bindiff usr/bin/bindiff cp ${PRG}/src/rabin/rabin usr/bin/rabin cp ${PRG}/src/rasm/rasm usr/bin/rasm cp ${PRG}/rasc/rasc usr/bin/rasc cp ${PRG}/src/arch/arm/aasm/armasm /usr/bin/armasm cp ${PRG}/src/rsc usr/bin/rsc cp ${PRG}/src/rfile usr/bin/rfile cp ${PRG}/src/hasher/hasher usr/bin/hasher cp ${PRG}/src/xc usr/bin/xc cp ${PRG}/src/javasm usr/bin/javasm cp ${PRG}/src/xrefs usr/bin/xrefs #cp ${PRG}/libps2fd/libps2fd.so usr/lib/libps2fd.so #if [ -n "${MAEMO}" ]; then # cp /lib/libreadline.so.4 lib/ # cp /usr/lib/libopcodes-2.16.91.so lib/ # cp /usr/lib/libbfd-2.16.91.so lib/ # cp /usr/bin/objdump usr/bin #fi chmod 0755 usr/bin/* cd ${PRG}/libexec/ FILES=`make files` for a in ${FILES}; do cp ${a} ${TMPDIR}/usr/libexec/radare done cd ${TMPDIR} cp ${PRG}/magic/* usr/share/radare/magic/ print_control() { # control cat > DEBIAN/control << EOF Package: ${PKGNAME} Version: ${VERSION} Architecture: ${ARCH} Maintainer: pancake Filename: ${REPO}/radare_${VERSION}_${ARCH}.deb Size: ${PKGSIZE} Installed-size: ${SIZE} Description: command line hex editor radare is a command line hexadecimal editor with advanced features like hashing, overlap of structures, visual mode, different view modes, scripts.. EOF } SIZE=`du -sb .|column -t |awk '{print $1}'` print_control echo "dpkg-deb -b . ../radare_${VERSION}_${ARCH}.deb" | fakeroot SIZE=`du -sb . | column -t | awk '{ print int($1/1024); }'` #PKGSIZE=`ls -l /tmp/radare_${VERSION}_${ARCH}.deb |column -t | awk '{ print $5; }'` PKGSIZE=`du -b /tmp/radare_${VERSION}_${ARCH}.deb |column -t | awk '{ print $1; }'` print_control echo "--" cat DEBIAN/control echo "--" echo "dpkg-deb -b . ../radare_${VERSION}_${ARCH}.deb 2>/dev/null" | fakeroot cd .. rm -rf ${TMPDIR} echo "Package done: ($PWD)" printf " - " echo $PWD ls radare_* 2>/dev/null exit 0 radare-1.5.2/dist/maemo/000077500000000000000000000000001141417717500150265ustar00rootroot00000000000000radare-1.5.2/dist/maemo/Makefile000066400000000000000000000041431141417717500164700ustar00rootroot00000000000000# Example custom makefile for creating .deb without using dpkg tools. # # Author: Tim Wegener # # This requires deb_hand.mak # Sources: # SOURCE_DIR - directory containing files to be packaged # ICON_SOURCE - 26x26 icon file for maemo # description.txt - description with summary on first line # preinst, postinst, prerm, postrm - optional control shell scripts # These fields are used to build the control file. PACKAGE = radare VERSION = 1.1 ARCH = armel SECTION = user/shell PRIORITY = optional MAINTAINER = pancake # todo: For python2.4 it also needs python2.4-elementtree and python2.4-sqlite DEPENDS = # todo: Recommends PACKAGE_DIR=${PWD} #SOURCE_DIR = . ICON_SOURCE = #ICON_SOURCE =${SOURCE_DIR}/maemo_deb/exaile26.png PRG=../../build/default/ PRG=../../ SPRG=../../ ${PACKAGE_DIR}/data: ${SOURCE_DIR} rm -rf $@ mkdir $@ mkdir -p $@/usr/bin $@/usr/share/doc/radare $@/usr/share/radare/ $@/usr/libexec/gradare $@/usr/share/radare/rsc $@/usr/lib $@/usr/share/radare/magic #radare -cp ${PRG}/src/radiff/radiff $@/usr/bin/radiff #-cp ${PRG}/src/rsc/pool/bindiff $@/usr/bin/bindiff -cp ${PRG}/src/radare $@/usr/bin/radare -cp ${PRG}/src/rabin/rabin $@/usr/bin/rabin -cp ${PRG}/src/rasm/rasm $@/usr/bin/rasm -cp ${PRG}/src/rasc/rasc $@/usr/bin/rasc -cp ${PRG}/src/arch/arm/aasm/armasm $@/usr/bin/armasm -cp ${PRG}/src/rsc/rsc $@/usr/bin/rsc -cp ${PRG}/src/rfile $@/usr/bin/rfile -cp ${PRG}/src/rahash/rahash $@/usr/bin/rahash -cp ${PRG}/src/rax $@/usr/bin/rax -cp ${PRG}/src/xrefs $@/usr/bin/xrefs -cp ${PRG}/src/javasm/javasm $@/usr/bin/javasm -cp ${PRG}/gui/gradare $@/usr/bin/gradare -cp /usr/bin/gtkdialog $@/usr/bin/gtkdialog #-cp /usr/lib/libvte.so.4 $@/usr/lib mkdir -p $@/usr/share/radare/gradare -cp -rf ${SPRG}/gui/grsc/* $@/usr/share/radare/gradare -cp -rf ${SPRG}/src/rsc/pool/* $@/usr/share/radare/rsc -cp -rf ${SPRG}/magic/* $@/usr/share/radare/magic/ -cp -rf ${SPRG}/doc/* $@/usr/share/doc/radare/ -chmod +x $@/usr/bin/* mkdir -p $@/usr/share/applications/hildon/ -cp ${SPRG}/gui/gradare.desktop $@/usr/share/applications/hildon/ include deb_hand.mak radare-1.5.2/dist/maemo/README000066400000000000000000000000301141417717500156770ustar00rootroot00000000000000Just type 'make deb' :) radare-1.5.2/dist/maemo/deb_hand.mak000066400000000000000000000063251141417717500172520ustar00rootroot00000000000000# Create .deb without using dpkg tools. # # Author: Tim Wegener # # Use 'include deb_hand.mak' after defining the user variables in a local # makefile. # # The 'data' rule must be customised in the local make file. # This rule should make a 'data' directory containing the full file # layout of the installed package. # # This makefile will create a debian-binary file a control directory and a # a build directory in the current directory. # Do 'make clobber' to remove these generated files. # # Destination: # PACKAGE_DIR - directory where package (and support files) will be built # defaults to the current directory # # Sources: # SOURCE_DIR - directory containing files to be packaged # ICON_SOURCE - 26x26 icon file for maemo # description.txt - description with summary on first line # preinst, postinst, prerm, postrm - optional control shell scripts # These fields are used to build the control file: # PACKAGE = # VERSION = # ARCH = # SECTION = # PRIORITY = # MAINTAINER = # DEPENDS = # # SOURCE_DIR = # ICON_SOURCE = # (ICON_SOURCE is optional) # *** NO USER CHANGES REQUIRED BEYOND THIS POINT *** PACKAGE_DIR ?= . CONTROL_EXTRAS ?= ${wildcard preinst postinst prerm postrm} ${PACKAGE_DIR}/control: ${PACKAGE_DIR}/data ${CONTROL_EXTRAS} description.txt \ ${ICON_SOURCE} rm -rf $@ mkdir $@ ifneq (${CONTROL_EXTRAS},) cp ${CONTROL_EXTRAS} $@ endif # Make control file. echo "Package: ${PACKAGE}" > $@/control echo "Version: ${VERSION}" >> $@/control echo "Section: ${SECTION}" >> $@/control echo "Priority: ${PRIORITY}" >> $@/control echo "Architecture: ${ARCH}" >> $@/control echo "Depends: ${DEPENDS}" >> $@/control echo "Installed-Size: ${shell du -s ${PACKAGE_DIR}/data|cut -f1}" \ >> $@/control echo "Maintainer: ${MAINTAINER}" >> $@/control echo -n "Description:" >> $@/control cat description.txt | gawk '{print " "$$0;}' >> $@/control #ifneq (${ICON_SOURCE},) # echo "Maemo-Icon-26:" >> $@/control # base64 ${ICON_SOURCE} | gawk '{print " "$$0;}' >> $@/control #endif # Make md5sums. cd ${PACKAGE_DIR}/data && find . -type f -exec md5sum {} \; \ | sed -e 's| \./||' \ > $@/md5sums ${PACKAGE_DIR}/debian-binary: echo "2.0" > $@ ${PACKAGE_DIR}/clean: rm -rf ${PACKAGE_DIR}/data ${PACKAGE_DIR}/control ${PACKAGE_DIR}/build *.deb ${PACKAGE_DIR}/build: ${PACKAGE_DIR}/debian-binary ${PACKAGE_DIR}/control \ ${PACKAGE_DIR}/data rm -rf $@ mkdir $@ cp ${PACKAGE_DIR}/debian-binary $@/ cd ${PACKAGE_DIR}/control && tar czvf $@/control.tar.gz * cd ${PACKAGE_DIR}/data && tar czvf $@/data.tar.gz * # Convert GNU ar to BSD ar that debian requires. # Note: Order of files within ar archive is important! ${PACKAGE_DIR}/${PACKAGE}_${VERSION}_${ARCH}.deb: ${PACKAGE_DIR}/build ar -rc $@ $ $@fail #rm -f $@tmp #mv $@fail $@ .PHONY: data data: ${PACKAGE_DIR}/data .PHONY: control control: ${PACKAGE_DIR}/control .PHONY: build build: ${PACKAGE_DIR}/build .PHONY: clean clean: ${PACKAGE_DIR}/clean .PHONY: deb deb: ${PACKAGE_DIR}/${PACKAGE}_${VERSION}_${ARCH}.deb clobber:: rm -rf ${PACKAGE_DIR}/debian_binary ${PACKAGE_DIR}/control \ ${PACKAGE_DIR}/data ${PACKAGE_DIR}/build radare-1.5.2/dist/maemo/description.txt000066400000000000000000000002761141417717500201170ustar00rootroot00000000000000Advanced command line hexadecimal editor radare is a command line hexadecimal editor with advanced features like hashing, overlap of structures, visual mode, different view modes, scripts.. radare-1.5.2/doc/000077500000000000000000000000001141417717500135325ustar00rootroot00000000000000radare-1.5.2/doc/Makefile000066400000000000000000000005201141417717500151670ustar00rootroot00000000000000all: halibut --pdf=radare.pdf radare.but halibut --text=radare.pdf.txt radare.but > /dev/null 2>&1 halibut --html=radare.pdf.html radare.but mkdir -p html && cd html && halibut --html ../radare.but push: scp radare.pdf radare.pdf.html radare.org:/srv/http/radareorg/get rsync -avz html/* radare.org:/srv/http//radareorg/doc/html radare-1.5.2/doc/csr000066400000000000000000000016311141417717500142450ustar00rootroot00000000000000CSR - xap2 cpu ===----------- Most common bluetooth dongles have a CSR CPU called 'xap2'. They run a specific firmware with data and text sections with a 16 bit instruction pipeline. I have importes the 'Sobos' disassembler inside the radare core and now you can disassembly a bluetooth firmware in this way: 1 - dump firmware from bluetooth dongle $ dfutool -d hci0 archive hci0.fw 2 - unpack firmware (split text and data sections) * currently rabin doesn't supports this this fileformat, but you can fetch the Sobos tools here: ## fetch from cvs $ cvs -d :pserver:anoncvs@darkircop.org:/home/cvs co bt $ cd bt/firm $ make ## extract firmware pieces $ ./firm -e hci0.fw ## this command has generated text.0 and data.0 files 3 - Open radare with csr architecture $ radare -e asm.arch=csr text.0 --pancake Have fun! radare-1.5.2/doc/debug000066400000000000000000000035711141417717500145510ustar00rootroot00000000000000/* THIS DOCUMENTATION IS DEPRECATED */ Debugging with radare and libps2fd ================================== The radare project has implemented a wrapper library for debugging programs or processes using a basic file descriptor interface for reading the memory image and system() for sending commands to it. If you want to interrupt the running process to gain control over the radare shell press ^Z and type 'fg'. You can also throw a SIGTRAP signal to the child process. Example demo: ============= $ rsc radaredbg /bin/ls ## Load on memory symbols of the current running program ## > .!rsc syms-dbg-flag ## Put a breakpoint ## > !help libps2fd debugger commands: run - load and start execution load - load a program in memory cont - continue until contsc - continue until next syscall regs - show registers information step - step one instruction stepall - step all instructions break [offset] - put a breakpoint at offset ## Put a breakpoint ## > flag sym___libc_start_main@plt Flag hooked at 0x0000000008049898 with size 32 named 'sym___libc_start_main@plt'. > !break 0x08049898 > !cont ## Disassemble the sym__init from the process memory ## [0xFFFFFFFF]> seek sym__init [0x08049500]> b 0x16 [0x08049500]> pd 0: 55 push %ebp 1: 89 e5 mov %esp,%ebp 3: 83 ec 08 sub $0x8,%esp 6: e8 59 06 00 00 call 0x664 b: e8 b0 06 00 00 call 0x6c0 10: e8 cb d4 00 00 call 0xd4e0 15: c9 leave 16: c3 ret ## Show registers ## > !regs Registers: eax = 0xffffffff => 0xb7f5340d (-1208667123) ebx = 0xb7f55ff4 ecx = 0xbfa06e94 edx = 0xb7f49290 ebp = 0x00000000 esi = 0x00000001 edi = 0x08049b40 eip = 0x08049899 esp = 0xbfa06e6c radare-1.5.2/doc/disassembly000066400000000000000000000007501141417717500157760ustar00rootroot00000000000000 ======================================= | | | Disassembling with radare and friends | | | ======================================= ** You can disassembly from commandline by typing this: ---- LENGTH=100 OFFSET=0x300 sh scripts/dasm.sh "`echo pX | radare -s ${OFFSET} -b ${LENGTH} -v /bin`" ---- ** There's a shell environment that uses this command for better extasis pwnage. ---- scripts/tracelf.pl ---- radare-1.5.2/doc/elf-tutorial000066400000000000000000000174731141417717500161000ustar00rootroot00000000000000 NOTE: This document can contain some outdated documentation --------------------------------------- radare -- elf tutorial author -- pancake --------------------------------------- _00_ Introduction This tutorial explains how to work with ELF files using radare. I recommend you to use vim to read this document. Use '#' to jump between the index. _001_ The easy way _01_ Get entry point _010_ " using some magic _02_ Seek to entry point and disassemble some bytes _03_ Visual disassembling _04_ Extracting string and offsets _001_ The easy way Open the ELF file with radare and type these commands: $ radare /bin/ls > !!rsc syms-flag /bin/ls > /tmp/ls.syms.flags > . /tmp/ls.syms.flags At this moment you have one flag for each symbol of the ELF file. You can store the radare state into a file using the 'S' command: > S ~/.radare/bin.ls You can 'seek' to a desired flag easily now: > b 0x40 ; blocksize to 0x40 bytes (avoid long disasms) > seek main ; seek to main symbol > pd ; go disassemble _01_ Get entry point We can find the entry point using the scripts/elf-flag-header: $ ./radare /bin/ls open '/bin/ls' File size: 77832 [0x00000000] > . ../scripts/elf-flag-header Interpreting file: '../scripts/elf-flag-header' Flag hooked at 0x00000000 with size 512 named 'here'. Flag hooked at 0x00000000 with size 4 named 'elf.magic'. Flag hooked at 0x00000000 with size 16 named 'elf.ident'. Flag hooked at 0x00000010 with size 2 named 'elf.type'. Flag hooked at 0x00000012 with size 2 named 'elf.machine'. Flag hooked at 0x00000014 with size 4 named 'elf.version'. Flag hooked at 0x00000018 with size 4 named 'elf.entry'. Flag hooked at 0x0000001c with size 4 named 'elf.phoff'. Flag hooked at 0x00000020 with size 4 named 'elf.shoff'. Flag hooked at 0x00000024 with size 4 named 'elf.flags'. [0x00000000] > flag 0x00000000 512 here 7f 45 4c 46 01 01 01 00 00 00 ... 0x00000000 4 elf.magic 7f 45 4c 46 0x00000000 16 elf.ident 7f 45 4c 46 01 01 01 00 00 00 ... 0x00000010 2 elf.type 02 00 0x00000012 2 elf.machine 03 00 0x00000014 4 elf.version 01 00 00 00 0x00000018 4 elf.entry 40 9b 04 08 0x0000001c 4 elf.phoff 34 00 00 00 0x00000020 4 elf.shoff d0 2b 01 00 0x00000024 4 elf.flags 00 00 00 00 [0x00000000] > seek elf.entry [0x00000018] > endian 0 Endian is: little [0x00000018] > vW 08049B40 _010_ Get entry point using magic radare comes with a collection of magic databases to feed 'file' (libmagic). You can use this program to calculate the base address faster. $ file -m magic/elf /bin/ls | sed -e 's,),)\n,g' /bin/ls: (ELF) (machine 'i386) (machine 'machine) (entry 0x8049b40) , for GNU/Linux 2.6.0, dynamically linked (uses shared libs) , for GNU/Linux 2.6.0, stripped The same in the radare shell: [0x00000000] >!file -m magic/elf /bin/ls|sed -e 's,),)\n,g'|grep entry (entry 0x8049b40) _02_ Seek to the entry point and disas We must find the offset of the entry point inside the file (not in memory), so, we must substract the base address to the entry point: 0x8049B40 - 0x8048000 = 0x1B40 = 6976 [0x00000018] > (0x8049B40-0x8048000) 6976 [0x00000018] > !printf "%x" 6976 1b40 [0x00000018] > seek 6976 Current offset = 0x00001B40 (6976) [0x00001B40] > b 512 [0x00001B40] > d /tmp/text Dump file: '/tmp/text' Dumping block 0x00001B40 Block size = 512 (0x200) Limit/length = 512 *OK file dumped. [0x00001B40] > !cat /tmp/text | sh ../scripts/dasm.sh - | head -n 10 0: 31 ed xor %ebp,%ebp 2: 5e pop %esi 3: 89 e1 mov %esp,%ecx 5: 83 e4 f0 and $0xfffffff0,%esp 8: 50 push %eax 9: 54 push %esp a: 52 push %edx b: 68 30 69 05 08 push $0x8056930 10: 68 40 69 05 08 push $0x8056940 15: 51 push %ecx _03_ Visual disassembling BTW we can use the visual mode for all these stuff. So, you can press the 'd' key to disassemble the current block, and simulate jumps. Going into visual mode... [0x00001B40] > Visual (.. inside visual mode ..) d ; disassemble current block :+ 0x12 ; change %eip d ; dump again _04_ Extracting strings and offsets To get the strings and respective offsets just type: $ radare -S 5 /bin/ls 0x00000134 A /lib/ld-linux.so.2 0x00000b79 U librt.so.1clock_gettime_Jv_RegisterClasses__gmon_start__libacl.so 1acl_entriesacl_get_fileacl_set_fileacl_delete_def_file_init_finiacl_from_texa cl_freeacl_extended_filelibselinux.so.1lgetfileconfreeconlibc.so.6strcpyioctlt doutreaddir64__strtoull_internalsigemptysetmemmovegetopt_long__fpendinggetgrgd getenviswcntrlqsortmemcpyreadlink__overflowmbrtowcmallocisattyoptarg_obstack_e wchunk__strtoul_internalmempcpysigaddsetlocaleconvabort__stack_chk_failchmodiw printstrrchr__ctype_tolower_loc_obstack_begincalloc__ctype_get_mb_cur_maxfput_ unlockeddcgettextoptindfnmatchmktimesignaldirfdstrcollstrncmpstrncpywcwidthrel locsigaction__xstat64gettimeofdaylocaltimememsetopendir__assert_failstrcmpgetw uidgetpwnamsprintffclosesetlocalestderrerrorsigismember__lxstat64__ctype_b_lof flush_unlockedstrftimefwrite_unlockedtcgetpgrp__errno_locationbindtextdomaingt grnam_setjmp__ctype_toupper_loc_IO_stdin_usedstrverscmp__libc_start_mainstrles trchrclosedir__fxstat64vfprintfraisesigprocmaskmbsinit__cxa_atexit_edata__bsss tart_endGLIBC_2.2ACL_1.0GLIBC_2.4GLIBC_2.2.3GLIBC_2.1.3GLIBC_2.3GLIBC_2.1GLIB_ 2.0 0x00001b48 A PTRh0i (...) 0x0000ea48 A Try `%s --help' for more information. 0x0000ea70 A Usage: %s [OPTION]... [FILE]... 0x0000ea94 A List information about the FILEs (the current directory by defaul 0x0000ead9 A Sort entries alphabetically if none of -cftuSUX nor --sort. 0x0000eb18 A Mandatory arguments to long options are mandatory for short optio 0x0000eb64 A -a, --all do not ignore entries starting with 0x0000eba7 A -A, --almost-all do not list implied . and .. 0x0000ebe1 A --author with -l, print the author of each fi 0x0000ec25 A -b, --escape print octal escapes for nongraphic c (..) 0x000103ed A SIZE may be (or may be an integer optionally followed by) one of 0x00010439 A kB 1000, K 1024, MB 1000*1000, M 1024*1024, and so on for G, T, P 0x00010489 A By default, color is not used to distinguish types of files. The 0x000104cf A equivalent to using --color=none. Using the --color option witho 0x00010517 A optional WHEN argument is equivalent to using --color=always. Wi 0x0001055b A --color=auto, color codes are output only if standard output is c 0x000105a5 A to a terminal (tty). The environment variable LS_COLORS can infl 0x000105f0 A colors, and can be set easily by the dircolors command. 0x0001062d A Exit status is 0 if OK, 1 if minor problems, 2 if serious trouble 0x00010674 A sizeof (struct dev_ino) <= __extension__ ({ struct obstack const 0x00010704 U cannot determine device and inode of %s%s: not listing already-li 0x00010758 A ignoring invalid value of environment variable QUOTING_STYLE: %s 0x0001079c A ignoring invalid width in environment variable COLUMNS: %s 0x000107d8 A ignoring invalid tab size in environment variable TABSIZE: %s 0x00010818 A the --kilobytes option is deprecated; use -k instead 0x00010850 U abcdfghiklmnopqrstuvw:xABCDFGHI:LNQRST:UX1Zunparsable value for 0x000108d8 A hash_get_n_entries (active_dir_set) == 0 0x00010904 U dereference-command-line-symlink-to-dir 0x0001092d A Report bugs to <%s>. (...) radare-1.5.2/doc/flags000066400000000000000000000021041141417717500145460ustar00rootroot00000000000000Flags tutorial ============== Flags are used for bookmarking data with radare. Each bookmark store this information: - name - data - size - offset - print format So, the possible actions are: > seek 0x100 > flag my_first_flag flag 'my_first_flag' at 0x0000000000000100 and size 512 This is your first flag! :D You can list all your flags using the 'flag' command without any argument. > flag 000 0x0000000000000100 512 my_first_flag x 78 94 05 08 2c 00 00 00 00.. As you can see, it stores the print format and shows you the contents of the block. It's useful to know how to use the '*' argument, that allows you to print all flags in radare script format. > flag * s 0x100 b 0x200 f my_first_flag You can redirect this output to a file for storing some flags, edit them, remove all current flags and import them: > flag * > /tmp/flags > !vim /tmp/flags > flag -* > . /tmp/flags I've used the '-' prefix for ordening flag to remove a flag named '*', this is an alias for all defined flags. But you can type the flag name instead: > flag -my_first_flag radare-1.5.2/doc/fortunes000066400000000000000000000202121141417717500153170ustar00rootroot00000000000000Do you want to perform more than one search at a time? '> /k0 keyword1', '> /k1 keyword2' and '> /r 0-1' Debugger commands are prefixed with '!' because they are accessed via the io plugin system() hook Isn't your disassembly pretty enought? Try changing values with 'eval asm.' Did you setup your ~/.radarerc today? You can mark an offset in visual mode with the cursor and the ',' key. Later press '.' to go back You can debug a program from the graph view (ag command) using standard radare commands Before entering a 'call' you can identify the arguments passed to it using the 'pm xxi' command Use the '[' and ']' keys in visual mode to adjust the screen width (scr.width) Choose your architecture by typing: 'eval asm.arch=ppc' (or arm, java, m68k, intel, intel16 or intel64) Move between your search hits in visual mode using the 'f' and 'F' keys Run python scripts with the python hack plugin. ('H python ' command) Run LUA scripts with the lua hack plugin. ('H lua ' command) Save your projects with 'Ps ' and restore then with 'Po ' Everytime you run radare. It removes a random file :) RADARE CUMS WITH ABSOLUTELY NO WARRANTY Enable asm.trace to see the tracing information inside the disassembly Change the registers of the child process in this way: '!set eax 0x333' Deltify your life with radare Manipulate the filedescriptors of the child with '!fd' Trace until system calls with !contsc Remotely open files or debug processes with radare listen://:9999/dbg:///bin/ls Check your IO plugins with radare -L Find cross-reference in raw binaries using external 'xrefs' tool. Change the size of the file with the 'r' (resize) command Calculate checksums for the current block with the commands starting with '#' (#md5, #crc32, #all, ..) Use +,-,*,/ to change the size of the block Change the block size with 'b ' In visual mode you can also enter radare command pressing the ':' key (like vi does) If you want to open the file in read-write mode use -w flag or -e cfg.write=true Print the contents of the current block with the 'p' command Command layout is: @.\ For example: 3x20@0x33 will show 3 hexdumps of 20 bytes at 0x33 Press 'c' in visual mode to toggle the cursor mode You can "copy/paste" bytes using the cursor in visual mode 'c' and using the 'y' and 'Y' keys Move around the bytes with hjkl! Arrow keys are not portable and are less productive to use Seek at relative offsets with 'seek +' or 'seek -' Invert the block bytes using the 'I' key in visual mode Switch between print modes using the 'p' and 'P' keys in visual mode In soviet russia radare debugs you! Add comments using the ';' key in visual mode or the 'C' command from the radare shell Assemble opcodes with the 'a' and 'A' keys in visual mode which are hooks for the wa and wA commands Find expanded AES keys in memory with /a command Find wide-char strings with /w command Enable ascii-art jump lines in disassembly with asm.lines. asm.linesout and asm.linestyle may interest you too Control the signal handlers of the child process with the '!signal' command Get a free shell with 'rasc -i x86.linux.binsh -X' Interpret your own radare scripts with '. '. Similar to the bash source alias command. Most of commands accept an '?' as suffix. Use it to understand how they work :) Find hexpairs with '/x a0 cc 33' Walk inside your seek history with the 'u' command (undo), and 'U' for redo Use hasher to calculate hashes of portion blocks of a file Use zoom.byte=entropy and press 'z' in visual mode to zoom out to see the entropy of the whole file Use zoom.byte=printable in zoom mode (z key in visual mode) to find strings Set colors to your screen with 'eval scr.color=true' Press 'C' in visual mode to toggle colors Trace the register changes when debugging with trace.cmtregs Move the comments to the right changing their margin with eval asm.cmtmargin Execute a command on the visual prompt with cmd.vprompt Reduce the delta where flag resolving by address is used with cfg.delta Disable these messages with eval cfg.fortunes=false in your ~/.radarerc Show offsets in graphs with 'eval graph.offset = true' Follow a flag in disassembly view (avoids to disasemble out of the visibility of the flag) with asm.follow Execute a command every time a breakpoint is hitted with 'eval cmd.bp = !my-program' Disassemble in intel syntax with eval asm.syntax = intel Change the UID of the debugged process with child.uid (requires root) Enable full backtrace with dbg.fullbt Manually modify the DRX registers of the child process with '!dr' command What do you want to debug today? Sniff your favorite libusb-based application with LD_PRELOAD=/usr/lib/libusbsniff.so ./your-program Use '!rsc spcc' to parse structures in memory using C programs Find cp850 strings with 'eval cfg.encoding=cp850' and '/s' Enhace your graphs by increasing the size of the block and graph.depth eval variable Control the height of the terminal on serial consoles with eval scr.height Use eval file.id=true and eval file.flag=true in your ~/.radarerc to get symbols, strings, .. when loading Disassemble unsupported architectures with external objdump defined in eval asm.objdump. Use 'pd' command. Emulate the base address of a file with eval file.baddr Dump the class header information with 'javasm -c '. Handled by radare if file.id=true Use gradare if you prefer simple frontend for gui users Feedback, bug reports, patches, ideas are welcome to the mailing list at radare.nopcode.org Bindiff two files with '$ bdiff /bin/true /bin/false' Execute commands on a temporally offset appending '@ offset' to your command Temporally drop the verbosity prefixing the commands with ':' Change the graph block definition with graph.callblocks, graph.jmpblocks, graph.flagblocks Filter the output of radare in realtime with a tab separated file pointed by scr.filter containing key\tvalue Use the '<' and '>' keys in visual cursor mode (V->c) to folder selected bytes Use scr.accel to browse the file faster! I love the smell of bugs in the morning. Use the 'pR' command to see the source line related to the current seek Analyze socket connections with the socket plugin: $ radare socket://www.foo.com:80. Use 'w' to send data I like to suck nibbles and make hex I'm in your source securing your bits radare contributes to the One Byte Per Child fundation setup dbg.fpregs to true to visualize the fpu registers in the debugger view To debug a program you can do dbg://${path-to-program} or use -d ${path..} 3nl4r9e y0\/r r4d4r3 LUA is the default scripting language for radare. Read radare.lua fmi There's a discussion forum in http://radare.nopcode.org/forum/ I did it for the pwnz If you send the program you are debugging to 15 friends before 143 minutes and then step three times on the same opcode you will get the name of the person who loves you To remove this message, put `dbxenv suppress_startup_message 7.5' in your .dbxrc Heisenbug: A bug that disappears or alters its behavior when one attempts to probe or isolate it. radare is for lulzhats Use 'e' and 't' in Visual mode to edit configuration and track flags Use rabin -rios to get the import/export/other symbols of any binary Remember to maintain your ~/.radare_history Microloft Visual Radare.NET 2008. Now OOXML Powered! Enjoy the 'two girls one backup' viral video Captain! enemies are all around!, Perfect! This way we can attack in any direction! In my book, you are my hero. A C program is like a fast dance on a newly waxed dance floor by people carrying razors - Waldi Ravens radare2 is like windows 7 but even better Enable 'asm.xrefs' and 'asm.xrefsto' to view the two endpoints for every xref The miraculous on-line hard disk repairing software Check cmd.vprompt2 to disable the list of variables on top of the disassembly (CFV command) i love the #radare zombies Use .af*@addr to analyze a function and save metadata info Use {}()[] keys in Visual mode to adapt the console boundaries The '~' char is the internal grep. Use it to filter command results (pd~call) '(' command registers macros, here's a hello world: (h,?e Hello World,)&&.(h) If the command starts with numbers, following command will be executed N times (f.ex: 3!step) radare-1.5.2/doc/gdb.scripts000066400000000000000000000035151141417717500157030ustar00rootroot00000000000000#--------------------------------------------- # # Collection of GDB scripts # #--------------------------------------------- # # dreyer '08 - GDB functions # def next_call set pagination off stepi while( ((char)(*(char *)$eip)!=(char)0xe8)) stepi end x/5i $eip set pagination on end def next_call_verbose display/i $eip set pagination off stepi while( ((char)(*(char *)$eip)!=(char)0xe8)) stepi end x/5i $eip set pagination on end def gob set pagination off set $base=0x08040000 set $mask=0xffff0000 while (((long)$eip & $mask) != $base ) stepi end set pagination on end #--------------------------------------------- #sha0 step until next base addr def gob set $base = 0x08040000 set $mask = 0xffff0000 while (((long)$eip & $mask) != $base ) stepi end print $base disas $pc $pc+30 end #sha0 binary search def seek set $addr = $arg0 set $initaddr = $addr set $str = $arg1 set $range = 0xffff #Length calculation set $p = (char *)$str set $len = 0 while (*$p++) set $len++ end while ($addr < $initaddr+$range) set $p = (char *)$str set $baddr = $addr set $check = 0 while (*$p) if (*$p == (char)(*(char *)$baddr)) set $check++ end set $p++ set $baddr++ end if ($check == $len) print "found:" print /x $addr set $addr = $initaddr+$range end set $addr++ end end radare-1.5.2/doc/map-struct000066400000000000000000000047641141417717500155670ustar00rootroot00000000000000mapping data structures on binary data ====================================== Sometimes you need to interpret a data structure found on a piece of a binary file. Radare make use of libmagic to achieve this. In visual mode you can press the 'm' key to interpret the current data block by the 'rfile' wrapper. How to write a magic database file for mapping binary structures? NOTE: Read the file(1) manpage fmi. The magic file syntax is not very readable and probably ugly to write, so, radare provides a user-defined way to create C and perl descriptors for data blocks. This is explained later in this paper. Magic files follow this basic structure: 0 type match output >offset type match output >>offset type match output >>offset type match output (...) The '>' tree is only followed if the previous '>' level matches. So you can provide on a single file a multiple switch/case hirearchy for multiple filetypes or data structures. This format does not support include-like directives, so you must provide define all the magic files using the -m flag. Structure parser language wrappers ================================== radare implements some language wrappers to create parsers for binary structures using C or perl. You can create an 'spc' file (structure parser in C language) to create a data block parser to be called from radare using the pU mode (user-defined print command). This command is defined by the user with the %PRINTCMD environment variable. Here's a little example: ------------------------ $ cat test.spc struct foo { int id; void *next; void *prev; }; void parse(struct spcc *spcc, uchar *buffer) { struct foo tmp; memcpy(&tmp, buffer, sizeof(struct foo)); printf("id: %d\nnext: %p\nprev: %p\n", tmp.id, tmp.next, tmp.prev); } ---- This is our structure parser. A simple double-linked list of integers viewer. $ rsc spcc spcc - structure parser c compiler Usage: spcc [file.spc] ([gcc-flags]) $ rsc spcc test.spc -o test $ ./test Usage: ./test [file] [offset] ---- Now we can use this structure parser as a user defined print command: $ export PRINTCMD=$PWD/test $ radare /tmp/target-file > s 0x400 > pU id: 678326121 next: 0x72616863 prev: 0x74732a20 Playing with the visual mode ============================ We can use the user-defined print command inside the visual mode and walk between the flags interpreting each data block with our own parser. Use the 'f' and 'F' key to move around the flags in visual mode and change the print format using the 'p' key. radare-1.5.2/doc/radare.but000066400000000000000000011040021141417717500155020ustar00rootroot00000000000000\cfg{paper-code-font-size}{9} \cfg{paper-left-margin}{64} \cfg{paper-code-fonts}{Courier}{Courier}{Courier} \cfg{text-chapter-align}{right} \cfg{html-index-filename}{index.html} \cfg{html-contents-filename}{contents.html} \cfg{html-template-filename}{%n.html} \cfg{html-template-fragment}{%k} \cfg{html-leaf-level}{infinite} \cfg{html-leaf-contains-contents}{false} \cfg{html-suppress-navlinks}{true} \cfg{html-suppress-address}{true} \title radare A commandline framework for reverse engineering ala *nix-style \versionid $Id: radare.but 2009-04-25 pancake $ \C{introduction} Introduction This book aims to cover most usage aspects of radare. A framework for reverse engineering and analyzing binaries. --pancake \H{history} History The radare project started in February of 2006 aiming to provide a Free and simple command line interface for an hexadecimal editor supporting 64 bit offsets to make searches and recovering data from hard-disks. Since then, the project has grown with the aim changed to provide a complete framework for analyzing binaries with some basic *NIX concepts in mind like 'everything is a file', 'small programs that interact together using stdin/out' or 'keep it simple'. It's mostly a single-person project, but some contributions (in source, patches, ideas or species) have been made and are really appreciated. The project is composed by an hexadecimal editor as the central point of the project with assembler/disassembler, code analysis, scripting features, analysis and graphs of code and data, easy unix integration, .. \H{overview} Overview Nowadays the project is composed by a set of small utilities that can be used together or independently from the command line: \c radare The core of the hexadecimal editor and debugger. Allows to open any kind of file from different IO access like disk, network, kernel plugins, remote devices, debugged processes, ... and handle any of them as if they were a simple plain file. Implements an advanced command line interface for moving around the file, analyzing data, disassembling, binary patching, data comparision, searching, replacing, scripting with ruby, python, lua and perl, ... \c rabin Extracts information from executable binaries like ELF, PE, Java CLASS, MACH-O. It's used from the core to get exported symbols, imports, file information, xrefs, library dependencies, sections, ... \c rasm Commandline assembler and disassembler for multiple architectures (intel[32,64], mips, arm, powerpc, java, msil, ...) \c $ rasm -a java 'nop' \c 00 \c $ rasm -a x86 -d '90' \c nop \c rasc Small utility to prepare buffers or shellcodes for exploiting vulnerabilities. It has an internal hardcoded database of shellcodes and a syscall-proxy interface with some nice helpers like fill-with nops, breakpoints, series of values to find the landing point, etc.. \c rahash Implementation of a block-based rahash for small text strings or large disks, supporting multiple algorithms like md4, md5, crc16, crc32, sha1, sha256, sha384, sha512, par, xor, xorpair, mod255, hamdist or entropy. It can be used to check the integrity or track changes between big files, memory dumps or disks. \c radiff Binary diffing utility with multiple algorithms implemented inside. Supports byte-level or delta diffing for binary files and code-analysis diffing to find changes in basic code blocks from radare code analysis or IDA ones using the idc2rdb rsc script. \c rsc Entrypoint for calling multiple small scripts and utilities that can be used from the shell. \H{get} Getting radare You can get radare from the website http://radare.nopcode.org/ There are binary packages for multiple operating systems and GNU/Linux distributions (ubuntu, maemo, gentoo, windows, iphone, etc..) But I hardly encourage you to get the sources and compile them yourself to better understand the dependencies and have the source code and examples more accessible. I try to publish a new stable release every month and sometimes publish nightly tarballs. But as always the best way to use a software is to go upstream and pull the development repository which in radare is commonly more stable than the 'stable' releases O:) To do this you will need mercurial (a distributed python-based source code management aliased Hg) and type: \c $ hg clone http://radare.nopcode.org/hg/radare This will probably take a while, so take a coffee and continue reading this paper. To update your local copy of the repository you will have to type these two commands in the root of the recently created 'radare' directory. \c $ hg pull \c $ hg update If you have local modifications of the source, you can revert them with: \c $ hg revert --all Or just feed me with a patch \c $ hg diff > radare-foo.patch \H{compile} Compilation and portability Currently the core of radare can be compiled in many systems, and architectures, but the main development is done on GNU/Linux and GCC. But it is known to compile with TCC and SunStudio. People usually wants to use radare as a debugger for reverse engineering, and this is a bit more restrictive portability issue, so if the debugger is not ported to your favorite platform, please, notify it to me or just disable the debugger layer with --without-debugger in the ./configure stage. Nowadays the debugger layer can be used on Windows, GNU/Linux (intel32, intel64, mips, arm), FreeBSD, NetBSD, OpenBSD (intel32, intel64) and there are plans for Solaris and OSX. And there are some IO plugins to use gdb, gdbremote or wine as backends. The current build system is 'waf': \c $ ./waf distclean \c $ ./waf configure \c $ ./waf \c $ sudo ./waf install \c ... The old build system based on ACR/GMAKE stills maintained and usable, but don't relay on it because it is aimed to be removed to only use waf. \c $ ./configure --prefix=/usr \c $ gmake \c $ sudo gmake install \H{compile-w32} Windows compilation The easy way to compile things for windows is using mingw32. The w32 builds distributed in the radare homepage are generated from a GNU/Linux box using mingw32 and they are tested with wine. To compile type: \c $ CC=i486-mingw32-gcc ./configure --enable-w32 --without-gui \c $ make \c $ make w32dist \c $ zip -r w32-build.zip w32-build The 'i486-mingw32-gcc' compiler is the one I have in my box, you will probably need to change this. Mingw32 will generate a native console application for windows. Another possible way to compile radare on w32 is using cygwin, which I dont really recommend at all because of the problems related to the cygwin librarires makes the program quite hard to be debugged in case of problems. \H{cmdflags} Commandline flags The core accepts multiple flags from the command line to change some configuration or start with different options. Here's the help message: \c $ radare -h \c radare [options] [file] \c -s [offset] seek to the desired offset (cfg.seek) \c -b [blocksize] change the block size (512) (cfg.bsize) \c -i [script] interpret radare or ruby/python/perl/lua script \c -p [project] load metadata from project file \c -l [plugin.so] link against a plugin (.so or .dll) \c -e [key=val] evaluates a configuration string \c -d [program|pid] debug a program. same as --args in gdb \c -f set block size to fit file size \c -L list all available plugins \c -w open file in read-write mode \c -x dump block in hexa and exit \c -n do not load ~/.radarerc and ./radarerc \c -v same as -e cfg.verbose=false \c -V show version information \c -u unknown size (no seek limits) \c -h this help message \H{usage} Basic usage Lot of people ping me some times for a sample usage session of radare to help to understand how the shell works and how to perform the most common tasks like disassembling, seeking, binary patching or debugging. I hardly encourage you to read the rest of this book to help you understand better how everything works and enhace your skills, the learning curve of radare is usually a bit harder at the beggining, but after an hour of using it you will easily understand how most of the things work and how to get them cooperate together :) For walking thru the binary file you will use three different kind of basic actions: seek, print and alterate. To 'seek' there's an specific command abreviated as 's' than accepts an expression as argument that can be something like '10', '+0x25' or '[0x100+ptr_table]'. If you are working with block-based files you may prefer to set up the block size to 4K or the size required with the command 'b' and move forward or backward at seeks aligned to the block size using the '>' and '<' commands. The 'print' command aliased as 'p', accepts a second letter to specify the print mode selected. The most common ones are 'px' for printing in hexadecimal, 'pd' for disassembling. To 'write' open the file with 'radare -w'. This should be specified while opening the file, or just type 'eval file.write=true' in runtime to reopen the file in read-write-mode. You can use the 'w' command to write strings or 'wx' for hexpair strings: \c > w hello world ; string \c > wx 90 90 90 90 ; hexpairs \c > wa jmp 0x8048140 ; assemble \c > wf inline.bin ; write contents of file Appending a '?' to the command you will get the help message of it. (p? for example) Enter the visual mode pressing 'V', and return to the prompt using the 'q' key. In the visual mode you should use hjkl keys which are the default ones for scrolling (like left,down,up,right). So entering in cursor mode ('c') you will be able select bytes if using the shift together with HJKL. In the visual mode you can insert (alterate bytes) pressing 'i' and then to switch between the hex or string column. Pressing 'q' in hex panel to return into the visual mode. \H{cmds} Command format The format of the commands looks something like that: \c [#][!][cmd] [arg] [@ offset:size|@@ flags|@@=off:sz ..] [> file] [| shell-pipe] [~grep#[]] [ && ...] 'N' must be a numeric value. Commands are named with single chars [a-zA-Z]. So, if we prefix the command with a number. The following command will be executed as many times as we specify. \c px # run px \c 3px # run 3 times 'px' The '!' prefix is used to scape to the shell. If a single exclamation is used then commands will be send to the system() hook defined in the loaded IO plugin. This is used, for example in the ptrace IO plugin which accepts debugger commands from this interface. To run commands to the shell we should type two '!!' exclamations before the command. Some examples: \c !step ; call debugger 'step' command \c px 200 @ esp ; show 200 hex bytes at esp \c pc > file.c ; dump buffer as a C byte array to file \c wx 90 @@ sym.* ; write a nop on every symbol \c pd 2000 | grep eax ; grep opcodes using 'eax' register \c x 20 && s +3 && x 40 ; multiple commands in a single line The '@' character is used to specify a temporary offset where the command at the left will be executed. By using a ':' we can specify a temporaly block size too. The '~' character enables the internal grep which can be used to filter the output of any command. The usage is quite simple: \c pd 20~call ; disassemble 20 instructions and grep for 'call' We can either grep for columns or rows: \c pd 20~call#0 ; get first row \c pd 20~call#1 ; get second row Or even combine them: \c pd 20~call[0]#0 ; grep first column of the first row matching 'call' The use of internal grep is a key feature for scripting radare, because is used to iterate over list of offsets or data processed from disassembly, ranges, or any other command. Here's an example of usage. See macros section (iterators) for more information. TODO : add example \H{expr} Expressions The expressions are mathematical representations of a 64 bit numeric value which can be displayed in different formats, compared or used at any command as a numeric argument. They support multiple basic arithmetic operations and some binary and boolean ones. The command used to evaluate these math expressions is the '?'. Here there are some examples: \c [0xB7F9D810]> ? 0x8048000 \c 0x8048000 ; 134512640d ; 1001100000o ; 0000 0000 \c [0xB7F9D810]> ? 0x8048000+34 \c 0x8048022 ; 134512674d ; 1001100042o ; 0010 0010 \c [0xB7F9D810]> ? 0x8048000+0x34 \c 0x8048034 ; 134512692d ; 1001100064o ; 0011 0100 \c [0xB7F9D810]> ? 1+2+3-4*3 \c 0x6 ; 6d ; 6o ; 0000 0110 \c [0xB7F9D810]> ? [0x8048000] \c 0x464C457F ; 1179403647d ; 10623042577o ; 0111 1111 The supported arithmetic expressions supported are: \c + : addition \c - : substraction \c * : multiply \c / : division \c % : modulus \c > : shift right \c < : shift left The binary expressions should be scapped: \c \| : logical OR \c \& : logical AND The values can be numbers in many formats: \c 0x033 : hexadecimal \c 3334 : decimal \c sym.fo : resolve flag offset \c 10K : KBytes 10*1024 \c 10M : MBytes 10*1024*1024 There are other special syntaxes for the expressions. Here's for example some of them: \c $$ ; current seek \c $$$ ; size of opcode at current seek \c $${file.size} ; file.size (taken from eval variable) \c $$j ; jump address (branch of instruction) \c $$f ; false address (continuation after branch) \c $$r ; data reference from opcode For example: \c [0x4A13B8C0]> :pd 2 \c 0x4A13B8C0, mov eax, esp \c 0x4A13B8C2 call 0x4a13c000 \c \c [0x4A13B8C0]> :? $$+$$$ \c 0x4a13b8c2 \c \c [0x4A13B8C0]> :pd 1 @ +$$$ \c 0x4A13B8C2 call 0x4a13c000 \H{expr-rax} Rax The 'rax' utility comes with the radare framework and aims to be a minimalistic expression evaluator for the shell useful for making base conversions easily between floating point values, hexadecimal representations, hexpair strings to ascii, octal to integer. It supports endianness and can be used as a shell if no arguments given. \c $ rax -h \c Usage: rax [-] | [-s] [-e] [int|0x|Fx|.f|.o] [...] \c int -> hex ; rax 10 \c hex -> int ; rax 0xa \c -int -> hex ; rax -77 \c -hex -> int ; rax 0xffffffb3 \c float -> hex ; rax 3.33f \c hex -> float ; rax Fx40551ed8 \c oct -> hex ; rax 035 \c hex -> oct ; rax Ox12 (O is a letter) \c bin -> hex ; rax 1100011b \c hex -> bin ; rax Bx63 \c -e swap endianness ; rax -e 0x33 \c -s swap hex to bin ; rax -s 43 4a 50 \c - read data from stdin until eof Some examples: \c $ rax 0x345 \c 837 \c $ rax 837 \c 0x345 \c $ rax 44.44f \c Fx8fc23142 \c $ rax 0xfffffffd \c -3 \c $ rax -3 \c 0xfffffffd \c $ rax -s "41 42 43 44" \c ABCD \H{usage-dbg} Basic debugger session To start debugging a program use the '-d' flag and append the PID or the program path with arguments. \c $ radare -d /bin/ls The debugger will fork and load the 'ls' program in memory stopping the execution in the 'ld.so', so don't expect to see the entrypoint or the mapped libraries at this point. To change this you can define a new 'break entry point' adding 'e dbg.bep=entry' or 'dbg.bep=main' to your .radarerc. But take care on this, because some malware or programs can execute code before the main. Now the debugger prompt should appear and if you press 'enter' ( null command ) the basic view of the process will be displayed with the stack dump, general purpose registers and disassembly from current program counter (eip on intel). All the debugger commands are handled by a plugin, so the 'system()' interface is hooked by it and you will have to supply them prefixing it with a '!' character. Here's a list of the most common commands for the debugger: \c > !help ; get the help \c > !step 3 ; step 3 times \c > !bp 0x8048920 ; setup a breakpoint \c > !bp -0x8048920 ; remove a breakpoint \c > !cont ; continue process execution \c > !contsc ; continue until syscall \c > !fd ; manipulate file descriptors \c > !maps ; show process maps \c > !mp ; change page protection permissions \c > !reg eax=33 ; change a register The easiest way to use the debugger is from the Visual mode, so, you will no need to remember much commands or keep states in your mind. \c [0xB7F0C8C0]> Visual After entering this command an hexdump of the current eip will be showed. Now press 'p' one time to get into the debugger view. You can press 'p' and 'P' to rotate thru the most commonly used print modes. Use F6 or 's' to step into and F7 or 'S' to step over. With the 'c' key you will toggle the cursor mode and being able to select range of bytes to nop them or set breakpoints using the 'F2' key. In the visual mode you can enter commands with ':' to dump buffer contents like \c x @ esi To get the help in the visual mode press '?' and for the help of the debugger press '!'. At this point the most common commands are !reg that can be used to get or set values for the general purpose registers. You can also manipulate the hardware and extended/floating registers. \C{config} Configuration The core reads ~/.radarerc while starting, so you can setup there some 'eval' commands to set it up in your favorite way. To avoid parsing this file, use '-n' and to get a cleaner output for using radare in batch mode maybe is better to just drop the verbosity with '-v'. All the configuration of radare is done with the 'eval' command which allows the user to change some variables from an internal hashtable containing string pairs. The most common configuration looks like this: \c $ cat ~/.radarerc \c eval scr.color = true \c eval dbg.bep = entry \c eval file.id = true \c eval file.flag = true \c eval file.analyze = true These configurations can be also defined using the '-e' flag of radare while loading it, so you can setup different initial configurations from the commandline without having to change to rc file. \c $ radare -n -e scr.color=true -e asm.syntax=intel -d /bin/ls All the configuration is stored in a hash table grouped by different root names ([i]cfg., file., dbg., ..[/i]) To get a list of the configuration variables just type 'eval' or 'e' in the prompt. All the basic commands can be reduced to a single char. You can also list the configuration variables of a single eval configruation group ending the command argument with a dot '.'. There are two enhaced interfaces to help users to interactively configure this hashtable. One is called 'emenu' and provides a shell for walking through the tree and change variables. To get a help about this command you can type 'e?': \c [0x4A13B8C0]> e? \c Usage: e[m] key=value \c > ereset ; reset configuration \c > emenu ; opens menu for eval \c > e scr.color = true ; sets color for terminal Note the 'e' of emenu, which stands for 'eval'. In radare, all basic commands can be reduced to a single char, and you can just type 'e?' to get the help of all the 'subcommands' for the basic command. \c [0xB7EF38C0]> emenu \c Menu: (q to quit) \c - asm \c - cfg \c - child \c - cmd \c - dbg \c - dir \c - file \c - graph \c - scr \c - search \c - trace \c - zoom \c > There is a easier eval interface accessible from the Visual mode, just typing 'e' after entering this mode (type 'Visual' command before). Most of the eval tree is quite stable, so don't expect hard changes on this area. I encourage you to experiment a bit on this to fit the interface to your needs. \H{common-conf-scr} Colors The console access is wrapped by an API that permits to show the output of any command as ANSI, w32 console or HTML (more to come ncurses, pango, ...) this allows the core to be flexible enought to run on limited environments like kernels or embedded devices allowing us to get the feedback from the application in our favourite format. To start, we'll enable the colors by default in our rc file: \c $ echo 'e scr.color=true' >> ~/.radarerc There's a tree of eval variables in scr.pal. to define the color palette for every attribute printed in console: \c [0x465D8810]> e scr.pal. \c scr.pal.prompt = yellow \c scr.pal.default = white \c scr.pal.changed = green \c scr.pal.jumps = green \c scr.pal.calls = green \c scr.pal.push = green \c scr.pal.trap = red \c scr.pal.cmp = yellow \c scr.pal.ret = red \c scr.pal.nop = gray \c scr.pal.metadata = gray \c scr.pal.header = green \c scr.pal.printable = bwhite \c scr.pal.lines0 = white \c scr.pal.lines1 = yellow \c scr.pal.lines2 = bwhite \c scr.pal.address = green \c scr.pal.ff = red \c scr.pal.00 = white \c scr.pal.7f = magenta If you think these default colors are not correct for any reason. Ping me and i'll change it. \H{common-conf} Common configuration variables Here's a list of the most common eval configuration variables, you can get the complete list using the 'e' command without arguments or just use 'e cfg.' (ending with dot, to list all the configuration variables of the cfg. space). \c asm.arch Defines the architecture to be used while disassembling (pd, pD commands) and analyzing code ('a' command). Currently it handles 'intel32', 'intel64', 'mips', 'arm16', 'arm' 'java', 'csr', 'sparc', 'ppc', 'msil' and 'm68k'. It is quite simple to add new architectures for disassembling and analyzing code, so there is an interface adapted for the GNU disassembler and others for udis86 or handmade ones. Setting asm.arch to 'objdump' the disassembly engine will use asm.objdump to disasemble the current block. For the code analysis the core will use the previous architecture defined in asm.arch. \c [0x4A13B8C0]> e asm.objdump \c objdump -m i386 --target=binary -D \c [0x4A13B8C0]> e asm.arch \c intel \c [0x4A13B8C0]> pd 2 \c | 0x4A13B8C0, eip: 89e0 mov eax, esp \c | 0x4A13B8C2 e839070000 call 0x4a13c000 ; 1 = 0x4a13c000 \c [0x4A13B8C0]> e asm.arch =objdump \c [0x4A13B8C0]> pd \c | 0x4A13B8C0, eip \c 0: 89 e0 mov eax,esp \c 2: e8 39 07 00 00 call 0x740 \c 7: 89 c7 mov edi,eax \c 9: e8 e2 ff ff ff call 0xfffffff0 \c ... This is useful for disassembling files in architectures not supported by radare. You should understand 'objdump' as 'your-own-disassembler'. \c asm.bits This variable will change the 'asm.arch' one (in radare1) and viceversa (is determined by asm.arch). It determines the size in bits of the registers for the selected architecture. This is 8, 16, 32, 64. \c asm.syntax Defines the syntax flavour to be used while disassembling. This is currently only targeting the udis86 disassembler for the x86 (32/64 bits). The supported values are 'intel' or 'att'. \c asm.pseudo Boolean value that determines which string disassembly engine to use (the native one defined by the architecture) or the one filtered to show pseudocode strings. This is 'eax=ebx' instead of a 'mov eax, ebx' for example. \c asm.section Shows or hides section name (based on flags) at the left of the address. \c asm.os Defines the target operating system of the binary to analyze. This is automatically defined by 'rabin -rI' and it's useful for switching between the different syscall tables and perform different depending on the OS. \c asm.flags If defined to 'true' shows the flags column inside the disassembly. \c asm.lines Draw lines at the left of the offset in the dissassemble print format (pd, pD) to graphically represent jumps and calls inside the current block. \c asm.linesout When defined as 'true', also draws the jump lines in the current block that goes ouside of this block. \c asm.linestyle Can get 'true' or 'false' values and makes the line analysis be performed from top to bottom if false or bottom to top if true. 'false' is the optimal and default value for readability. \c asm.offset Boolean value that shows or hides the offset address of the disassembled opcode. \c asm.profile Set how much information is showed to the user on disassembly. Can get the values 'default', 'simple', 'debug' and 'full'. This eval will modify other asm. variables to change the visualization properties for the disassembler engine. 'simple' asm.profile will show only offset+opcode, and 'debug' will show information about traced opcodes, stack pointer delta, etc.. \c asm.trace Show tracing information at the left of each opcode (sequence number and counter). This is useful to read execution traces of programs. \c asm.bytes Boolean value that shows or hides the bytes of the disassebled opcode. \c dbg.focus Can get a boolean value. If true, radare will ignore events from non selected PIDs. \c cfg.bigendian Choose the endian flavour 'true' for big, 'false' for little. \c file.id When enabled (set it up to '1' or 'true'). Runs rabin -rI after opening the target file and tries to identify the file type and setup the virtual, physical address (io.vaddr, io.paddr) and stuff like that. \c file.analyze Runs '\c{.af* @@ sym.}' and '\c{.af* @ entrypoint}', after resolving the symbols while loading the binary, to determine the maximum information about the code analysis of the program. This will not be used while opening a project file, so it is preloaded. This option requires file.id and file.flag to be true. \c file.flag Finds all the information of the target binary and setup flags to point symbols (imports, exports), sections, maps, strings, etc. This command is commonly used with file.id. \c scr.color This boolean variable allows to enable or disable the colorized output \c scr.seek This variable accepts an expression, a pointer (eg. eip), etc. radare will automatically seek to make sure its value is always within the limits of the screen. \c cfg.fortunes Enables or disables the 'fortune' message at the begging of the program \C{sample} Basic commands The basic set of commands in radare can be mostly grouped by action, and they should be easy to remember and short. This is why they are grouped with a single character, subcommands or related commands are described with a second character. For example '/ foo' for searching plain strings or '/x 90 90' to look for hexpair strings. The format of the commands (as explained in 'Command format' chapter) looks something like that: \c [#][!][cmd] [arg] [@ offset:size|@@ flags|@@=off:sz ..] [> file] [| shell-pipe] [~grep#[]] [ && ...] This is: repeat the described command '#' times. \c > 3s +1024 ; seeks three times 1024 from the current seek If the command starts with '!' the string is passed to the plugin hadling the current IO (the debugger for example), if no one handles it calls to posix_system() which is a shell escape, you can prefix the command with two '!!'. \c > !help ; handled by the debugger or shell \c > !!ls ; runs ls in the shell The [arg] argument depends on the command, but most of them take a number as argument to specify the number of bytes to work on instead of block size. Other commands accept math expressions, or strings. \c > px 0x17 ; show 0x17 bytes in hexa at cur seek \c > s base+0x33 ; seeks to flag 'base' plus 0x33 \c > / lib ; search for 'lib' string. The '@' is used to specify a temporal seek where the command is executed. This is quite useful to not seeking all the time. \c > p8 10 @ 0x4010 ; show 10 bytes at offset 0x4010 \c > f patata @ 0x10 ; set 'patata' flag at offset 0x10 Using '@@' you can execute a single command on a list of flags matching the glob: \c > s 0 \c > / lib ; search 'lib' string \c > p8 20 @@ hit0_* ; show 20 hexpairs at each search hit The '>' is used to pipe the output of the command to a file (truncating to 0 if exist) \c > pr > dump.bin ; dump 'raw' bytes of current block to 'dump.bin' file \c > f > flags.txt ; dump flag list to 'flags.txt' The '|' pipe is used to dump the output of the command to another program. \c [0x4A13B8C0]> f | grep section | grep text \c 0x0805f3b0 512 section._text \c 0x080d24b0 512 section._text_end Using the '&&' chars you can concatenate multiple commands in a single line: \c > x @ esp && !reg && !bt ; shows stack, regs and backtrace \H{seek} Seeking The command 's' is used to seek. It accepts a math expression as argument that can be composed by shift operations, basic math ones and memory access. The 's'eek command supports '+-*!' characters as arguments to perform acts on the seek history. \c [0x4A13B8C0]> s? \c Usage: > s 0x128 ; absolute seek \c > s +33 ; relative seek \c > sn ; seek to next opcode \c > sb ; seek to opcode branch \c > sc ; seek to call index (pd) \c > sx N ; seek to code xref N \c > sX N ; seek to data reference N \c > sS N ; seek to section N (fmi: 'S?') \c > s- ; undo seek \c > s+ ; redo seek \c > s* ; show seek history \c > .s* ; flag them all \c > s! ; reset seek history The '>' and '<' commands are used to seek into the file using a block-aligned base. \c > >>> ; seek 3 aligned blocks forward \c > 3> ; 3 times block-seeking \c > s +30 ; seek 30 bytes forward from current seek \c > s 0x300 ; seek at 0x300 \c > s [0x400] ; seek at 4 byte dword at offset 0x400 \c > s 10+0x80 ; seek at 0x80+10 The 'sn' and 'sb' commands uses the code analysis module to determine information about the opcode in the current seek and seek to the next one (sn) or branch where it points (sb). \c [0x4A13B8C0]> :pd 1 \c 0x4A13B8C0, mov eax, esp \c [0x4A13B8C0]> sn ; seek next opcode \c [0x4A13B8C2]> :pd 1 \c 0x4A13B8C2 call 0x4a13c000 \c [0x4A13B8C2]> sb ; seek to branch address \c [0x4A13C000]> :pd 1 \c 0x4A13C000, push ebp \c [0x4A13C000]> To 'query' the math expression you can evaluate them using the '?' command and giving the math operation as argument. And getting the result in hexa, decimal, octal and binary. \c > ? 0x100+200 \c 0x1C8 ; 456d ; 710o ; 1100 1000 \S{undo-seek} Undo seek All the seeks are stored in a linked list as a history of navigation over the file. You can easily go forward backward of the seek history by using the 's-' and 's+' commands. In visual mode just press 'u' or 'U' to undo or redo inside the seek history. Here's a seesion example: \c [0x00000000]> s 0x100 \c [0x00000100]> s 0x200 \c [0x00000200]> s- ; undo last seek done \c [0x00000100]> \H{bsize} Block size The block size is the default view size for radare. All commands will work with this constraint, but you can always temporally change the block size just giving a numeric argument to the print commands for example (px 20) \c [0xB7F9D810]> b? \c Usage: b[f flag]|[size] ; Change block size \c > b 200 ; set block size to 200 \c > bt next @ here ; block size = next-here \c > bf sym.main ; block size = flag size The 'b' command is used to change the block size: \c [0x00000000]> b 0x100 ; block size = 0x100 \c [0x00000000]> b +16 ; ... = 0x110 \c [0x00000000]> b -32 ; ... = 0xf0 The 'bf' command is used to change the block size to the one specified by a flag. For example in symbols, the block size of the flag represents the size of the function. \c [0x00000000]> bf sym.main ; block size = sizeof(sym.main) \c [0x00000000]> pd @ sym.main ; disassemble sym.main \c ... You can perform these two operations in a single one (pdf): \c [0x00000000]> pdf @ sym.main Another useful block-size related is 'bt' that will set a new block size depending on the current offset and a 'end' address. This is useful when working with io-streams like sockets or serial ports, because you can easily set the block size to fit just a single read. For example \c $ radare socket://www.gogle.com:80/ \c [0x0000000]> w GET /\r\n\r\n \c [0x0000000]> bt _sockread_2 @ _sockread_1 You can also use this command to manually get the interpolation between two search hits (for example when looking for headers and footers in a raw disk image). \H{sections} Sections It is usually on firmware images, bootloaders and binary files to find sections that are loaded in memory at different addresses than the one in the disk. To solve this issue, radare implements two utilities: 'io.vaddr' and 'S'. The io.vaddr specifies the current virtual address to be used for disassembling and displaying offsets. In the same way all offsets used in expressions are also affected by this eval variable. For files with more than one virtual address. The 'S'ection command will do the job. Here's the help message: \c [0xB7EE8810]> S? \c Usage: S len [base [comment]] @ address \c > S ; list sections \c > S* ; list sections (in radare commands \c > S= ; list sections (in visual) \c > S 4096 0x80000 rwx section.text @ 0x8048000 ; adds new section \c > S 4096 0x80000 ; 4KB of section at current seek with base 0x. \c > S 10K @ 0x300 ; create 10K section at 0x300 \c > S -0x300 ; remove this section definition \c > Sc rwx _text ; add comment to the current section \c > Sv 0x100000 ; change virtual address \c > St 0x500 ; set end of section at this address \c > Sf 0x100 ; set from address of the current section This command allows you to manage multiple virtual and physical addresses correspondencies depending on the current seek, and enables the possibility to add comments to them. So the debugger information can be imported to the core in a simple way, adding information about the page protections of each section and so. Here's a sample dummy session. \c [0xB7EEA810]> S 10K \c [0xB7EE8810]> s +5K \c [0xB7EE8810]> S 20K \c [0xB7EE9C10]> s +3K \c [0xB7EE9C10]> S 5K We can specify a section in a single line in this way: \c S [size] [base-address] [comment] @ [from-address] For example: \c S section.text_end-section.text 0x8048500 r-x section.text @ 0x4300 Displaying the sections information: \c [0xB7EEA810]> S \c 00 * 0xb7ee8810 - 0xb7eeb010 bs=0x00000000 sz=0x00002800 ; eip \c 01 * 0xb7ee9c10 - 0xb7eeec10 bs=0x00000000 sz=0x00005000 \c 02 * 0xb7eea810 - 0xb7eebc10 bs=0x00000000 sz=0x00001400 \c [0xB7EEA810]> S= \c 00 0xb7ee8810 |#################-------------------------| 0xb7eeb010 \c 01 0xb7ee9c10 |---------#################################| 0xb7eeec10 \c 02 0xb7eea810 |--------------########--------------------| 0xb7eebc10 \c => 0xb7eea810 |#-----------------------------------------| 0xb7eea874 The first three lines are sections and the last one is the current seek representation based on the proportions over them. The 's'eek command implements a 'sS' (seek to Section) to seek at the beeginging to the section number N. For example: 'sS 1' in this case will seek to 0xb7ee9c10. To remove a section definition just prefix the from-address of the section with '-': \c [0xB7EE8810]> S -0xb7ee9c10 \c [0xB7EE8810]> S \c 00 . 0xb7ee9c10 - 0xb7eeec10 bs=0x00000000 sz=0x00005000 \c 01 . 0xb7eea810 - 0xb7eebc10 bs=0x00000000 sz=0x00001400 After the section definition we can change the parameters of them with the Sf, St, Sc, Sb commands. After this, radare core will automatically setup the io.vaddr depending on this section information \H{iomap} Mapping files Radare IO allows to virtually map contents of files in the same IO space at random offsets. This is useful to open multiple files in a single view or just to 'emulate' an static environment like if it was in the debugger with the program and all its libraries mapped there. Using the 'S'ections command you'll be able to define different base address for each library loaded at different offsets. Mapping files is done with the 'o' (open) command. Let's read the help: \c [0x00000000]> o? \c Usage: o [file] [offset] \c > o /bin/ls ; open file \c > o /lib/libc.so 0xC848000 ; map file at offset \c > o- /lib/libc.so ; unmap Let's prepare a simple layout: \c $ rabin -l ./a.out \c libc.so.6 \c $ radare -u ./a.out \c [0x00000000]> o /lib/libc.so.6 0x10000000 \c [0x00000000]> o /lib/ld-2.7.so 0x465f2000 NOTE: radare has been started with the -u flag to ignore file size limits and being able to seek on far places like where we have mapped our libs. Listing mapped files: \c [0x00000000]> o \c 0x00000000 0x000018da ./a.out \c 0x465f2000 0x4660cf28 /lib/ld-2.7.so \c 0x10000000 0x101370ec /lib/libc.so.6 Let's print some strings from ld.so \c [0x00000000]> pa @ 0x465F0000+ 2469 \c _rtld_global\x00_dl_make_stack_executable\x00__libc_stack_end\x00__libc_memalign\x00malloc\x00_dl_deallocate_tls \c \x00__libc_enable_secure\x00_dl_get_tls_static_info\x00calloc\x00_dl_debug_state\x00_dl_argv\x00_dl_allocate_tls \c _init\x00_rtld_global_ro\x00realloc\x00_dl_tls_setup\x00_dl_rtld_di_... To unmap these files just use the 'o-' command giving the mapped file name as argument. \H{print} Print modes One of the efforts in radare is the way to show the information to the user. This is interpreting the bytes and giving an almost readable output format. The bytes can be represented as integers, shorts, longs, floats, timestamps, hexpair strings, or things more complex like C structures, disassembly, decompilations, external processors, .. This is a list of the available print modes listable with 'p?': \c [0x08049AD0]> p? \c Available formats: \c p% : print scrollbar of seek (null) \c p= : print line bars for each byte (null) \c pa : ascii (null) \c pA : ascii printable (null) \c pb : binary N bytes \c pB : LSB Stego analysis N bytes \c pc : C format N bytes \c pd : disassembly N opcodes bsize bytes \c pD : asm.arch disassembler bsize bytes \c pe : double 8 bytes \c pF : windows filetime 8 bytes \c pf : float 4 bytes \c pi : integer 4 bytes \c pl : long 4 bytes \c pL : long (ll for long long) 4/8 bytes \c pm : print memory structure 0xHHHH \c pC : comment information string \c po : octal dump N bytes \c pO : Overview (zoom.type) entire file \c pp : cmd.prompt (null) \c pr : raw ascii (null) \c pR : reference (null) \c ps : asm shellcode (null) \c pt : unix timestamp 4 bytes \c pT : dos timestamp 4 bytes \c pu : URL encoding (null) \c pU : executes cmd.user (null) \c pv : executes cmd.vprompt (null) \c p1 : p1: 1byte, 8 bit hex pair 1 byte \c p2 : p2: 2bytes, 16 bit hex word 2 bytes \c p4 : p4: 4bytes, 32 bit hex dword 4 bytes \c p6 : p6: base64 encode (p9 to decode) entire block \c p7 : 7bit encoding (sms) (null) \c p8 : p8: 8bytes, 64 bit quad-word 8 bytes \c p9 : p9: base64 decode (p6 to encode) entire block \c px : hexadecimal dump N byte \c pX : hexpairs N byte \c pz : ascii null terminated (null) \c pZ : wide ascii null end (null) \S{print-hexa} Hexadecimal User-friendly way: \c [0x4A13B8C0]> px \c offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF \c 0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ffff 81c3 ...9............ \c 0x4A13B8D0, eea6 0100 8b83 08ff ffff 5a8d 2484 29c2 ..........Z.$.). Hexpairs: \c [0x4A13B8C0]> p1 \c 89 e0 e8 39 07 00 00 89 c7 e8 e2 ff ff ff 81 c3 ee a6 01 00 8b 83 08 ff ff ff 5a 8d 24 84 29 c2 Basic size types governed by endian: 16 bit words \c [0x4A13B8C0]> p2 4 \c 0xe089 \c 0x39e8 32 bit doublewords \c [0x4A13B8C0]> p4 4 \c 0x39e8e089 \c [0x4A13B8C0]> e cfg.bigendian \c false \c [0x4A13B8C0]> e cfg.bigendian = true \c [0x4A13B8C0]> p4 4 \c 0x89e0e839 \c [0x4A13B8C0]> 64 bit dwords \c [0x08049A80]> p8 16 \c 31 ed 5e 89 e1 83 e4 f0 50 54 52 68 60 9e 05 08 \c \c [0x08049A80]> p64 16 \c 0x31ed5e89e183e4f0 \c 0x50545268609e0508 \S{print-dates} Date formats The current supported timestamp print modes are: \c F : windows filetime 8 bytes \c t : unix timestamp 4 bytes \c T : dos timestamp 4 bytes For example, you can 'view' the current buffer as timestamps in dos, unix or windows filetime formats: \c [0x08048000]> eval cfg.bigendian = 0 \c [0x08048000]> pt 4 \c 30:08:2037 12:25:42 +0000 \c [0x08048000]> eval cfg.bigendian = 1 \c [0x08048000]> pt 4 \c 17:05:2007 12:07:27 +0000 As you can see, the endianness affects to the print formats. Once printing these filetimes you can grep the results by the year for example: \c [0x08048000]> pt | grep 1974 | wc -l \c 15 \c [0x08048000]> pt | grep 2022 \c 27:04:2022 16:15:43 +0000 The date format printed can be configured with the 'cfg.datefmt' variable following the \c{strftime(3)} format. Extracted from the strftime(3) manpage: \c %a The abbreviated weekday name according to the current locale. \c %A The full weekday name according to the current locale. \c %b The abbreviated month name according to the current locale. \c %B The full month name according to the current locale. \c %c The preferred date and time representation for the current locale. \c %C The century number (year/100) as a 2-digit integer. (SU) \c %d The day of the month as a decimal number (range 01 to 31). \c %e Like %d, the day of the month as a decimal number, leading spaces \c %E Modifier: use alternative format, see below. (SU) \c %F Equivalent to %Y-%m-%d (the ISO 8601 date format). (C99) \c %g Like %G, but without century, that is, with a 2-digit year (00-99). (TZ) \c %h Equivalent to %b. (SU) \c %H The hour as a decimal number using a 24-hour clock (range 00 to 23). \c %I The hour as a decimal number using a 12-hour clock (range 01 to 12). \c %j The day of the year as a decimal number (range 001 to 366). \c %k The hour (24-hour clock) as a decimal number (range 0 to 23); \c %l The hour (12-hour clock) as a decimal number (range 1 to 12); \c %m The month as a decimal number (range 01 to 12). \c %M The minute as a decimal number (range 00 to 59). \c %n A newline character. (SU) \c %O Modifier: use alternative format, see below. (SU) \c %p Either ‘AM’ or ‘PM’ \c %P Like %p but in lowercase: ‘am’ or ‘pm’ \c %r The time in a.m. or p.m. notation. In the POSIX this is to %I:%M:%S %p. (SU) \c %R The time in 24-hour notation (%H:%M). (SU) For seconds, see %T below. \c %s The number of seconds since the Epoch (1970-01-01 00:00:00 UTC). (TZ) \c %S The second as a decimal number (range 00 to 60). \c %t A tab character. (SU) \c %T The time in 24-hour notation (%H:%M:%S). (SU) \c %u The day of the week as a decimal, range 1 to 7, Monday being 1. See also %w. (SU) \c %w The day of the week as a decimal, range 0 to 6, Sunday being 0. See also %u. \c %W The week number of the current year as a decimal number, range 00 to 53. \c %x The preferred date representation for the current locale without the time. \c %X The preferred time representation for the current locale without the date. \c %y The year as a decimal number without a century (range 00 to 99). \c %Y The year as a decimal number including the century. \c %z The time-zone as hour offset from GMT. (using "%a, %d %b %Y %H:%M:%S %z"). (GNU) \c %Z The time zone or name or abbreviation. \c %+ The date and time in date(1) format. (TZ) (Not supported in glibc2.) \c %% A literal ’%’ character. \S{print-basic-types} Basic types All basic C types are mapped as print modes for float, integer, long and longlong. If you are interested in a more complex structure or just an array definition see 'print memory' section for more information. Here's the list of the print (\c{p?}) modes for basic C types: \c f : float 4 bytes \c i : integer 4 bytes \c l : long 4 bytes \c L : long long 8 bytes Let's see some examples: \c [0x4A13B8C0]> pi 32 \c 57 \c 137 \c 255 \c 195 \c 0 \c 255 \c 141 \c 194 \c [0x4A13B8C0]> pf \c -0.000000 \c 0.000000 \c -119237.992188 \c nan \c -25687860278081448018744180736.000000 \c -0.000000 \c nan \S{print-source} Source (asm, C) \c c : C format N bytes \c s : asm shellcode (null) \c [0xB7F8E810]> pc 32 \c #define _BUFFER_SIZE 32 \c unsigned char buffer[_BUFFER_SIZE] = { \c 0x89, 0xe0, 0xe8, 0x49, 0x02, 0x00, 0x00, 0x89, 0xc7, 0xe8, 0xe2, 0xff, 0xff, \c 0xff, 0x81, 0xc3, 0xd6, 0xa7, 0x01, 0x00, 0x8b, 0x83, 0x00, 0xff, 0xff, 0xff, \c 0x5a, 0x8d, 0x24, 0x84, 0x29, 0xc2 }; \c [0xB7F8E810]> ps 32 \c eip: \c .byte 0x89, 0xe0, 0xe8, 0x49, 0x02, 0x00, 0x00, 0x89, 0xc7, 0xe8, 0xe2 \c .byte 0xff, 0xff, 0xff, 0x81, 0xc3, 0xd6, 0xa7, 0x01, 0x00, 0x8b, 0x83 \c .byte 0x00, 0xff, 0xff, 0xff, 0x5a, 0x8d, 0x24, 0x84, 0x29, 0xc2 \c .equ eip_len, 32 \S{print-strings} Strings Strings are probably one of the most important entrypoints while starting to reverse engineer a program because they are usually referencing information about the functions actions ( asserts, debug or info messages, ...). So it is important for radare to be able to print strings in multiple ways: \c ..p?.. \c a : ascii (null) \c A : ascii printable (null) \c z : ascii null terminated (null) \c Z : wide ascii null end (null) \c r : raw ascii (null) Commands 'pa' and 'pA' are pretty similar, but 'pA' protects your console from strange non-printable characters. These two commands are restricted to the block size, so you will have to manually adjust the block size to get a nicer format. If the analyzed strings are zero-terminated or wide-chars, use 'z' or 'Z'. Most common strings will be just zero-terminated ones. Here's an example by using the debugger to continue the execution of the program until it executes the 'open' syscall. When we recover the control over the process, we get the arguments passed to the syscall, pointed by \c{%ebx}. Which is obviously a zero terminated string. \c [0x4A13B8C0]> !contsc open \c 0x4a14fc24 syscall(5) open ( 0x4a151c91 0x00000000 0x00000000 ) = 0xffffffda \c [0x4A13B8C0]> !regs \c eax 0xffffffda esi 0xffffffff eip 0x4a14fc24 \c ebx 0x4a151c91 edi 0x4a151be1 oeax 0x00000005 \c ecx 0x00000000 esp 0xbfbedb1c eflags 0x200246 \c edx 0x00000000 ebp 0xbfbedbb0 cPaZstIdor0 (PZI) \c [0x4A13B8C0]> \c [0x4A13B8C0]> pz @ 0x4a151c91 \c /etc/ld.so.cache Finally, the 'pr' is used to raw print the bytes to stdout. These bytes can be redirected to a file by using the '>' character: \c [0x4A13B8C0]> pr 20K > file \c [0x4A13B8C0]> !!du -h file \c 20K file \S{print-memory} Print memory It is possible to print various packed data types in a single line using the 'pm' command (print memory). Here's the help and some examples: \c [0x4A13B8C0]> pm \c Usage: pm [times][format] [arg0 arg1] \c Example: pm 10xdz pointer length string \c Example: pm {array_size}b @ array_base \c Example: pm x[foo]b @ esp \c e - little endian \c E - big endian \c f - float value \c b - one byte \c B - show 10 first bytes of buffer \c d - %d integer value (4 bytes) \c D - double value (4 bytes) \c q - quadword (8 bytes) \c x - 0x%08x hexadecimal value \c X - 0x%08x hexadecimal value and flag (fd @ addr) \c z - \0 terminated string \c Z - \0 terminated wide string \c s - pointer to string \c t - unix timestamp string \c * - next char is pointer \c . - skip 1 byte \c : - skip 4 bytes \c {}- used to eval math expressions to repeat next fmt char \c []- used to nest format structures registered with 'am' \c %1,%2,%4,%8 - type size (default is asm.bits/8) \c NOTE: Use 'am' command to register inner structs The simple use would be like this: \c [0xB7F08810]> pm xxs @ esp \c 0xbf8614d4 = 0xb7f22ff4 \c 0xbf8614d8 = 0xb7f16818 \c 0xbf8614dc = 0xbf8614dc -> 0x00000000 /etc/ld.so.cache This is sometimes useful for looking at the arguments passed to a function, by just giving the 'format memory string' as argument and temporally changing the current seek with the '@' token. It is also possible to define arrays of structures with 'pm'. Just prefix the format string with a numeric value. You can also define a name for each field of the structure by giving them as optional arguments after the format string splitted by spaces. \c [0x4A13B8C0]> pm 2xw pointer type @ esp \c 0xbf87d160 [0] { \c pointer : 0xbf87d160 = 0x00000001 \c type : 0xbf87d164 = 0xd9f3 \c } \c 0xbf87d164 [1] { \c pointer : 0xbf87d164 = 0xbf87d9f3 \c type : 0xbf87d168 = 0x0000 \c } If you want to store this information as metadata for the binary file just use the same arguments, but instead of using \c{pm}, use \c{Cm}. To store all the metadata stored while analyzing use the 'Ps ' command to save the project and then run \c{radare -p project-file} to restore the session. Read 'projects' section for more information. A practical example for using pm on a binary GStreamer plugin: \c $ radare ~/.gstreamer-0.10/plugins/libgstflumms.so \c [0x000028A0]> seek sym.gst_plugin_desc \c [0x000185E0]> pm iissxsssss major minor name desc _init version \ \c license source package origin \c major : 0x000185e0 = 0 \c minor : 0x000185e4 = 10 \c name : 0x000185e8 = 0x000185e8 flumms \c desc : 0x000185ec = 0x000185ec Fluendo MMS source \c _init : 0x000185f0 = 0x00002940 \c version : 0x000185f4 = 0x000185f4 0.10.15.1 \c license : 0x000185f8 = 0x000185f8 unknown \c source : 0x000185fc = 0x000185fc gst-fluendo-mms \c package : 0x00018600 = 0x00018600 Fluendo MMS source \c origin : 0x00018604 = 0x00018604 http://www.fluendo.com \S{print-code} Disassembly The 'pd' command is the one used to disassemble code, it accepts a numeric value to specify how many opcodes are wanted to be disassembled. The 'pD' one acts in the same way, but using a number-of-bytes instead of counting instructions. \c d : disassembly N opcodes count of opcodes \c D : asm.arch disassembler bsize bytes If you prefer a smarter disassembly with offset and opcode prefix the 'pd' command with ':'. This is used to temporally drop the verbosity while executing a radare command. \c [0x4A13B8C0]> pd 1 \c | 0x4A13B8C0, eip: 89e0 mov eax, esp \c \c [0x4A13B8C0]> :pd 1 \c 0x4A13B8C0, mov eax, esp The ',' near the offset determines if the address is aligned to 'cfg.addrmod' (this is 4 by default). \S{print-code-arch} Selecting the architecture The architecture flavour for the disassembly is defined by the 'asm.arch' eval variable. Here's a list of all the supported architectures: \c [0xB7F08810]> eval asm.arch = arm \c \c Supported values: \c intel \c intel16 \c intel32 \c intel64 \c x86 \c mips \c arm \c arm16 \c java \c sparc \c ppc \c m68k \c csr \c msil \S{print-code-config} Configuring the disassembler There are multiple options that can be used to configure the output of the disassembly \c asm.comments = true ; show/hide comments \c asm.cmtmargin = 27 ; comment margins \c asm.cmtlines = 0 ; max number of comment lines (0=unlimit) \c asm.offset = true ; show offsets \c asm.reladdr = false ; show relative addresses \c asm.nbytes = 8 ; max number of bytes per opcode \c asm.bytes = true ; show bytes \c asm.flags = true ; show flags \c asm.flagsline = false ; show flags in a new line \c asm.functions = true ; show function closures \c asm.lines = true ; show jump/call lines \c asm.nlines = 6 ; max number of jump lines \c asm.lineswide = true ; use wide jump lines \c asm.linesout = false ; show jmp lines that go outside the block \c asm.linestyle = false ; use secondary jump line style \c asm.trace = false ; show opcode trace information \c asm.os = linux ; used for syscall resolution and so \c asm.split = true ; split end blocks by lines \c asm.splitall = false ; split all blocks by lines \c asm.size = false ; show size of opcode \S{print-code-syntax} Disassembly syntax The syntax is the flavour of disassembly syntax prefered to be used by the disasm engine. Actually the x86 disassembler is the more complete one. It's based on udis86 and supports the following syntax flavours: \c e asm.syntax = olly \c e asm.syntax = intel \c e asm.syntax = att \c e asm.syntax = pseudo The 'olly' syntax uses the ollydbg disassembler engine. 'intel' and 'att' are the most common ones and 'pseudo' is an experimental pseudocode disassembly, sometimes useful for reading algorithms. \H{zoom} Zoom The zoom is a print mode that allows you to get a global view of the whole file or memory map in a single screen. Each byte represents file_size/block_size bytes of the file. Use the pO (zoom out print mode) to use it, or just toggle 'z' in the visual mode to zoom-out/zoom-in. The cursor can be used to scroll faster thru the zoom out view and pressing 'z' again to zoom-in where the cursor points. \c zoom.byte values: \c F : number of 0xFF \c f : number of flags \c c : code (functions) \c s : strings \c t : traces (opcode traces) \c p : number of printable chars \c e : entropy calculation \c * : first byte of block For example. let's see some examples: \c [0x08049790]> pO \c offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 0123456789ABCDEF01 \c 0x00001790, 7fc7 0107 0141 b9e9 559b 3b85 f87d 7f89 ff05 .....A..U.;..}.... \c 0x00007730, 04c0 8505 c78b 7555 7dc3 0584 f8b0 8985 8900 ......uU}......... \c 0x0000D6D0, 8b55 1485 fbff ffff ff50 83d0 6620 2020 6561 .U.......P..f ea \c 0x00013670, 6918 7f57 cc74 002e 2400 i..W.t..$. \c \c [0x08049790]> eval zoom.byte = printable \c [0x08049790]> pO \c offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 0123456789ABCDEF01 \c 0x00001790, 7fc7 0107 0141 b9e9 559b 3b85 f87d 7f89 ff05 .....A..U.;..}.... \c 0x00007730, 04c0 8505 c78b 7555 7dc3 0584 f8b0 8985 8900 ......uU}......... \c 0x0000D6D0, 8b55 1485 fbff ffff ff50 83d0 6620 2020 6561 .U.......P..f ea \c 0x00013670, 6918 7f57 cc74 002e 2400 i..W.t..$. \c \c [0x08049790]> pO \c offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 0123456789ABCDEF01 \c 0x00001790, 0202 0304 0505 0505 0505 0505 0505 0605 0505 .................. \c 0x00007730, 0505 0505 0505 0505 0505 0606 0505 0505 0605 .................. \c 0x0000D6D0, 0505 0405 0505 0505 0505 0505 0303 0303 0405 .................. \c 0x00013670, 0403 0405 0404 0304 0303 .......... \c \c [0x08049790]> eval zoom.byte = flags \c [0x08049790]> pO \c offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 0123456789ABCDEF01 \c 0x00001790, 0b04 1706 0400 0000 0000 0000 0000 0000 0000 .................. \c 0x00007730, 0000 0000 0000 0000 0000 0000 0000 0000 0000 .................. \c 0x0000D6D0, 0000 0000 0000 0000 0000 000d 1416 1413 165b .................[ \c 0x00013670, 1701 0e23 0b67 2705 0f12 ...#.g'... \c \c [0x08049790]> eval zoom.byte = FF \c [0x08049790]> pO \c offset 0 1 2 3 4 5 6 7 8 9 A B C D E F 0 1 0123456789ABCDEF01 \c 0x00001790, 0000 0000 0000 0001 0000 0001 0000 0000 0200 .................. \c 0x00007730, 0000 0100 0000 0000 0000 0000 0000 0101 0000 .................. \c 0x0000D6D0, 0000 0001 0201 0202 0100 0000 0000 0000 0000 .................. \c 0x00013670, 0000 0000 0002 0000 0000 .......... In the debugger, the zoom.from and zoom.to eval variables are defined by .!maps* to fit the user code sections of memory of the target process. BTW you can determine the limits for performing a zoom on a range of bytes of the whole bytespace by using the zoom.from and zoom.to eval variables. \c [0x465D8810]> e zoom. \c zoom.from = 0x08048000 \c zoom.to = 0x0805f000 \c zoom.byte = head NOTE: These values (0x8048000-...) are defined by the debugger to limit the zoom view while debugging to only visualize the user maps of the program. \H{flagsmin} Flags The flags are bookmarks at a certain offset in the file that can be stored inside 'flag spaces'. A flag space is something like a namespace for flags. They are used to group flags with similar characteristics or of a certain type. Some example of flagspaces could be [i]sections, registers, symbols, search hits[/i], etc. To create a flag just type: \c > f flag_name @ offset You can remove this flag adding '-' at the begginging of the command. Most commands accept '-' as argument-prefix as a way to delete. \c > f -flag_name To switch/create between flagspaces use the 'fs' command: \c [0x4A13B8C0]> fs ; list flag spaces \c 00 symbols \c 01 imports \c 02 sections \c 03 strings \c 04 regs \c 05 maps \c > fs symbols \c > f ; list only flags in symbols flagspace \c ... \c > fs * ; select all flagspaces You can create two flags with the same name with 'fn' or rename them with 'fr'. Sometimes you'll like to add some flags adding a delta base address to each of them. To do this use the command 'ff' (flag from) which is used to specify this base address. Here's an example: \c [0x00000000]> f patata \c [0x00000000]> ? patata \c 0x0 ; 0d ; 0o ; 0000 0000 \c [0x00000000]> ff 0x100 \c [0x00000000]> f patata \c [0x00000000]> ? patata \c 0x100 ; 256d ; 400o ; 0000 0000 \c [0x00000000]> ff \c 0x00000100 \c [0x00000000]> ff 0 ; reset flag from \S{flagsint} Flag intersections The '/' command for searching registers some flags for the hit results. You can use them to draw intersection vectors between these hits and be able to determine block sizes from a header and a footer search keywords. Here's an example: \c [0x00000000]> !cat txt \c _head \c jklsdfjlksaf \c _foot \c _body \c jeje peeee \c _foot \c _body \c food is lavle \c _foot Let's define the header and the footer keywords: \c [0x00000000]> /k0 _body \c [0x00000000]> /k1 _foot \c [0x00000000]> /k \c 00 _body \c 01 _foot Do the ranged search using keywords 0 and 1: \c [0x00000000]> /r 0,1 \c 001 0x00000000 hit0_0 _bodyjklsdfjlksaf \c 002 0x00000015 hit1_1 _foot_bodyjeje p \c 003 0x0000001c hit0_2 _bodyjeje peeee- \c 004 0x0000002f hit1_3 _foot_bodyfood is \c 005 0x00000036 hit0_4 _bodyfood is lavle \c 006 0x0000004b hit1_5 _foot Perform intersection between hits! \c [0x00000000]> fi hit0 hit1 \c hit0_0 (0x00000000) -> hit1_1 (0x00000015) ; size = 21 \c hit0_2 (0x0000001c) -> hit1_3 (0x0000002f) ; size = 19 \c hit0_4 (0x00000036) -> hit1_5 (0x0000004b) ; size = 21 \H{write} Write Radare can manipulate the file in multiple ways. You can resize the file, move bytes, copy/paste them, insert mode (shifting data to the end of the block or file) or just overwrite some bytes with an address, the contents of a file, a widestring or inline assembling an opcode. To resize. Use the 'r' command which accepts a numeric argument. Possitive valule sets the new size to the file. A negative one will strip N bytes from the current seek down-sizing the file. \c > r 1024 ; resize the file to 1024 bytes \c > r -10 @ 33 ; strip 10 bytes at offset 33 To write bytes just use the 'w' command. It accepts multiple input formats like inline assembling, endian-friendly dwords, files, hexpair files, wide strings: \c [0x4A13B8C0]> w? \c Usage: w[?|*] [argument] \c w [string] ; write plain with escaped chars string \c wa [opcode] ; write assembly using asm.arch and rasm \c wA '[opcode]' ; write assembly using asm.arch and rsc asm \c wb [hexpair] ; circulary fill the block with these bytes \c wv [expr] ; writes 4-8 byte value of expr (use cfg.bigendian) \c ww [string] ; write wide chars (interlace 00s in string) \c wf [file] ; write contents of file at current seek \c wF [hexfile] ; write hexpair contents of file \c wo[xrlaAsmd] [hex] ; operates with hexpairs xor,shiftright,left,add,sub,mul,div Some examples: \c > wx 12 34 56 @ 0x8048300 \c > wv 0x8048123 @ 0x8049100 \c > wa jmp 0x8048320 All write changes are recorded and can be listed or undo-ed using the 'u' command which is explained in the 'undo/redo' section. \S{write-over} Write over with operation The 'wo' write command accepts multiple kinds of operations that can be applied on the curren block. This is for example a \c{XOR}, \c{ADD}, \c{SUB}, ... \c [0x4A13B8C0]> wo? \c Usage: wo[xrlasmd] [hexpairs] \c Example: wox 90 ; xor cur block with 90 \c Example: woa 02 03 ; add 2, 3 to all bytes of cur block \c Supported operations: \c woa addition += \c wos substraction -= \c wom multiply *= \c wod divide /= \c wox xor ^= \c woo or |= \c woA and &= \c wor shift right >>= \c wol shift left <<= This way it is possible to implement ciphering algorithms using radare core primitives. A sample session doing a \c{xor(90) + addition(01 02)} \c [0x4A13B8C0]> x \c offset 0 1 2 3 4 5 6 7 8 9 A B C D 0123456789ABCD \c 0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ffff ...9.......... \c 0x4A13B8CE 81c3 eea6 0100 8b83 08ff ffff 5a8d ............Z. \c 0x4A13B8DC, 2484 29c2 528b 8344 0000 008d 7494 $.).R..D....t. \c 0x4A13B8EA 088d 4c24 0489 e583 e4f0 5050 5556 ..L$......PPUV \c 0x4A13B8F8, 31ed e8f1 d400 008d 93a4 31ff ff8b 1.........1... \c 0x4A13B906 2424 ffe7 8db6 0000 0000 e8b2 4f01 $$..........O. \c 0x4A13B914, 0081 c1a7 a601 0055 89e5 5d8d 814c .......U..]..L \c 0x4A13B922 0600 .. \c \c [0x4A13B8C0]> wox 90 \c [0x4A13B8C0]> x \c offset 0 1 2 3 4 5 6 7 8 9 A B C D 0123456789ABCD \c 0x4A13B8C0, 1970 78a9 9790 9019 5778 726f 6f6f .px.....Wxrooo \c 0x4A13B8CE 1153 7e36 9190 1b13 986f 6f6f ca1d .S~6.....ooo.. \c 0x4A13B8DC, b414 b952 c21b 13d4 9090 901d e404 ...R.......... \c 0x4A13B8EA 981d dcb4 9419 7513 7460 c0c0 c5c6 ......u.t`.... \c 0x4A13B8F8, a17d 7861 4490 901d 0334 a16f 6f1b .}xaD....4.oo. \c 0x4A13B906 b4b4 6f77 1d26 9090 9090 7822 df91 ..ow.&....x".. \c 0x4A13B914, 9011 5137 3691 90c5 1975 cd1d 11dc ..Q76....u.... \c 0x4A13B922 9690 .. \c \c [0x4A13B8C0]> woa 01 02 \c [0x4A13B8C0]> x \c offset 0 1 2 3 4 5 6 7 8 9 A B C D 0123456789ABCD \c 0x4A13B8C0, 1a72 79ab 9892 911b 587a 7371 7071 .ry.....Xzsqpq \c 0x4A13B8CE 1255 7f38 9292 1c15 9971 7071 cb1f .U.8.....qpq.. \c 0x4A13B8DC, b516 ba54 c31d 14d6 9192 911f e506 ...T.......... \c 0x4A13B8EA 991f ddb6 951b 7615 7562 c1c2 c6c8 ......v.ub.... \c 0x4A13B8F8, a27f 7963 4592 911f 0436 a271 701d ..ycE....6.qp. \c 0x4A13B906 b5b6 7079 1e28 9192 9192 7924 e093 ..py.(....y$.. \c 0x4A13B914, 9113 5239 3793 91c7 1a77 ce1f 12de ..R97....w.... \c 0x4A13B922 9792 .. \H{undo} Undo/redo The 'u'ndo command is used to undo or redo write changes done on the file. \c > u? \c Usage: > u 3 ; undo write change at index 3 \c > u -3 ; redo write change at index 3 \c > u ; list all write changes Here's a sample session working with undo writes: \c [0x00000000]> wx 90 90 90 @ 0x100 \c [0x00000100]> u ; list changes \c 00 + 3 00000100: 89 90 c4 => 90 90 90 \c [0x00000000]> p8 3 @ 0x100 \c 90 90 90 \c [0x00000000]> u 0 \c [0x00000000]> p8 3 @ 0x100 \c 89 90 c4 \c [0x00000000]> u -0 \c [0x00000000]> p8 3 @ 0x100 \c 90 90 90 Note: Read 'undo-seek' for seeking history manipulation. \H{yank} Yank/Paste You can yank/paste bytes in visual mode using the 'y' and 'Y' key bindings that are alias for the 'y' and 'yy' commands of the shell. There is an internal buffer that stores N bytes from the current seek. You can write-back to another seek using the 'yy' one. \c [0x4A13B8C0]> y? \c Usage: y[ft] [length] \c > y 10 @ eip ; yanks 10 bytes from eip \c > yy @ edi ; write these bytes where edi points \c > yt [len] dst ; copy N bytes from here to dst Sample session: \c > s 0x100 ; seek at 0x100 \c > y 100 ; yanks 100 bytes from here \c > s 0x200 ; seek 0x200 \c > yy ; pastes 100 bytes You can perform a \c{yank and paste} in a single line by just using the 'yt' command (yank-to). The syntax is the following: \c [0x4A13B8C0]> x \c offset 0 1 2 3 4 5 6 7 8 9 A B 0123456789AB \c 0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ...9........ \c 0x4A13B8CC, ffff 81c3 eea6 0100 8b83 08ff ............ \c 0x4A13B8D8, ffff 5a8d 2484 29c2 ..Z.$.). \c \c [0x4A13B8C0]> yt 8 0x4A13B8CC @ 0x4A13B8C0 \c [0x4A13B8C0]> x \c offset 0 1 2 3 4 5 6 7 8 9 A B 0123456789AB \c 0x4A13B8C0, 89e0 e839 0700 0089 c7e8 e2ff ...9........ \c 0x4A13B8CC, 89e0 e839 0700 0089 8b83 08ff ...9........ \c 0x4A13B8D8, ffff 5a8d 2484 29c2 ..Z.$.). \c [0x4A13B8C0]> \H{cmp} Comparing bytes You can compare data using the 'c' command that accepts different input formats and compares the input against the bytes in the current seek. \c > c? \c Usage: c[?|d|x|f] [argument] \c c [string] - compares a plain with escaped chars string \c cc [offset] - code bindiff current block against offset \c cd [offset] - compare a doubleword from a math expression \c cx [hexpair] - compare hexpair string \c cf [file] - compare contents of file at current seek An example of memory comparision: \c [0x08048000]> p8 4 \c 7f 45 4c 46 \c \c [0x08048000]> cx 7f 45 90 46 \c Compare 3/4 equal bytes \c 0x00000002 (byte=03) 90 ' ' -> 4c 'L' \c [0x08048000]> This is also useful for comparing memory pointers at certain offsets. The variable cfg.bigendian is used to change the value in the proper way to be compared against the contents at the '0x4A13B8C0' offset: \c [0x4A13B8C0]> cd 0x39e8e089 @ 0x4A13B8C0 \c Compare 4/4 equal bytes \c \c [0x4A13B8C0]> p8 4 \c 89 e0 e8 39 It takes 4 bytes from the current seek (0x4A13B8C0) and compares them to the number given. This number can be an math expressions using flag names and so: \c [0x08048000]> cx 7f 45 90 46 \c Compare 3/4 equal bytes \c 0x00000002 (byte=03) 90 ' ' -> 4c 'L' \c [0x08048000]> We can use the compare command against a file previously dumped to disk from the contents of the current block. \c $ radare /bin/true \c [0x08049A80]> s 0 \c [0x08048000]> cf /bin/true \c Compare 512/512 equal bytes \H{comparing-code} Comparing code Another subcommand of 'c' (compare) command is the 'cc' which stands for 'compare code'. This command accepts a numeric expression as argument and compares the blocks (block size) found in current seek and the given one. For example: \c [0x08049A80]> cc sym.main2 @ sym.main \C{visual-mode} Visual mode The visual mode is a user-friendlier interface for the commandline prompt of radare which accepts HJKL movement keys, a cursor for selecting bytes and some keybindings to ease the use of the debugger. In this mode you can change the configuration in a easy way using the 'e' (eval) key. Or just track the flags and walk thru the flagspaces pressing 't'. To get a help of all the keybindings hooked in visual mode you can press '?': \c Visual keybindings: \c : radare command (vi like) \c ; edit or add comment \c ,. ',' marks an offset, '.' seeks to mark or eip if no mark \c g,G seek to beggining or end of file \c +-*/ +1, -1, +width, -width -> block size \c <> seek block aligned (cursor mode = folder code) \c [] adjust screen width \c a,A,= insert patch assembly, rsc asm or !hack \c i insert mode (tab to switch btw hex,asm,ascii, 'q' to normal) \c f,F seek between flag list (f = forward, F = backward) \c t visual track/browse flagspaces and flags \c e visual eval configuration variables \c c toggle cursor mode \c C toggle scr.color \c d convert cursor selected bytes to ascii, code or hex \c m applies rfile magic on this block \c I invert block (same as pIx or so) \c y,Y yank and Yankee aliases for copy and paste \c f,F go next, previous flag (cursor mode to add/remove) \c h,j,k,l scroll view to left, down, up, right. \c J,K up down scroll one block. \c H,L scroll left, right by 2 bytes (16 bits). \c p,P switch between hex, bin and string formats \c x show xrefs of the current offset \c q exits visual mode \c \c Debugger keybindings: \c ! show debugger commands help \c F1 commands help \c F2 set breakpoint (execute) \c F3 set watchpoint (read) \c F4 continue until here (!contuh) \c F6 continue until syscall (!contsc) \c F7 step in debugger user code (!step) \c F8 step over in debugger (!stepo) \c F9 continue execution (!cont) \c F10 continue until user code (!contu) From the visual mode you can toggle the insert and cursor modes with the 'i' and 'c' keys. \H{visual-mode-cursor} Visual cursor Pressing lowercase 'c' makes the cursor appear or disappear. The cursor is used to select a range of bytes or just point to a byte to flag it (press 'f' to create a new flag where the cursor points to) If you select a range of bytes press 'w' and then a byte array to overwrite the selected bytes with the ones you choose in a circular copy way. For example: \c "; printf("; offset \n", $offset); print"; block 512\n"; print"; lines $disasm_lines\n"; print ""; } // XXX dupped function edit_notes() { global $offset; global $target; print "
"; print ""; print ""; print ""; print "

"; print "
"; } function edit_comment() { global $offset; global $target; print "
"; print "offset: $offset\n"; print ""; printf("", $offset); $offset=sprintf("%x", $offset); print ""; print "

"; print "
"; } function comment_for($off) { global $target; /* big comments */ $file=sprintf("$target.%x.txt", $off); $fd = @fopen($file, "r"); if ($fd) { print "
"; //print ""; print "
"; } /* database stuff */ $fd = fopen("$target.db", "r"); if (!$fd) { return; } $lines = 0; while(!feof($fd) && $lines<20) { $line = fgets($fd); if (!strncmp($line, "comment ", 8)) { $foo = split(" ", $line); sscanf($foo[1], "%x", $ofset); if ($ofset == $off) { $comment = substr($line, strlen($foo[0])+strlen($foo[1])+2); print "; $comment"; } } else if (!strncmp($line, "label ", 6)) { $foo = split(" ", $line); sscanf($foo[1], "%x", $ofset); if ($ofset == $off) { $label = chop($foo[2]); print "$label:\n"; } } } fclose($fd); } function xref_for($off) { global $target; /* database stuff */ $fd = fopen("$target.db", "r"); if (!$fd) { return; } $lines = 0; $xrefs = ""; while(!feof($fd) && $lines<20) { $line = fgets($fd); if (!strncmp($line, "xref ", 5)) { $foo = split(" ", $line); sscanf($foo[1], "%x", $ofset); if ($ofset == $off) { sscanf($foo[2], "%x", $ofset); $comment = substr($line, strlen($foo[0])+strlen($foo[1])); $xrefs.=sprintf(" %x", $ofset,$ofset); } } } fclose($fd); if ($xrefs) return " ; refs to$xrefs"; return ""; } function strings() { global $target; $fd = fopen("$target.str", "r"); if (!$fd) { print "Cannot open strings file\n"; return; } $lines = 0; $xrefs = ""; while(!feof($fd) && $lines<20) { $line = fgets($fd); $foo = split(" ", $line); $bar = "".$foo[0].""; $line = str_replace($foo[0],$bar, $line); print $line; } fclose($fd); } function labels() { global $target; global $offset; global $tab; $fd = @fopen("$target.db", "r"); if (!$fd) { print "Cannot open foobase file\n"; return; } print "; labels\n"; ?>
\n"; $lines = 0; while(!feof($fd) && $lines<20) { $line = fgets($fd); if (!strncmp($line, "label ", 6)) { $foo = split(" ", $line); sscanf($foo[1], "%x", $ofset); $label = $foo[2]; printf("%8s ".chop($label)." \n", $foo[1], $ofset); } } fclose($fd); print "
"; } ?> Label '$input' added at offset $offset.\n"; } else { print "Cannot write to the database file.\n"; } } else if (!strcmp($action,"add_ref")) { $fd = @fopen("$target.db","a+"); if ($fd) { fwrite($fd, sprintf("xref %x %s\n", $offset, $input)); fclose($fd); print "Refrence added at offset $offset pointing to $input.\n"; } else { print "Cannot write to the database file.\n"; } } else if (!strcmp($action,"add_com")) { $fd = @fopen("$target.db","a+"); if ($fd) { fwrite($fd, sprintf("comment %x %s\n", $offset, $input)); fclose($fd); print "Added comment at offset $offset saying '$input'.\n"; } else { print "Cannot write to the database file.\n"; } } else if (!strcmp($action,"edit_notes")) { $fd = @fopen("$target.notes","w"); if ($fd) { fwrite($fd, $input); fclose($fd); print "Added comment at offset $offset.\n"; } else { print "Cannot write to the database file.\n"; } } else if (!strcmp($action,"edit_comment")) { $off = sprintf("%x", $offset); $fd = @fopen("$target.$off.txt","w"); if ($fd) { fwrite($fd, $input); fclose($fd); print "Added comment at offset $offset.\n"; } else { print "Cannot write to the database file.\n"; } } } ?> "; $fd = fopen("$target.txt", "r"); if (!$fd) { print "Cannot open dissaembly file\n"; return; } $offstr=" 0:\t"; $lines = 0; $toggle = 0; while(!feof($fd)) { $line = fgets($fd); if (!$toggle && strstr($line, $offstr)) $toggle=1; if ($toggle) { $foo = split(":", $line); $foo[0] = str_replace(" ", "",$foo[0]); sscanf($foo[0], "%x", $ofset); comment_for($ofset); $line = str_replace($foo[0].":\t", "".$foo[0].":\t", chop($line)); print $line.xref_for($ofset)."\n"; $lines++; } } fclose($fd); print "\n"; exit(); } ?>
/* radare web frontend */



; references ; add
; comments ; add ; edit comment ; notes
strings",
		str_replace("disasm",
		"disasm",
		str_replace("notes",
		"notes",
		str_replace("comment",
		"comment",
		str_replace("plain",
		"plain",
		";   disasm   hexdump   strings   comment   notes   plain\n")))));
	?> 
hexdump", str_replace("disasm", "disasm", str_replace("comment", "comment", str_replace("notes", "notes", str_replace("plain", "plain", "; disasm hexdump strings comment notes plain\n"))))); ?>
hexdump", str_replace("disasm", "disasm", str_replace("strings", "strings", str_replace("notes", "notes", str_replace("plain", "plain", "; disasm hexdump strings comment notes plain\n"))))); ?>
hexdump", str_replace("disasm", "disasm", str_replace("strings", "strings", str_replace("comment", "comment", str_replace("plain", "plain", "; disasm hexdump strings comment notes plain\n"))))); ?>
strings", str_replace("hexdump", "hexdump", str_replace("notes", "notes", str_replace("comment", "comment", str_replace("plain", "plain", "; disasm hexdump strings comment notes plain\n"))))); ?>
radare-1.5.2/raweb/raweb.pl000066400000000000000000000013241141417717500155220ustar00rootroot00000000000000#!/usr/bin/env perl if (@ARGV<1) { print "Usage: raweb [/path/to/bin]\n"; exit; } my $file = $ARGV[0]; my $name = substr($file, rindex($file,"/")+1); my $objdump = "arm-unknown-linux-gnu-objdump -m arm"; $objdump = "objdump -m i386"; mkdir $name; system("cp $file $name/$name.bin"); system ("$objdump --target=binary -D $file > $name/$name.txt"); system("radare -S 10 $file > $name/$name.str"); system("chmod 777 $name"); system("objdump -d /bin/ls|grep '>:' > $name/$name.tmp"); open FD, "<$name/$name.tmp" || die "oops"; open DD, ">$name/$name.db" || die "oops"; while() { /(.*) <(.*)>:/; my $offset=sprintf("%x", eval("0x$1")-0x8048000); my $label=$2; print DD "label $offset $label\n"; } close DD; close FD; radare-1.5.2/scripts/000077500000000000000000000000001141417717500144545ustar00rootroot00000000000000radare-1.5.2/scripts/args.txt000066400000000000000000000001101141417717500161410ustar00rootroot00000000000000# Usage: # radare -e file.dbg_arg=args.txt -d ls arg0=/bin/ls arg1=/usr radare-1.5.2/scripts/dotgraph000066400000000000000000000002001141417717500161770ustar00rootroot00000000000000e asm.profile=simple e scr.color=false !step 4 s eip agd > file.dot !!dot -Tpng -o graph.png file.dot !!rsc view graph.png q! y radare-1.5.2/scripts/elf-entry-point000077500000000000000000000004611141417717500174370ustar00rootroot00000000000000; Usage: cat elf-entry-point | radare /bin/ls ; ; prints the entry of the ELF ; !echo " __ _ _____ __ _ _ __ __ _ _ _____" !echo "| = | \| | | | ,)\ ^ / | ,)/ .\| || \| | |" !echo "|__||\_| |_| |_|\ |_| |_| \__/|_||\_| |_|" !echo e 0 s 0x18 !printf " Points to 0x" vW !echo q radare-1.5.2/scripts/elf-flag-header000077500000000000000000000003411141417717500173030ustar00rootroot00000000000000s 0 f here s here b 4 f elf.magic s here b 16 f elf.ident s 16 b 2 f elf.type s 18 b 2 f elf.machine s 20 b 4 f elf.version s 24 b 4 f elf.entry s 28 b 4 f elf.phoff s 32 b 4 f elf.shoff s 36 b 4 f elf.flags s here radare-1.5.2/scripts/fix-shoff.rs000066400000000000000000000010061141417717500167100ustar00rootroot00000000000000; radare script to fix elf.shoff ; author: pancake -- nopcode.org @ 2009 ; ; Usage example: ; cp /usr/bin/gedit gedit ; # TRASH ELF SHT PTR ; echo wx 99 @ 0x21 | radare -nw gedit ; # OBJDUMP/GDB/LTRACE/... CANNOT DO ANYTHING ; objdump -d gedit # objdump: gedit: File format not recognized ; # FIX ELF SHT PTR ; echo ".(fix-sht) && q" | radare -i scripts/fix-shoff.rs -nw gedit ; # TRY OBJDUMP AGAIN :) (fix-sht s 0 s/ .text loop: s/x 00 ? [1:$$+1] ?!.loop: s +4-$$%4 f nsht wv nsht @ 0x20 ) radare-1.5.2/scripts/gun-demo000066400000000000000000000003621141417717500161130ustar00rootroot00000000000000e asm.profile=simple e scr.color=0 e scr.bytewidth=16 gur gun eip 40 pd gun esp 128 px gun entrypoint 128 pd "gun esp+1 128 ad @ esp" gue entrypoint eip gue eip esp gue esp gud > a.dot !!dot -Tpng -ograph.png a.dot !!rsc view graph.png guv q radare-1.5.2/scripts/hello.bf000066400000000000000000000002651141417717500160730ustar00rootroot00000000000000>+++++++++[<++++++++>-]<.>+++++++[<++++>-]<+.+++++++..+++.[-] >++++++++[<++++>-] <.>+++++++++++[<++++++++>-]<-.--------.+++ .------.--------.[-]>++++++++[<++++>- ]<+.[-]++++++++++. radare-1.5.2/scripts/inject/000077500000000000000000000000001141417717500157305ustar00rootroot00000000000000radare-1.5.2/scripts/inject/Makefile000066400000000000000000000001471141417717500173720ustar00rootroot00000000000000all: as shellcode.s ld shellcode.o -o shellcode radare -i dump-text.lua shellcode #> shellcode.text radare-1.5.2/scripts/inject/dump-text.lua000066400000000000000000000003311141417717500203570ustar00rootroot00000000000000-- flag sections r.cmd(".!rsc flag-sections $FILE") r.cmd("eval file.baddr = 0x8048000") r.cmd("seek section_text"); r.cmd("bsize section_text_end-section_text"); print("-------------"); print(r.cmd("pX")) r.cmd("q") radare-1.5.2/scripts/inject/inj.lua000066400000000000000000000003531141417717500172140ustar00rootroot00000000000000--------------------------------------------- -- Example injecting a file and adding a hook -- function hook_x86(from, to, file) r.cmd("wf "..file.." @ "..to) r.cmd("wa jmp "..from) end hook_x86(0x8048000, 0x8049000, "/tmp/file") radare-1.5.2/scripts/inject/inj.py000066400000000000000000000007361141417717500170700ustar00rootroot00000000000000# # This is a small python script to inject hand-made # shellcodes, symbols, or array of bytes in a simple # way into binaries at runtime or on-disk-patching # in a simple way. # from radare import * def inject_trampoline(addr, code_addr, code): seek(addr) op = analyze_opcode() if op['size'] != 5: print "Oops: The opcode at "+addr+" is not 5 byte long" return 0 # Inject our trampoline r.cmd("wa jmp %s @ 0x%08x"%(code_addr, addr)) r.cmd("wx %s"%code) return 1 radare-1.5.2/scripts/inject/mprotect.S000066400000000000000000000007541141417717500177170ustar00rootroot00000000000000/* Change stack perms of own process*/ #if 1 #define _SYS_MMAN_H #include #else #define PROT_READ 1 #define PROT_WRITE 2 #define PROT_EXEC 4 #endif #define SYS_mprotect 125 #define STACKPERMS PROT_READ|PROT_WRITE #define FUN_IN pusha #define FUN_OUT popa ; ret .global change_stack_perms change_stack_perms: FUN_IN movl %esp, %eax andl $0xffff0000, %eax movl $0xffff, %ebx movl STACKPERMS, %ecx movl SYS_mprotect, %eax pushl %ebp int $0x80 popl %ebp FUN_OUT radare-1.5.2/scripts/inject/shellcode.s000066400000000000000000000002501141417717500200530ustar00rootroot00000000000000.intel_syntax noprefix .global _start _start: pusha call foo .string "/bin/sh" foo: mov ebx, [esp] push edx push ebx mov ecx, esp mov eax, 0xb int 0x80 popa radare-1.5.2/scripts/macros000066400000000000000000000015251141417717500156660ustar00rootroot00000000000000; hello world (hello name !hello $0 ) ; executes a command N times using a recursive macro (loop times cmd ? $0 == 0 ?? () $1 .(loop $0-1 $1) ) ; dummy hello world (foo one two x $0 @ $1 ) (disasm x f foo @ $0 label: pd 1 s +$$$ f foo @ foo-1 ? foo != 0 ??.label: ) ; implementation of a numeric range 'for' loop in radare script ; usage: x @@ .(for 10 100) (for from to ?$@+$0==$1 ??() ()$@+$0 ) ; function iterator ; x @@ .(for-fun) (for-fun ()`C*~CF [3]#$@` ) ; Likely/Unlikely branch commenter ; (step-post-anal,?z`ao@oeip~type = cond,??(),?eip==`ao@oeip~jump =[2],??CC likely@oeip,??(),CC unlikely@oeip,) (step-post-anal ?z`ao@oeip~type = cond` ??() ?eip==`ao@oeip~jump =[2]` ??CC likely@oeip ??() CC unlikely@oeip ) (label-test f foo @ 3 loop: !! echo LOOP f foo @ foo-1 ? foo ?!.loop: ) radare-1.5.2/scripts/mmx2ls2f.pl000066400000000000000000000045711141417717500164720ustar00rootroot00000000000000#!/usr/bin/perl # # mmx2ls2f # # Intel x86-MMX assembly code translator to MIPS Loongson2{E,F} # # License: GPL # # author: pancake # my %regs = (); # MMX $regs{"mm0"} = "f0"; $regs{"mm1"} = "f2"; $regs{"mm2"} = "f4"; $regs{"mm3"} = "f6"; $regs{"mm4"} = "f8"; $regs{"mm5"} = "f10"; $regs{"mm6"} = "f12"; $regs{"mm7"} = "f14"; # GP $regs{"ebx"} = "f0"; $regs{"ecx"} = "t3"; # counter $regs{"esi"} = "t4"; $regs{"edi"} = "t5"; while() { chomp(my $str = $_); $str=~s/%%/%/g; for $a (keys(%regs)) { if ($str=~/$a/) { eval ("\$str=~s/$a/$regs{$a}/gei;"); } } # instructions $str=~s/movd\s+\(%(.+)\)\s*,\s*%([^\s]+)/"ldc1 \$$1, \$$2"/ge; #$str=~s/psrad\s+\$(.+)\s*,\s*%([^\s]+)/li \$t1, \$f18, \$t1psraw \$$2, \$$2, \$$1"/ge; $str=~s/jnz/bnez/ge; $str=~s/ret/jr \$ra\nnop/g; $str=~s/movq\s+(\d+)\(%(.+)\)\s*,\s*%([^\s]+)/ldc1 \$$3, $1 (\$$2)/g; $str=~s/movq\s+%\[(.+)\]\s*,\s*%([^\s]+)/ldc1 \$$2, 0($1)/g; $str=~s/movq\s+%(.+)\s*,\s*%\[([^\s]+)\]/sdc1 \$$1, 0($2)/g; $str=~s/movq\s+%(.+)\s*,\s*(\d+)\(%([^\s]+)\)/sdc1 \$$1, $2(\$$3)/g; $str=~s/movq\s+%(.+)\s*,\s*%([^\s]+)/mov\.d \$$2, \$$1/g; $str=~s/pmullw\s+%\[(.+)\]\s*,\s*%([^\s]+)/ldc1 \$f20, 0($1)\npmullh \$$2, \$$2, \$f20/g; $str=~s/pmullw\s+%(.+)\s*,\s*%([^\s]+)/pmullh \$$2, \$$2, \$$1/g; ## IS THIS OK ? $str=~s/psraw\s+\$(.+)\s*,\s*%([^\s]+)/li \$t2, $1\ndmtc1 \$t2, \$f18\npsrah \$$2, \$$2, \$f18/g; $str=~s/psubw\s+%(.+)\s*,\s*%([^\s]+)/psubh \$$2, \$$2, \$$1/g; $str=~s/paddw\s+%(.+)\s*,\s*%([^\s]+)/paddh \$$2, \$$2, \$$1/g; $str=~s/movl\s+\$(\d+)\s*,\s*%([^\s]+)/li \$$2, $1/g; $str=~s/psllw\s+\$(\d+)\s*,\s*%([^\s]+)/li \$t1, $1\ndmtc1 \$t1, \$f18\npsllh \$$2, \$$2, \$f18/g; $str=~s/punpcklwd\s+%(.+)\s*,\s*%([^\s]+)/punpcklhw \$$2, \$$2, \$$1/g; $str=~s/punpckhwd\s+%(.+)\s*,\s*%([^\s]+)/punpckhhw \$$2, \$$2, \$$1/g; $str=~s/punpckldq\s+%(.+)\s*,\s*%([^\s]+)/punpcklwd \$$2, \$$2, \$$1/g; $str=~s/punpckhdq\s+%(.+)\s*,\s*%([^\s]+)/punpckhwd \$$2, \$$2, \$$1/g; $str=~s/packssdw\s+%(.+)\s*,\s*%([^\s]+)/packsswh \$$2, \$$2, \$$1/g; $str=~s/packuswb\s+%(.+)\s*,\s*%([^\s]+)/packushb \$$2, \$$2, \$$1/g; $str=~s/addl\s+\$(\d+), %([^\s]+)/addi \$$2, \$$2, $1/g; $str=~s/subl\s+\$(\d+), %([^\s]+)/addi \$$2, \$$2, -$1/g; $str=~s/[^\d]0\((.*)\)/$1/g; $str=~s/\%f/\$f/g; # TODO # punpckldq %mm7, %mm1 # punpckhdq %mm7, %mm1 $str=~s/^\s+//g; $str=~s/^\t+//g; print "$str\n" if ($str); } radare-1.5.2/scripts/recover-pics.rscript000066400000000000000000000003721141417717500204670ustar00rootroot00000000000000; ; Scripts to recover JPEG images from a hard disk ; These JPEGs have been generated by a CASIO camera ; (recover-exif,e search.to=$$,s -200,s/ Exif,? [1:$$]-0x45,?!(),s -6,wT dump 1M,) ; run the macro! / CASIO COMPUTER CO .(recover-exif) @@ hit0_ radare-1.5.2/scripts/reto.bf000066400000000000000000000432511141417717500157430ustar00rootroot00000000000000+>>+++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++<+[>++<-]>.>+++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++<+[>++<-]>.>+++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++<+[>++<-]>.>+++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>.>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-><.+>+++++++++++++[+++<+]>-><.+>+++++++++++++++++++++++++++++++++++++<+[>++<-]>.>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>+]<>.>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++++[+++<+]>-.<++>>++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>++++++++++++++++++++++++++++++++++++++++++++++++++++[<-+>.]<+>>+++++++++++++++++++++++++++++++++++++++++++++++++++++++++<+[>++<-]>+.+>+++++++++++++++++++++++[<-+>.]< radare-1.5.2/scripts/shell.ra000066400000000000000000000000611141417717500161040ustar00rootroot00000000000000(shell,?i Offset to read,pd 20 @ $$?, .(shell)) radare-1.5.2/sql/000077500000000000000000000000001141417717500135645ustar00rootroot00000000000000radare-1.5.2/sql/Makefile000066400000000000000000000001171141417717500152230ustar00rootroot00000000000000all: sqlite3 test.rdb < init.sql read: sqlite3 test.rdb "select * from t1;" radare-1.5.2/sql/README000066400000000000000000000007441141417717500144510ustar00rootroot00000000000000sql and radare ============== Radare can make use of a SQL database to store and manage information about the process. The main idea is to have a (shared?) database where multiple users can work together sharing label, comments and more information between multiple radare sessions when debugging a process. These tables should be generated on a sqlite (at the moment) database. This is just a proof of concept, so, I don't expect having sql support for radare until 0.9 or more. radare-1.5.2/sql/init.sql000066400000000000000000000013101141417717500152430ustar00rootroot00000000000000-- stable create table blocks ( address INTEGER, end_address INTEGER, bytes BLOB, hash VARCHAR(32) ); create table xrefs ( address INTEGER, xref INTEGER ); create table comments ( time DATE, address INTEGER, string VARCHAR(100) ); create table labels ( time DATE, address INTEGER, string VARCHAR(100) ); create table syscalls ( address INTEGER, block INTEGER, -- unique id here string VARCHAR(20) ); -- development create table trace ( time DATE, address INTEGER ); create table entrys ( address INTEGER ); create table breakpoints ( time DATE, address INTEGER, enabled BOOLEAN ); create table dwarf ( time DATE, address INTEGER, string VARCHAR(100) ); radare-1.5.2/src/000077500000000000000000000000001141417717500135545ustar00rootroot00000000000000radare-1.5.2/src/Makefile.acr000066400000000000000000000055371141417717500157720ustar00rootroot00000000000000include ../config.mk include objects.mk OBJ+=${crOBJ} #$(pref ../src/,${crOBJ}) CFLAGS+=-I. -Iinclude # hand made maemo stuff W32LIBS= ##W32## OBJ+=plug/io/w32.o w32utils.o W32LIBS=-lwsock32 ##W32## MAEMO_OBJ=/usr/lib/libreadline.a /usr/lib/libtermcap.a ##DEBUGGER## include dbg/objects.mk OBJ+=plug/io/debug.o OBJ2+=${psOBJ} TARGETS+=libdbg ##DEBUGGER## ##WII## OBJ+=plug/io/wii/wii.o ##WII## ##SYSPROXY## OBJ2+=plug/io/sysproxy.o rasc/syscall-linux.o rasc/rpc.o #CFLAGS+=-DSYSPROXY ##SYSPROXY## #CFLAGS+=-DLIBDIR=\"${LIBDIR}\" -DDOCDIR=\"${DATADIR}/doc/radare/\" #CFLAGS+=-DHAVE_LIB_READLINE=${HAVE_LIB_READLINE} -DLIBEXECDIR=\"${LIBEXECDIR}\" #CFLAGS+=-DSIZEOF_OFF_T=${SIZEOF_OFF_T} -DDEBUGGER=${DEBUGGER} -DTARGET=\"${TARGET}\" -DRADARE_CORE -DHAVE_LIB_EWF=${HAVE_LIB_EWF} CFLAGS+=-DRADARE_CORE LIBS+=${DL_LIBS} ${OSOLIBS} OBJ+=grava.o ##VALA## ##HAVE_GUI## CFLAGS+=-I../vala/ `pkg-config --cflags gtk+-2.0` -DHAVE_GUI=1 LIBS+=`pkg-config --libs gtk+-2.0` OBJ2+=../vala/*.o TARGETS+=valagrava ##HAVE_GUI## ##VALA## ##W32## JAVASM_STUFF=w32utils.o -lwsock32 ##W32## .PHONY: all pre radare radare-hash radare-rax radare-xrefs clean rsc_ .SUFFIXES: .c .o .c.o: $(CC) -c $(CFLAGS) -o $@ $< #udis86 all: ${TARGETS} armasm _radiff \ lsbstego pre radare${BINSFX} _rahash plugs rsc_ \ rax${BINSFX} xrefs${BINSFX} _rasm _rabin _javasm _rasc @true install: cd .. && ${MAKE} install ${OBJS}: %.o: %.c ${CC} ${CFLAGS} -c -o $@ $< rsc_: -cd rsc && ${MAKE} all plugs: -cd plug/hack && ${MAKE} all vala: cd ../vala/ && ${MAKE} all valagrava: cd ../vala/grava/ && ${MAKE} all #cd ../vala/grava/ && ${MAKE} radare #pre: # -rm -f utils.o libdbg: cd dbg && ${MAKE} all udis86: cd arch/x86/udis86 && ${MAKE} all radare${BINSFX}: ${OBJ} ${OBJ2} main.o ${CC} ${LDFLAGS} -o radare${BINSFX} main.o ${OBJ} ${OBJ2} ${RADARE_LIBS} ${LIBS} ${W32LIBS} gui: ${OBJ} cd ../vala && ${MAKE} c -${CC} ${LDFLAGS} -o ravalagui${BINSFX} ../vala/*.o ${OBJ} ${OBJ2} ${RADARE_LIBS} ${LIBS} ${W32LIBS} -lvte lsbstego${BINSFX}: lsbstego.o ${CC} lsbstego.o -g -o lsbstego${BINSFX} _rabin: cd rabin && ${MAKE} all _javasm: cd javasm && ${MAKE} all _rasm: cd rasm && ${MAKE} all _rasc: cd rasc && ${MAKE} all armasm: cd arch/arm/aasm && ${MAKE} all _radiff: -cd radiff && ${MAKE} all _rahash: -cd rahash && ${MAKE} all rax${BINSFX}: rax.o ${CC} ${CFLAGS} rax.o -o rax${BINSFX} xrefs${BINSFX}: xrefs.o ${CC} ${CFLAGS} ${LDFLAGS} xrefs.o -o xrefs${BINSFX} clean: -cd plug/hack && ${MAKE} clean -rm -f *.o -cd arch/arm/aasm && ${MAKE} clean -rm -f dbg/arch/*.o -${MAKE} -C rahash clean -${MAKE} -C radiff clean -${MAKE} -C rabin clean -${MAKE} -C javasm clean -${MAKE} -C rsc clean -${MAKE} -C rasm clean -${MAKE} -C rasc clean -${MAKE} -C arch/x86/udis86 clean -rm -rf lsbstego.o lsbstego${BINSFX} rax.o xrefs.o ${OBJ} radare${BINSFX} xrefs${BINSFX} rax${BINSFX} a.out a.exe radare-1.5.2/src/aes-find.c000066400000000000000000000041561141417717500154140ustar00rootroot00000000000000/* * Find expanded AES keys in memory * * Algorithm discovered and developed by Victor Muñoz * - PoC and source published at 24c3 at December 2007 * * Thanks for the great moments and code snippets! * * This source is public domain. Feel free to use it and distribute it. */ #include #include #include unsigned char table_sbox[256] = { 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 }; int aes_key_test(unsigned char *buf) { if(buf[28]==table_sbox[buf[15]]&& buf[29]==table_sbox[buf[12]]&& buf[30]==table_sbox[buf[13]]&& buf[31]==(table_sbox[buf[14]]^1) ) return 1; return 0; } radare-1.5.2/src/analyze.c000066400000000000000000000646601141417717500153770ustar00rootroot00000000000000/* * Copyright (C) 2007, 2008, 2009 * pancake * nibble <.ds@gmail.com> * * radare 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. * * radare 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 radare; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ #include "main.h" #include "data.h" #include "code.h" #include "utils.h" #include "rdb.h" #include #include #include #include #define MAX_FUN_SIZE 1023 /* code analyzer */ int (*arch_aop)(ut64 addr, const u8 *bytes, struct aop_t *aop); int section_is_x (ut64 addr) { struct section_t *sec = section_get (addr); // XXX: rabin -rS is necesary here // We need to load the section information!!1 // return 1; return (sec && sec->rwx & SECTION_X); } /* code lines */ struct reflines_t *code_lines_init(int linescall) { struct reflines_t *list = (struct reflines_t*)malloc(sizeof(struct reflines_t)); struct reflines_t *list2; int bar = PTRCAST (config_get("asm.linesout")); unsigned char *ptr = config.block; unsigned char *end = config.block + config.block_size; struct aop_t aop; int dt, sz, bsz = 0; int index = 0; ut64 seek = 0; int lines = -1; if (config.visual) lines = config.height; INIT_LIST_HEAD(&(list->list)); if (arch_aop == NULL) return NULL; /* analyze code block */ while( ptr < end ) { if (lines != -1 && --lines == 0) break; if (config.interrupted) break; dt = data_type(config.seek+bsz); if (dt != DATA_FUN && dt != DATA_CODE) { ut64 sz = data_size(config.seek+bsz); if (sz > 0) { ptr= ptr +sz; bsz=bsz+sz; continue; } } seek = config.seek + bsz; sz = arch_aop(seek, ptr, &aop); //sz = arch_aop(config.seek+bsz, ptr, &aop); if (sz < 1) { sz = 1; } else { /* store data */ switch(aop.type) { case AOP_TYPE_CALL: if (!linescall) goto __next; case AOP_TYPE_CJMP: case AOP_TYPE_JMP: if (!bar) { /* skip outside lines */ if (aop.jump > seek+config.block_size) goto __next; /* skip outside lines */ #if 0 //XXXX DO NOT ENABLE if (aop.jump < seek-20) //config.block_size) goto __next; #endif } else { if (aop.jump == 0) goto __next; } if (ptr-config.block <= config.cursor) { config.acursor = ptr-config.block; config.cursor_ptr = aop.jump; } list2 = (struct reflines_t*)malloc(sizeof(struct reflines_t)); list2->from = seek; list2->to = aop.jump; list2->index = index++; list_add_tail(&(list2->list), &(list->list)); break; } } __next: ptr = ptr + sz; bsz += sz; } return list; } void code_lines_free(struct list_head *list) { // TODO: WTF!!1 What The Free!! free(list); } void code_lines_print(struct reflines_t *list, ut64 addr, int expand) { struct list_head *pos; int foo = config_get_i("asm.linestyle"); int bar = config_get_i("asm.nlines"); int cow = 0; char ch = ' '; if (!list) return; cons_strcat(" "); #define _h34d_ &(list->list) if (bar) { int count = 0; for (pos = foo?(_h34d_)->next:(_h34d_)->prev; pos != (_h34d_); pos = foo?pos->next:pos->prev) count++; for (;countnext:(_h34d_)->prev; pos != (_h34d_); pos = foo?pos->next:pos->prev) { struct reflines_t *ref = list_entry(pos, struct reflines_t, list); if (config.interrupted) break; if (addr == ref->to) cow = 1; if (addr == ref->from) cow = 2; if (addr == ref->to) { if (!expand) { if (ref->from > ref->to) cons_strcat("."); else cons_strcat("`"); ch = '-'; } else ch = '.'; } else if (addr == ref->from) { if (!expand) { if (ref->from > ref->to) cons_strcat("`"); else cons_strcat("."); ch = '='; } } else { if (ref->from < ref->to) { /* down */ C cons_strcat(C_YELLOW); if (addr > ref->from && addr < ref->to) { if (ch=='-'||ch=='=') cons_printf("%c",ch); else cons_strcat("|"); } else if (!expand) { C { if (ch=='-') cons_printf(C_WHITE"-"); else if (ch=='=') cons_printf(C_YELLOW"="); else cons_printf("%c",ch); } else cons_printf("%c",ch); } } else { C cons_strcat(C_WHITE); /* up */ if (addr < ref->from && addr > ref->to) { if (ch=='-'||ch=='=') cons_printf("%c", ch); else // ^ cons_strcat("|"); } else cons_printf("%c",ch); } } if (config_get("asm.lineswide")) { // TODO: convert to integer ? switch(ch) { case '=': case '-': cons_printf("%c", ch); break; default: cons_strcat(" "); break; } } } if (expand) { cons_strcat(" "); } else if (cow==1) { C cons_strcat(C_RED"-> "C_RESET); else cons_strcat("-> "); } else if (cow==2) { C cons_strcat(C_GREEN"=< "C_RESET); else cons_strcat("=< "); } else cons_strcat(" "); C cons_strcat(C_RESET); } /* XXX not working properly */ int code_analyze_r_split(struct program_t *prg, ut64 seek, int depth) { struct aop_t aop; ut64 oseek = seek; ut64 tmp = config.seek; unsigned int sz = 0, ret; int bsz = 0;// block size char buf[4096]; // bytes of the code block unsigned char *ptr = (unsigned char *)&buf; int callblocks =(int) config_get_i("graph.callblocks"); //int jmpblocks = (int) config_get_i("graph.jmpblocks"); int refblocks = (int) config_get_i("graph.refblocks"); struct block_t *blf = NULL; if (arch_aop == NULL) return -1; // too deep! chop branch here! if (depth<=0) return 0; radare_seek(tmp, SEEK_SET); bsz = 0; config.seek = seek; radare_read(0); aop.eob = 0; ret = radare_read(0); blf = program_block_split_new (prg, config.seek); if ( blf != NULL ) { eprintf("Block split at address 0x%08llx\n",config.seek+bsz); aop.jump = blf->tnext; aop.fail = blf->fnext; aop.eob = 1; } /* Walk for all bytes of current block */ for(bsz = 0;(!aop.eob) && (bsz+4 bytes = (unsigned char *)malloc(bsz+1); if (blk->bytes == NULL) { eprintf("analyze.c: Cannot allocate\n"); return 0; } blk->n_bytes = bsz; memcpy(blk->bytes, buf, bsz); blk->tnext = aop.jump; blk->fnext = aop.fail; oseek = seek; blk->type = BLK_TYPE_HEAD; if (aop.jump && !aop.fail) blk->type = BLK_TYPE_BODY; else if (aop.jump && aop.fail) blk->type = BLK_TYPE_BODY; else if (aop.type == AOP_TYPE_RET) blk->type = BLK_TYPE_LAST; /* walk childs */ if (blk->tnext) code_analyze_r_nosplit(prg, blk->tnext, depth-1); if (blk->fnext) code_analyze_r_nosplit(prg, blk->fnext, depth-1); return 0; } void analyze_spcc(const char *name) { char *ptr; char buf[1024]; const char *path = config_get("dir.spcc"); if (path) setenv("SPCCPATH", path, 1); if (name[0]=='\0') { radare_cmd_raw("!!rsc spcc-fe list", 0); return; } if (strchr(name, '?')) { cons_printf("Usage: as [?][-][file]\n" "Analyze structure using the spcc descriptor\n" " > as name : create/show structure\n" " > as -name : edit structure\n" " > as ? : list all spcc in dir.spcc\n"); return; } buf[0]='\0'; ptr = strchr(name, '-'); if (ptr) sprintf(buf, "!!${EDITOR} %s/%s.spcc", path, ptr+1); else sprintf(buf, "!!rsc spcc-fe %s ${BLOCK} 0", name); radare_cmd_raw(buf, 0); } /* CALLBACK defined with graph.split which is false by default */ int (*code_analyze_r)(struct program_t *prg, ut64 seek, int depth) = &code_analyze_r_nosplit; struct program_t *code_analyze(ut64 seek, int depth) { ut64 bsize = config.block_size; struct program_t *prg = program_new(NULL); if (prg == NULL) return NULL; prg->entry = config.seek; radare_set_block_size_i(4096); // max function size = 5000 radare_read(0); radare_controlc(); if (depth>30) depth=30; if (config_get("graph.split")) { code_analyze_r_nosplit(prg, seek, --depth); code_analyze_r_split(prg, seek, --depth); } else code_analyze_r_nosplit(prg, seek, --depth); // TODO: construct xrefs from tnext/fnext info radare_controlc_end(); radare_set_block_size_i(bsize); return prg; } /* memory analyzer */ #if 0 Memory analysis =============== read a data block and identify it (new print mode) The identify will consist on a dword analysis of the contents. Useful to read the stack 0000 0000 -> probably a null pointer or a initialized integer variable 0804 8xxx -> program code. probably a return address 0BFx xxxx -> stack area, probably a local variable resolve data using the flags and so Recursively harvest the memory pointers to get the values of the data. TODO: use maps here! must be mixed with flags and so #endif int radare_analyze(ut64 seek, int size, int depth, int rad) { char cmd[1024]; char str[1024]; u8 word[128]; ut64 tmp = config.seek; ut32 num, nume; // little endian int count=0; int i; int str_i=0; int word_i=0; int lastnull = 0; int v = config.verbose; config.verbose = 0; if (depth<0) return 0; config.seek = seek; radare_read(0); if ((size*4)>config.block_size) size = config.block_size/4; if (size<0) { count = 1; size = 64; } size<<=2; for(i=0;i2) { str[str_i] = '\0'; if (rad) { ut64 addr = (ut64)(seek+i-str_i); cons_printf("Cs %d @ 0x%08llx\n", strlen(str)+1, addr); flag_filter_name(str); cons_printf("f str.%s @ 0x%08llx\n", str, addr); //cons_printf("; TODO (if exists) f str_%s\n", str); } else { print_addr((ut64)(seek+i-str_i)); cons_strcat(" "); C cons_printf("string "C_BYELLOW"\"%s\""C_RESET"\n", str); else cons_printf("string \"%s\"\n", str); } word_i = 0; str_i=0; continue; } str_i = 0; word[word_i++] = config.block[i]; if (word_i==4) { word_i = 0; // compose big endian number (32bit) num = word[3]; num |= word[2]<<8; num |= word[1]<<16; num |= word[0]<<24; // compose little endian (32bit) nume = word[0]; nume |= word[1]<<8; nume |= word[2]<<16; nume |= word[3]<<24; if (num == 0) { if (lastnull++ == 0) { if (rad) { }else { cons_strcat(" "); print_addr(seek+i-3); C cons_printf(C_YELLOW"(NULL)"C_RESET"\n"); else cons_printf("(NULL)\n"); } } } else if (num == -1) { /* ignore -1 */ //print_addr(seek+i-3); //cons_printf("0xffffffff (-1)\n"); } else { if (rad) { ut32 n = (config.endian)?num:nume; str[0]='\0'; string_flag_offset(NULL, str, (ut64)n, 0); if (!strnull(str)) { /* reference by pointer */ cons_printf("Cx 0x%08llx @ 0x%08llx ; %s\n", (ut64)(seek+i-3), (ut64)n, str); } else if (n == (ut32)seek) cons_printf(" ; (self pointer)\n"); else radare_analyze(n, size, --depth, rad); } else { if (lastnull>1) cons_printf("(last null repeated %d times)\n", lastnull); lastnull = 0; // for(j=config_get_i("anal.depth"); j>depth;j--) // cons_strcat(" "); print_addr(seek+i-3); C { cons_printf(C_TURQOISE); if (config.endian) cons_printf("int be="C_YELLOW"0x%08x"C_RESET" le=0x%08x ", num, nume); else cons_printf("int be=0x%08x le="C_YELLOW"0x%08x"C_RESET" ", num, nume); } else cons_printf("int be=0x%08x le=0x%08x ", num, nume); if (num<0xffff) cons_printf("(be= %d )", num); if (nume<0xffff) cons_printf(", (le= %d ) ", nume); if (num>-0xfffff && num<0xfffff) cons_printf("(%d)\n", num); else if (nume>-0xfffff && nume<0xfffff) cons_printf("(%d)\n", nume); else { ut32 n = (config.endian)?num:nume; C cons_printf(C_TURQOISE); sprintf(cmd, ":fd @0x%08x", n); radare_cmd(cmd, 0); if (n == (ut32)seek) cons_printf(" (self pointer)\n"); else radare_analyze(n, size, --depth, rad); config.seek = seek; radare_read(0); C cons_printf(C_RESET); } } } if (count) break; } } /* restore */ config.seek = tmp; radare_read(0); config.verbose = v; return 0; } // XXX move to code.h enum { VAR_TYPE_NONE=0, VAR_TYPE_ARG=1, VAR_TYPE_LOCAL=2 }; struct vars_t { int type; int delta; int count; }; #define VAR_MAX 256 struct vars_t vars[VAR_MAX]; void analyze_var_reset() { memset(&vars, '\0', sizeof(vars)); } int analyze_var_add(int type, int delta) { int i, hole = -1; for(i=0;itype == DATA_FUN) { //cons_printf("; already analyzed\n"); // return 0; } #endif /* Analyze function */ /* XXX restore values later.. */ config_set("graph.jmpblocks", "true"); config_set("graph.callblocks", "false"); // XXX cfg.bsize affects here!! WARN WARN WARN! analyze_var_reset(); // ??? control recursivity here ?? //prg = code_analyze(config.vaddr + config.seek, 1024); prg = code_analyze(seek, config_get_i("graph.depth")); //1024); list_add_tail(&prg->list, &config.rdbs); list_for_each(head, &(prg->blocks)) { b0 = list_entry(head, struct block_t, list); //if ((b0->type == BLK_TYPE_HEAD) //if ((b0->type == BLK_TYPE_LAST) //|| (b0->type == BLK_TYPE_FOOT)) if ((b0->addr + b0->n_bytes) > end) end = (b0->addr + b0->n_bytes - 1); nblocks++; } to = end; len = (int)(1+to-seek); //from; if (len<0) return -1; bytes = (char *)malloc(len); if (bytes == NULL) return -1; if (len > MAX_FUN_SIZE) { //D eprintf("o"); D analyze_progress(1,0,0,0); len = MAX_FUN_SIZE; } ret = radare_read_at(seek, bytes, len); if (ret <0) { //eprintf("Invalid read at 0x%08llx len=%lld\n", from,len); // eprintf("x"); D analyze_progress(0,1,0,0); return -1; } switch(report) { case 2: cons_printf("f -fun.%08llx\n", from); //cons_printf("fu -fun.%08llx @ 0x%08llx\n", from, from); // XXX should be fu?!? do not works :( cons_printf("CF-0 @ 0x%08llx\n", from); // XXX can be recursive break; case 1: buf[0]='\0'; string_flag_offset(NULL, buf, from, 0); cons_printf("offset = 0x%08llx\n", from); cons_printf("label = %s\n", buf); cons_printf("size = %lld\n", to-seek); cons_printf("blocks = %lld\n", nblocks); cons_printf("bytes = "); for(i=0;i 8096) { /* OOPS TOO BIG FUN */ D analyze_progress(0,1,0,0); } else { cons_printf("fu fun.%08llx @ 0x%08llx\n", from, from); // XXX should be fu?!? do not works :( cons_printf("CF %lld @ 0x%08llx\n", to-seek+1, from); // XXX can be recursive } } //D eprintf("."); D analyze_progress(0,0,1,0); for(;seek < to; seek+=inc) { ut64 delta = seek+config.vaddr-from; if (delta >= len) { //eprintf("analyze_function: oob %lld > %lld\n", delta, len); break; } inc = arch_aop(seek+config.vaddr, bytes+delta, &aop); if (inc<1) { inc = 1; break; } switch(aop.type) { case AOP_TYPE_PUSH: analyze_function(aop.ref-config.vaddr, recursive-1, report); break; case AOP_TYPE_CALL: switch(report) { case 2: cons_printf("Cx -0x%08llx @ 0x%08llx\n", aop.jump, seek+config.vaddr); break; case 0: buf[0]='\0'; string_flag_offset(NULL, buf, aop.jump, 0); // if resolved as sym_ add its call cons_printf("Cx 0x%08llx @ 0x%08llx ; %s\n", aop.jump, seek+config.vaddr, buf); } analyze_function(aop.jump-config.vaddr, recursive-1, report); ncalls++; break; case AOP_TYPE_SWI: switch(report) { case 2: cons_printf("CC -syscall %s @ 0x%08llx\n", "(todo)", seek); break; case 0: cons_printf("CC syscall %s @ 0x%08llx\n", "(todo)", seek); break; } break; default: if (aop.ref != 0) switch(aop.type) { case AOP_TYPE_PUSH: case AOP_TYPE_STORE: case AOP_TYPE_LOAD: switch(report) { case 2: cons_printf("CX -0x%08llx @ 0x%08llx ; %s\n", aop.ref+config.vaddr, seek , buf); break; case 0: buf[0]='\0'; string_flag_offset(NULL, buf, aop.jump, 0); // if resolved as sym_ add its call cons_printf("CX 0x%08llx @ 0x%08llx ; %s\n", seek, (ut64)aop.ref, buf); } nrefs++; } } ref = (int)aop.value; if (ref==0) ref = aop.ref; switch(aop.stackop) { case AOP_STACK_LOCAL_SET: if (report == 2) { sprintf(buf, "CC -* @ 0x%08llx\n", seek); cons_strcat(buf); } else if (!report) { if (ref<0) sprintf(buf, "CC Set var%d @ 0x%08llx\n", -ref, seek); else sprintf(buf, "CC Set var%d @ 0x%08llx\n", ref, seek); cons_strcat(buf); cons_printf("CFvs %d @ 0x%08llx\n", ref, seek); } if (ref<0) analyze_var_add(VAR_TYPE_ARG, -ref); else analyze_var_add(VAR_TYPE_LOCAL, ref); break; case AOP_STACK_ARG_SET: if (report == 2) { sprintf(buf, "CC -Set arg%d @ 0x%08llx\n", ref, seek); cons_strcat(buf); } else if (!report) { sprintf(buf, "CC Set arg%d @ 0x%08llx\n", ref, seek); cons_strcat(buf); } analyze_var_add(VAR_TYPE_ARG, ref); break; case AOP_STACK_ARG_GET: if (report == 2) { sprintf(buf, "CC -* @ 0x%08llx\n", seek); cons_strcat(buf); } else if (!report) { char buf[1024]; if (ref<0) { cons_printf("CFvg %d @ 0x%08llx\n", -ref, seek); sprintf(buf, "CC Get var%d @ 0x%08llx\n", -ref, seek); } else { sprintf(buf, "CC Get arg%d @ 0x%08llx\n", ref, seek); cons_printf("CFag %d @ 0x%08llx\n", ref, seek); } cons_strcat(buf); //sprintf(buf, "CCC Get arg%d @ 0x%08llx\n", ref, seek); //cons_strcat(buf); } analyze_var_add(VAR_TYPE_ARG, ref); break; case AOP_STACK_LOCAL_GET: if (report == 2) { sprintf(buf, "CC -* @ 0x%08llx\n", seek); cons_strcat(buf); //cons_printf("CFvg %d @ 0x%08llx\n", ref, seek); } else if (!report) { if (ref<0) { sprintf(buf, "CC Get arg%d @ 0x%08llx\n", -ref, seek); cons_printf("CFag %d @ 0x%08llx\n", -ref, seek); } else { sprintf(buf, "CC Get var%d @ 0x%08llx\n", ref, seek); cons_printf("CFvg %d @ 0x%08llx\n", ref, seek); } cons_strcat(buf); } if (ref<0) analyze_var_add(VAR_TYPE_ARG, -ref); else analyze_var_add(VAR_TYPE_LOCAL, ref); break; case AOP_STACK_INCSTACK: // XXX ugly output switch(report) { case 0: if (ref<0) sprintf(buf, "CC Stack size %d @ 0x%08llx\n", (int)ref, seek); else sprintf(buf, "CC Stack size +%d @ 0x%08llx\n", (int)ref, seek); cons_strcat(buf); framesize += aop.value; sprintf(tmpstr, "%c%d",fszstr[0]?',':' ', framesize); strcat(fszstr, tmpstr); // XXX control overflow break; case 2: if (ref<0) sprintf(buf, "CC -Stack size %d @ 0x%08llx\n", (int)ref, seek); else sprintf(buf, "CC -Stack size +%d @ 0x%08llx\n", (int)ref, seek); cons_strcat(buf); framesize += aop.value; sprintf(tmpstr, "%c%d",fszstr[0]?',':' ', framesize); strcat(fszstr, tmpstr); // XXX control overflow break; } break; } /* recursivity */ if (recursive) { switch(aop.type) { case AOP_TYPE_RET: case AOP_TYPE_TRAP: seek = to; break; #if 1 case AOP_TYPE_JMP: // considered as new function radare_seek(aop.jump, SEEK_SET); //analyze_function(1); analyze_function(seek-config.vaddr, recursive-1, report); break; #endif case AOP_TYPE_CALL: // considered as new function radare_seek(aop.jump, SEEK_SET); analyze_function(seek-config.vaddr, recursive-1, report); break; } } } free(bytes); switch(report) { case 0: if (fszstr[0]) cons_printf("CC framesize = %s @ 0x%08llx\n", fszstr, from); count = analyze_var_get(VAR_TYPE_ARG); if (count>0) cons_printf("CC args = %d @ 0x%08llx\n", count, from); count = analyze_var_get(VAR_TYPE_LOCAL); if (count>0) cons_printf("CC vars = %d @ 0x%08llx\n", count, from); if (nrefs>0) cons_printf("CC drefs = %d @ 0x%08llx\n", nrefs); cons_printf("fs *\n"); break; case 1: cons_printf("framesize = %d\n", framesize); cons_printf("ncalls = %d\n", ncalls); cons_printf("drefs = %d\n", nrefs); cons_printf("xrefs = %d\n", data_xrefs_at(from)); cons_printf("args = %d\n", analyze_var_get(VAR_TYPE_ARG)); cons_printf("vars = %d\n", analyze_var_get(VAR_TYPE_LOCAL)); break; case 2: cons_printf("CC -framesize = %s @ 0x%08llx\n", fszstr, from); cons_printf("CC -args = %d @ 0x%08llx\n", analyze_var_get(VAR_TYPE_ARG), from); cons_printf("CC -vars = %d @ 0x%08llx\n", analyze_var_get(VAR_TYPE_LOCAL), from); cons_printf("CC -drefs = %d @ 0x%08llx\n", nrefs); cons_printf("fs *\n"); } return 0; } void analyze_preludes (char *input) { char cmd[1024]; char *prelude; long len; const char *sfrom, *sto, *cmdhit; switch(config.arch) { case ARCH_X86: // X86-64 is implicit here prelude = "5589e5"; break; default: eprintf ("Analyze preludes (ap) not supported for this architecture\n"); return; } sfrom = config_get("search.from"); sto = config_get("search.to"); cmdhit= config_get("cmd.hit"); len = get_math (input); if (len <1) { len = config.size; if (len <0) { eprintf ("Dunno filesize..gimme some ranges\n"); return; } } /* go search */ config_set_i("search.from", config.seek); config_set_i("search.to", config.seek+ len); config_set("cmd.hit", ".af*"); sprintf(cmd, "/x %s", prelude); radare_cmd(cmd, 0); /* restore */ config_set("search.from", sfrom); config_set("search.to", sto); config_set("cmd.hit", cmdhit); radare_cmd("f-hit*", 0); } radare-1.5.2/src/arch/000077500000000000000000000000001141417717500144715ustar00rootroot00000000000000radare-1.5.2/src/arch/8051/000077500000000000000000000000001141417717500150665ustar00rootroot00000000000000radare-1.5.2/src/arch/8051/Makefile000066400000000000000000000001121141417717500165200ustar00rootroot00000000000000all: gcc -D C_MAIN main.c pass1.c global.c pass2.c clean: rm *.o a.out radare-1.5.2/src/arch/8051/README000066400000000000000000000117621141417717500157550ustar00rootroot00000000000000 Dis51 8051 Hex-file Disassembler Description Dis51 is a simple 8051 disassembler for Unix-like systems. It may even compile under Microsoft Windows, but that has never been tested. It takes an object file in Intel Hex format as input, and outputs an assembly language file. This disassembler assumes by default that everything in memory is data, and nothing is code. It starts at any number of entry points you give it on the command line, then follows the code through all branches until no branches are left. It then outputs an assembly language file which should assemble under any standard 8051 assembler. All data memory is declared using "DB" directives. Dis51 uses symbolic names for SFRs it knows about. To be compatible with as many assemblers as possible, I only defined SFRs that I thought were common to "standard" 8051s. If you need to add other SFRs (or special function bits) then the source file to modify is global.c. It should be self-explanatory how to modify it, I hope. I wrote Dis51 mostly for fun. It was Labor Day weekend and I felt like taking a break from studies, so I started sketching out how I would design a disassembler. I probably spent no more than two weeks from preliminary design to completion of testing. I have been using the disassembler for a few months now with no problems. Another reason I created it was because I spent one afternoon downloading every free 8051 disassembler I could find on the web, and couldn't find a single one that compiled under Solaris and successfully disassembled a HEX file. I sincerely believe that such a program exists, I just couldn't find it. Thus, Dis51. How to get it Dis51 is free to download. Get it from http://home.earthlink.net/~davesullins/software/dis51-0.5.tar.gz. It's released under the GNU Public License (GPL), which means you can download the program for free, you get the source code with it, you can change the source code to suit your needs, and you can redistribute the program with or without modifications as long as the person you distribute the program to gets the same rights you were given. If you use some of the code in your own program, then your own program should also be released under the GPL. Compiling Dis51 Dis51 should compile without changes on any Unix-like machine. It probably even works under Microsoft Windows, but I don't have a compiler to try it out. Let me know what results you get if you try this. First you need to download the source code. If you have GNU tar, extract the file using one of the following commands, depending on what GNU tar is called on your system: gtar xvfz dis51-0.5.tar.gz tar xvfz dis51-0.5.tar.gz If you do not have GNU tar, you can use the following command to extract the source code: cat dis51-0.5.tar.gz | gunzip -c - | tar -xvf - Now change to the dis51-0.5 directory. Edit the Makefile if necessary. If you do not have gcc on your system, change the first line from "CC=gcc" to "CC=cc" or whatever your C compiler is called. Type "make" when you are done and dis51 will be created. Alternatively, you can use the libhexfile shared library. Just type "make shared" instead of "make" to link with libhexfile. If you don't know whether you have the libhexfile shared library installed then you probably don't. That's it! I apologize for the lack of a man page, but luckily it's a pretty simple program. Copy the executable (called dis51) to a bin directory and you're ready to go. How to use it Dis51 takes a Hex file as stdin and outputs an assembly file to stdout. In its simplest form, you can use the following command line: dis51 < file.hex > file.a51 Without any command line options, Dis51 uses the entry point 0. If you want to use other entry points, list them on the command line. For example, to disassemble a program starting at address 0 which also uses the serial port interrupt vector at address 35: dis51 0 35 < file.hex > file.a51 Optionally, you can give the first command line argument "-l" to output in list format. To repeat the previous example in list format: dis51 -l 0 35 < file.hex > file.a51 One problem with Dis51 is that it is unable to determine the target address of an indirect jump (JMP @A+DPTR). Thus if your program contains indirect jumps certain parts of code will not be disassembled. The solution is to search through the disassembled output of dis51 for the JMP @A+DPTR instruction. If you find this instruction, look for large chunks of DB directives elsewhere in the program. If you find some DB directives that you suspect are code and not data, then manually add the addresses of these directives to the command line of dis51 and run it again. Hint: 80h is the SJMP command. Lots of DB 80h directives alternated with other data bytes is likely to be a jump table. Bugs Please send me a message at davesullins@earthlink.net if you think you have found a bug. radare-1.5.2/src/arch/8051/code.c000066400000000000000000000037651141417717500161570ustar00rootroot00000000000000/* * Copyright (C) 2009 * pancake * * radare 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. * * radare 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 radare; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * */ /* code analysis functions */ #include "../../code.h" #include #include #include int arch_8051_aop(ut64 addr, const ut8 *bytes, struct aop_t *aop) { int ptr = 0; int ilen, i; int type; char str[128]; // assert(bytes); if (aop == NULL) return -1; memset (aop, '\0', sizeof (struct aop_t)); aop->type = AOP_TYPE_UNK; ptr = dis51_inst1 (bytes, 0, &type); if ((ptr == -1)&&(bytes[0]!=0x73)&&((bytes[0] & 0xef)!=0x22)) { eprintf ("Invalid instruction %02x %02x\n", bytes[0], bytes[1]); aop->type = AOP_TYPE_TRAP; return 1; // skip instruction.. } ilen = dis51_inst2 (str, bytes, 0); switch (type) { case 'j': aop->type = AOP_TYPE_JMP; aop->jump = ilen + addr + ptr; aop->eob = 1; break; case 'c': aop->type = AOP_TYPE_CALL; aop->jump = ptr; break; case 'b': aop->type = AOP_TYPE_CJMP; aop->jump = ilen + addr + ptr; aop->fail = ilen + addr; aop->eob = 1; break; } aop->length = ilen; aop->ref = 0; return ilen; } int dis51_udis (char *str, const ut8 *bytes, int len, ut64 seek) { int ptr, type; // TODO: add += seek somewhere :) ptr = dis51_inst1 (bytes, 0, &type); if (ptr == -1) { sprintf (str, "(invalid instruction)"); return -1; } return dis51_inst2 (str, bytes, 0); } radare-1.5.2/src/arch/8051/distypes.h000066400000000000000000000017621141417717500171110ustar00rootroot00000000000000/* distypes.h * * Define types used in 8051 disassembler * * Copyright 2001, 2002 by David Sullins * * This file is part of Dis51. * * Dis51 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, version 2 of the License. * * Dis51 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 * Dis51; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * You may contact the author at davesullins@earthlink.net. */ #ifndef _DISTYPES_H_ #define _DISTYPES_H_ #ifndef uchar typedef unsigned char uchar; #endif #define CODE 1 #define EMPTY 0x80 #endif /* _DISTYPES_H_ */ radare-1.5.2/src/arch/8051/global.c000066400000000000000000000206501141417717500164750ustar00rootroot00000000000000/* global.c * * Data shared by all modules * * Copyright 2001 - 2003 by David Sullins * * This file is part of Dis51. * * Dis51 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, version 2 of the License. * * Dis51 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 * Dis51; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * You may contact the author at davesullins@earthlink.net. */ #include "distypes.h" int Lst; //short lbl[65536]; const char mnemonic[256][20] = { /* 0 */ "nop", "ajmp %s", "ljmp %s", "rr A", "inc A", "inc %s", "inc @R0", "inc @R1", "inc R0", "inc R1", "inc R2", "inc R3", "inc R4", "inc R5", "inc R6", "inc R7", /* 1 */ "jbc %s, %s", "acall %s", "lcall %s", "rrc A", "dec A", "dec %s", "dec @R0", "dec @R1", "dec R0", "dec R1", "dec R2", "dec R3", "dec R4", "dec R5", "dec R6", "dec R7", /* 2 */ "jb %s, %s", "ajmp %s", "ret", "rl A", "add A, #%s", "add A, %s", "add A, @R0", "add A, @R1", "add A, R0", "add A, R1", "add A, R2", "add A, R3", "add A, R4", "add A, R5", "add A, R6", "add A, R7", /* 3 */ "jnb %s, %s", "acall %s", "reti\n", "rlc A", "addc A, #%s", "addc A, %s", "addc A, @R0", "addc A, @R1", "addc A, R0", "addc A, R1", "addc A, R2", "addc A, R3", "addc A, R4", "addc A, R5", "addc A, R6", "addc A, R7", /* 4 */ "jc %s", "ajmp %s", "orl %s, A", "orl %s, #%s", "orl A, #%s", "orl A, %s", "orl A, @R0", "orl A, @R1", "orl A, R0", "orl A, R1", "orl A, R2", "orl A, R3", "orl A, R4", "orl A, R5", "orl A, R6", "orl A, R7", /* 5 */ "jnc %s", "acall %s", "anl %s, A", "anl %s, #%s", "anl A, #%s", "anl A, %s", "anl A, @R0", "anl A, @R1", "anl A, R0", "anl A, R1", "anl A, R2", "anl A, R3", "anl A, R4", "anl A, R5", "anl A, R6", "anl A, R7", /* 6 */ "jz %s", "ajmp %s", "xrl %s, A", "xrl %s, #%s", "xrl A, #%s", "xrl A, %s", "xrl A, @R0", "xrl A, @R1", "xrl A, R0", "xrl A, R1", "xrl A, R2", "xrl A, R3", "xrl A, R4", "xrl A, R5", "xrl A, R6", "xrl A, R7", /* 7 */ "jnz %s", "acall %s", "orl C, %s", "jmp @A+dptr", "mov A, #%s", "mov %s, #%s", "mov @R0, #%s", "mov @R1, #%s", "mov R0, #%s", "mov R1, #%s", "mov R2, #%s", "mov R3, #%s", "mov R4, #%s", "mov R5, #%s", "mov R6, #%s", "mov R7, #%s", /* 8 */ "sjmp %s", "ajmp %s", "anl C, %s", "movc A, @A+PC", "div AB", "mov %s, %s", "mov %s, @R0", "mov %s, @R1", "mov %s, R0", "mov %s, R1", "mov %s, R2", "mov %s, R3", "mov %s, R4", "mov %s, R5", "mov %s, R6", "mov %s, R7", /* 9 */ "mov dptr, #0%X%02Xh", "acall %s", "mov %s, C", "movC A, @A+dptr", "subb A, #%s", "subb A, %s", "subb A, @R0", "subb A, @R1", "subb A, R0", "subb A, R1", "subb A, R2", "subb A, R3", "subb A, R4", "subb A, R5", "subb A, R6", "subb A, R7", /* A */ "orl C, /%s", "ajmp %s", "mov C, %s", "inc dptr", "mul AB", "", /* undefined opcode */ "mov @R0, %s", "mov @R1, %s", "mov R0, %s", "mov R1, %s", "mov R2, %s", "mov R3, %s", "mov R4, %s", "mov R5, %s", "mov R6, %s", "mov R7, %s", /* B */ "anl C, /%s", "acall %s", "cpl %s", "cpl C", "cjne A, #%s, %s", "cjne A, %s, %s", "cjne @R0, #%s, %s", "cjne @R1, #%s, %s", "cjne R0, #%s, %s", "cjne R1, #%s, %s", "cjne R2, #%s, %s", "cjne R3, #%s, %s", "cjne R4, #%s, %s", "cjne R5, #%s, %s", "cjne R6, #%s, %s", "cjne R7, #%s, %s", /* C */ "push %s", "ajmp %s", "clr %s", "clr C", "swap A", "xch A, %s", "xch A, @R0", "xch A, @R1", "xch A, R0", "xch A, R1", "xch A, R2", "xch A, R3", "xch A, R4", "xch A, R5", "xch A, R6", "xch A, R7", /* D */ "pop %s", "acall %s", "setb %s", "setb C", "da A", "djnz %s, %s", "xchd A, @R0", "xchd A, @R1", "djnz R0, %s", "djnz R1, %s", "djnz R2, %s", "djnz R3, %s", "djnz R4, %s", "djnz R5, %s", "djnz R6, %s", "djnz R7, %s", /* E */ "movx A, @dptr", "ajmp %s", "movx A, @R0", "movx A, @R1", "clr A", "mov A, %s", "mov A, @R0", "mov A, @R1", "mov A, R0", "mov A, R1", "mov A, R2", "mov A, R3", "mov A, R4", "mov A, R5", "mov A, R6", "mov A, R7", /* F */ "movx @dptr, A", "acall %s", "movx @R0, A", "movx @R1, A", "cpl A", "mov %s, A", "mov @R0, A", "mov @R1, A", "mov R0, A", "mov R1, A", "mov R2, A", "mov R3, A", "mov R4, A", "mov R5, A", "mov R6, A", "mov R7, A" }; /* op_format table * * 0 = illegal opcode * 1 = no operands * 2 = one immediate operand * 3 = one direct operand * 4 = one bit-addressed operand * 5 = one relative address operand * 6 = one absolute address operand * 7 = two-byte immediate operand * 8 = two operands: direct, immediate * 9 = two operands: direct, direct * 10 = two operands: immediate, relative address * 11 = two operands: direct, relative address * 12 = two operands: bit address, relative address * 13 = two-byte long address operand */ const char op_format[256] = { 1, 6, 13, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 0 */ 12, 6, 13, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 1 */ 12, 6, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 2 */ 12, 6, 1, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 3 */ 5, 6, 3, 8, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 4 */ 5, 6, 3, 8, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 5 */ 5, 6, 3, 8, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 6 */ 5, 6, 4, 1, 2, 8, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, /* 7 */ 5, 6, 4, 1, 1, 9, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* 8 */ 7, 6, 4, 1, 2, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 9 */ 4, 6, 4, 1, 1, 0, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, /* A */ 4, 6, 4, 1, 10, 11, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, /* B */ 3, 6, 4, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* C */ 3, 6, 4, 1, 1, 11, 1, 1, 5, 5, 5, 5, 5, 5, 5, 5, /* D */ 1, 6, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* E */ 1, 6, 1, 1, 1, 3, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 /* F */ }; const char sfbitname[128][6] = { /* 80 */ "P0.0", "P0.1", "P0.2", "P0.3", "P0.4", "P0.5", "P0.6", "P0.7", /* 88 */ "IT0", "IE0", "IT1", "IE1", "TR0", "TF0", "TR1", "TF1", /* 90 */ "P1.0", "P1.1", "P1.2", "P1.3", "P1.4", "P1.5", "P1.6", "P1.7", /* 98 */ "RI", "TI", "RB8", "TB8", "REN", "SM2", "SM1", "SM0", /* A0 */ "P2.0", "P2.1", "P2.2", "P2.3", "P2.4", "P2.5", "P2.6", "P2.7", /* A8 */ "EX0", "ET0", "EX1", "ET1", "ES", "0ADh", "0AEh", "EA", /* B0 */ "P3.0", "P3.1", "P3.2", "P3.3", "P3.4", "P3.5", "P3.6", "P3.7", /* B8 */ "PX0", "PT0", "PX1", "PT1", "PS", "0BDh", "0BEh", "0BFh", /* C0 */ "0C0h", "0C1h", "0C2h", "0C3h", "0C4h", "0C5h", "0C6h", "0C7h", /* C8 */ "0C8h", "0C9h", "0CAh", "0CBh", "0CCh", "0CDh", "0CEh", "0CFh", /* D0 */ "P", "0D1h", "OV", "RS0", "RS1", "F0", "AC", "CY", /* D8 */ "0D8h", "0D9h", "0DAh", "0DBh", "0DCh", "0DDh", "0DEh", "0DFh", /* E0 */ "ACC.0", "ACC.1", "ACC.2", "ACC.3", "ACC.4", "ACC.5", "ACC.6", "ACC.7", /* E8 */ "0E8h", "0E9h", "0EAh", "0EBh", "0ECh", "0EDh", "0EEh", "0EFh", /* F0 */ "B.0", "B.1", "B.2", "B.3", "B.4", "B.5", "B.6", "B.7", /* F8 */ "0F8h", "0F9h", "0FAh", "0FBh", "0FCh", "0FDh", "0FEh", "0FFh" }; const char sfrname[128][5] = { /* 80 */ "P0", "SP", "DPL", "DPH", "84h", "85h", "86h", "PCON", /* 88 */ "TCON", "TMOD", "TL0", "TL1", "TH0", "TH1", "8Eh", "8Fh", /* 90 */ "P1", "91h", "92h", "93h", "94h", "95h", "96h", "97h", /* 98 */ "SCON", "SBUF", "9Ah", "9Bh", "9Ch", "9Dh", "9Eh", "9Fh", /* A0 */ "P2", "0A1h", "0A2h", "0A3h", "0A4h", "0A5h", "0A6h", "0A7h", /* A8 */ "IE", "0A9h", "0AAh", "0ABh", "0ACh", "0ADh", "0AEh", "0AFh", /* B0 */ "P3", "0B1h", "0B2h", "0B3h", "0B4h", "0B5h", "0B6h", "0B7h", /* B8 */ "IP", "0B9h", "0BAh", "0BBh", "0BCh", "0BDh", "0BEh", "0BFh", /* C0 */ "0C0h", "0C1h", "0C2h", "0C3h", "0C4h", "0C5h", "0C6h", "0C7h", /* C8 */ "0C8h", "0C9h", "0CAh", "0CBh", "0CCh", "0CDh", "0CEh", "0CFh", /* D0 */ "PSW", "0D1h", "0D2h", "0D3h", "0D4h", "0D5h", "0D6h", "0D7h", /* D8 */ "0D8h", "0D9h", "0DAh", "0DBh", "0DCh", "0DDh", "0DEh", "0DFh", /* E0 */ "ACC", "0E1h", "0E2h", "0E3h", "0E4h", "0E5h", "0E6h", "0E7h", /* E8 */ "0E8h", "0E9h", "0EAh", "0EBh", "0ECh", "0EDh", "0EEh", "0EFh", /* F0 */ "B", "0F1h", "0F2h", "0F3h", "0F4h", "0F5h", "0F6h", "0F7h", /* F8 */ "0F8h", "0F9h", "0FAh", "0FBh", "0FCh", "0FDh", "0FEh", "0FFh" }; radare-1.5.2/src/arch/8051/global.h000066400000000000000000000021611141417717500164770ustar00rootroot00000000000000/* global.h * * Data shared by all modules * * Copyright 2001, 2002 by David Sullins * * This file is part of Dis51. * * Dis51 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, version 2 of the License. * * Dis51 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 * Dis51; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * You may contact the author at davesullins@earthlink.net. */ #ifndef _GLOBAL_H_ #define _GLOBAL_H_ #include "distypes.h" /* global data */ extern int Lst; extern unsigned short lbl[65536]; extern const char mnemonic[256][20]; extern const char op_format[256]; extern const char sfrname[128][5]; extern const char sfbitname[128][6]; #endif /* _GLOBAL_H_ */ radare-1.5.2/src/arch/8051/main.c000066400000000000000000000013471141417717500161630ustar00rootroot00000000000000#ifdef C_MAIN #include #include int main () { // unsigned char *bytes = "\x11\x22\x33\x44\x55\x66\x44\x89\x00"; unsigned char *bytes = "\x90\x90\x01\x10\x55\x66\x44\x89\x00"; int len = strlen(bytes); int optr, ptr = 0; char str[128]; int ilen, i; int next; int type; while ( ptr != -1 && ptr < len ) { optr = ptr; ptr = dis_inst1 (bytes, ptr, &type); if (ptr == -1) break; next = dis_inst2 (str, bytes, optr); ilen = next - optr; printf ("0x%04x %d (%c) ", optr, ilen, type); for(i = optr; i < optr+ilen; i++) { printf ("%02x", bytes[i]); } printf ("\t%s", str); if (ptr != (optr + ilen)) { printf(" ; branch to 0x%04x\n", ptr); } else printf("\n"); ptr = next; } } #endif radare-1.5.2/src/arch/8051/pass1.c000066400000000000000000000113031141417717500162570ustar00rootroot00000000000000/* pass1.c * * Functions for pass 1 of the disassembler. * * Copyright 2001 - 2003 by David Sullins * * This file is part of Dis51. * * Dis51 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, version 2 of the License. * * Dis51 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 * Dis51; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * You may contact the author at davesullins@earthlink.net. * * Integration with radare in 2009 by pancake <@nopcode.org> */ #include #include "distypes.h" #include "global.h" /* newlbl is used by longaddr, absaddr, and reladdr * Keep track of next available label */ //static unsigned short newlbl = 0; /* nextbyte: read a byte from memory * */ #define nextbyte() (nextbyte_f(mem, memPtr++)) static uchar nextbyte_f(unsigned char *mem, int memPtr) { //hf->flag[memPtr] |= CODE; return mem[memPtr]; } /* longaddr * */ static int longaddr(uchar op1, uchar op2) { int addr; /* calculate address */ addr = ((((int)op1)<<8) | op2); /* check if this address has already been labelled */ #if 0 if (lbl[addr] == 0) lbl[addr] = ++newlbl; #endif return addr; } /* absaddr * */ static int absaddr(uchar opcode, uchar operand, int memPtr) { int addr; /* calculate address */ addr = ((memPtr & 0xf800) | (((int)opcode & 0xe0)<<3) | operand); /* check if this address has already been labelled */ #if 0 if (lbl[addr] == 0) lbl[addr] = ++newlbl; #endif return addr; } /* reladdr * */ static int reladdr(uchar operand, int memPtr) { int addr; /* calculate address */ addr = memPtr + (signed char)operand; #if 0 /* check if this address has already been labelled */ if (lbl[addr] == 0) lbl[addr] = ++newlbl; #endif return addr; } /* dis_inst: Disassemble one instruction (pass 1) * * Also increments memPtr to point to the next instruction address. * * Return -1 on error. * Otherwise, return opcode byte. * * CAVEAT: Indirect jumps not handled (JMP @A+DPTR) */ int dis51_inst1(unsigned char *mem, int memPtr, int *type) { uchar opcode; uchar op1, op2; int newaddr = -1; *type = ' '; opcode = nextbyte(); switch(op_format[opcode]) { case 0: /* A5 is an illegal opcode */ fprintf(stderr, "Illegal opcode A5 at address %04X\n", memPtr-1); newaddr = -1; break; case 1: /* no operands */ newaddr = memPtr; /* if this is a return, stop disassembly */ if ((opcode & 0xef) == 0x22) newaddr = -1; /* we don't handle indirect jumps */ else if (opcode == 0x73) newaddr = -1; break; case 2: case 3: case 4: /* one operand */ nextbyte(); newaddr = memPtr; break; case 5: /* one operand, relative address */ op1 = nextbyte(); /* relative addr calculation */ newaddr = reladdr(op1, memPtr); /* if this is a branch, continue disassembly */ if (opcode != 0x80) { *type = 'b'; //printf("--> branch\n"); } break; case 6: /* one operand, absolute address */ op1 = nextbyte(); /* absolute addr calculation */ newaddr = absaddr(opcode, op1, memPtr); /* if this is a call, continue disassembly */ if (opcode & 0x10) { *type = 'c'; //printf("--> call\n"); } break; case 7: case 8: case 9: /* two operands */ nextbyte(); nextbyte(); newaddr = memPtr; break; case 10: case 11: case 12: /* two operands, relative address */ nextbyte(); op2 = nextbyte(); /* relative addr calculation */ newaddr = reladdr(op2, memPtr); /* this is always a branch instruction */ *type = 'j'; //printf (" --> jmp\n"); break; case 13: /* long address */ op1 = nextbyte(); op2 = nextbyte(); /* long addr calculation */ newaddr = longaddr(op1, op2); /* if this is a call, continue disassembly */ if (opcode == 0x12) { *type = 'c'; // printf (" --> call\n"); } break; default: /* error in op_format table */ fprintf(stderr, "Invalid opcode format, error in format table\n"); newaddr = -1; break; } return newaddr; } #if 0 /* pass1: Disassemble instructions starting at given entry point (pass 1) * */ void pass1(struct hexfile *hf, int addr) { while ((addr != -1) && (hf->flag[addr] == 0)) /* no error, we haven't been here before, and non-empty */ /* disassemble next instruction */ addr = dis_inst1(hf, addr); } #endif radare-1.5.2/src/arch/8051/pass2.c000066400000000000000000000160371141417717500162710ustar00rootroot00000000000000/* pass2.c * * Functions for pass 2 of the disassembler. * * Copyright 2001 - 2003 by David Sullins * * This file is part of Dis51. * * Dis51 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, version 2 of the License. * * Dis51 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 * Dis51; if not, write to the Free Software Foundation, Inc., 59 Temple * Place, Suite 330, Boston, MA 02111-1307 USA * * You may contact the author at davesullins@earthlink.net. */ #include #include #include #include "distypes.h" #include "global.h" /* nextbyte: read a byte from memory * */ #define nextbyte() (mem[addr++]) /* longaddr * */ static int longaddr(uchar op1, uchar op2, char *label) { int addr; /* calculate address */ addr = ((((int)op1)<<8) | op2); /* form label string */ sprintf(label, "0x%04x", addr); return addr; //lbl[addr]; } /* absaddr * */ static int absaddr(uchar opcode, uchar operand, int memPtr, char *label) { int addr; /* calculate address */ addr = ((memPtr & 0xf800) | (((int)opcode & 0xe0)<<3) | operand); /* form label string */ sprintf(label, "0x%04x", addr); return addr;//lbl[addr]; } /* reladdr * */ static int reladdr(uchar operand, int memPtr, char *label) { int addr; /* calculate address */ addr = memPtr + (signed char)operand; /* form label string */ sprintf(label, "0x%04x", addr); return addr; //lbl[addr]; } /* printhex * * Pretty format a hexadecimal number in a string. */ static void printhex(uchar num, char *name) { if ((num >= 0xa0) || ((num <= 0xf) && (num >= 0xa))) snprintf(name, 5, "0%Xh", num); else snprintf(name, 5, "%Xh", num); } /* sfrdecode * * Convert a direct memory value to a SFR name if appropriate. * Otherwise output the formatted number. */ static void sfrdecode(uchar sfr, char *name) { if (sfr & 0x80) strncpy(name, sfrname[sfr&0x7f], 5); else printhex(sfr, name); } /* sfbitdecode * * Convert a bit memory value to a SF bit name if appropriate. * Otherwise output the formatted number. */ static void sfbitdecode(uchar sfbit, char *name) { if (sfbit & 0x80) strncpy(name, sfbitname[sfbit&0x7f], 6); else printhex(sfbit, name); } /* _listhex, listhex * * Output list-format address and data for the -l command line switch. * * Contributed by Peter Peres. */ #if 0 #define listhex(len,addr,ofile) { if(Lst) _listhex(ofile,mem,addr,len); } static void _listhex(char *file, const unsigned char *mem, int addr, int len) { sprintf( file, " %04X %02X", addr-len, mem[addr-len] ); switch(len) { case 3: sprintf( file, "%02X", mem[addr-2] ); case 2: sprintf( file, "%02X", mem[addr-1] ); if(len == 2) sprintf( file, " "); break; default: sprintf( file, " "); } } #endif /* dis_inst2: Disassemble one instruction to ofile * * Returns address immediately after instruction. */ int dis51_inst2(char *ofile, unsigned char *mem, int addr) { uchar opcode; uchar op1, op2; char label[16]; char name[6]; char name2[5]; int bytes = 1; /* Fetch opcode */ opcode = nextbyte(); /* Fetch second and third byte, if appropriate */ if (op_format[opcode] > 1) { op1 = nextbyte(); bytes = 2; } if (op_format[opcode] > 6) { op2 = nextbyte(); bytes = 3; } /* Output decoded instruction */ #if 0 if(!Lst) sprintf(ofile, ""); else listhex(bytes, addr, ofile); #endif switch(op_format[opcode]) { case 0: /* A5 is an illegal opcode */ sprintf(ofile, "DB 85h ; illegal opcode"); case 1: /* no operands */ sprintf(ofile, mnemonic[opcode]); break; case 2: /* one immediate operand */ printhex(op1, name); sprintf(ofile, mnemonic[opcode], name); break; case 3: /* one direct operand */ sfrdecode(op1, name); sprintf(ofile, mnemonic[opcode], name); break; case 4: /* one bit-addressed operand */ sfbitdecode(op1, name); sprintf(ofile, mnemonic[opcode], name); break; case 5: /* one operand, relative address */ /* relative addr calculation */ reladdr(op1, addr, label); sprintf(ofile, mnemonic[opcode], label); break; case 6: /* one operand, absolute address */ /* absolute addr calculation */ absaddr(opcode, op1, addr, label); sprintf(ofile, mnemonic[opcode], label); break; case 7: /* two-byte immediate operand */ /* MOV DPTR, #immediate16 */ sprintf(ofile, mnemonic[opcode], op1, op2); break; case 8: /* two operands: direct, immediate */ sfrdecode(op1, name); printhex(op2, name2); sprintf(ofile, mnemonic[opcode], name, name2); break; case 9: /* two operands: direct, direct */ /* (operands in reverse order) */ sfrdecode(op1, name); sfrdecode(op2, name2); sprintf(ofile, mnemonic[opcode], name2, name); break; case 10: /* two operands: immediate, relative */ printhex(op1, name); reladdr(op2, addr, label); sprintf(ofile, mnemonic[opcode], name, label); break; case 11: /* two operands: direct, relative */ sfrdecode(op1, name); reladdr(op2, addr, label); sprintf(ofile, mnemonic[opcode], name, label); break; case 12: /* two operands: bit, relative */ sfbitdecode(op1, name); reladdr(op2, addr, label); sprintf(ofile, mnemonic[opcode], name, label); break; case 13: /* long address */ /* long addr calculation */ longaddr(op1, op2, label); sprintf(ofile, mnemonic[opcode], label); break; default: /* error in op_format table */ sprintf(ofile, "DB 0%Xh ; error in op_format table", opcode); } return addr; } /* pass2: Disassemble memory to given output file (pass 2) * */ void pass2(char *ofile, unsigned char *mem) { int addr = 0; uchar empty = 1; /* 1 for no code/data, 0 for code or data */ while (addr < 65536) { #if 0 /* Step 1: check if memory is empty */ if ((hf->flag[addr] != EMPTY) && (empty)) /* We've changed from empty to non-empty, * so start a new segment. */ sprintf(ofile, "CSEG AT %04Xh\n", addr); else if (hf->flag[addr] == EMPTY) { /* no code or data here */ ++addr; empty = 1; continue; } #endif empty = 0; /* Step 2: Output a label if one exists */ #if 0 if (lbl[addr]) sprintf(ofile, "L%04d:\n", lbl[addr]); #endif /* Step 3: Output code or data as appropriate */ // if (hf->flag[addr]&CODE) /* code here, so disassemble next instruction */ addr = dis51_inst2(ofile, mem, addr); #if 0 else { /* data here */ if(!Lst) sprintf(ofile, "\tDB 0%Xh\n", hf->mem[addr]); else { listhex(1, addr+1, ofile); if(isprint(hf->mem[addr])) sprintf(ofile, "DB 0%02Xh ; '%c'\n", hf->mem[addr], hf->mem[addr]); else sprintf(ofile, "DB 0%02Xh \n", hf->mem[addr]); } ++addr; } #endif } // sprintf(ofile, "END\n"); } radare-1.5.2/src/arch/arm/000077500000000000000000000000001141417717500152505ustar00rootroot00000000000000radare-1.5.2/src/arch/arm/aasm/000077500000000000000000000000001141417717500161715ustar00rootroot00000000000000radare-1.5.2/src/arch/arm/aasm/Makefile000066400000000000000000000004461141417717500176350ustar00rootroot00000000000000include ../../../../config.mk CFLAGS+=-DSHAREDIR=\"${DATADIR}\" AOBJ=aasm.o utils.o elf.o ifeq ($(DARWIN),1) CFLAGS+=-fnested-functions endif .SUFFIXES: .c .o .c.o: -$(CC) -c $(CFLAGS) -o $@ $< all: armasm armasm: ${AOBJ} armasm: -${CC} ${AOBJ} -o armasm clean: -rm -f ${AOBJ} armasm radare-1.5.2/src/arch/arm/aasm/README000066400000000000000000000002211141417717500170440ustar00rootroot00000000000000This code is from: http://intranet.cs.man.ac.uk/Study_subweb/Ugrad/coursenotes/komodo/assembler/ Thanks for this great piece of software! :D radare-1.5.2/src/arch/arm/aasm/aasm.c000066400000000000000000005657431141417717500173020ustar00rootroot00000000000000/* AASM - ARM assembler Alpha+ version J. Garside UofM 26/7/07 */ /* - adapted into radare by pancake */ /* LICENSE: GPL */ // To do @@@@@@@@ // Symbol table lists // Can't do ORG top - (end - start) ... difficult (!!), but should be possible // Would require `virtual' assembler pointer or label values // Some ELF work May 2004 - output file accepted by ARM's "fromelf" and komodo // Thumb shift problem fixed Apr.'07 // 10/01/07 Fix of LDRH post index; fix of literal recogniser // PUSH/POP added to ARM May '07 (Introduced bug removed June '07) // Reorigining in ELF/DEFS bug found & fixed June '07. // Data records added 9/7/07 // Oops! LDR= `brain fart' fixed 26/7/07 // To do: ADRL fixed, "MOVX" etc added - some more shakedown tests (?) @@ // Pack literal pool (halfwords) together rather than `in order' // Dump literals into space in ALIGN where possible // Not sure LDRSH rd, =nnnn behaviour is correct // No range check but doesn't alias -1 & FFFF either // I think range check; ST thinks ban it // LDMFDEQ as well as LDMEQFD etc. etc. etc. // Proper shakedown testing (improving) // Macros // Conditional assembly // "mnemonics" file not found if executed via $PATH; improve search // 'record'/'structure' directive for creating offsets #include #include /* For {strcat, strlen, strcpy} */ #include /* For {malloc, exit} */ #include "aasm.h" /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int SYM_RECORD_SIZE = sizeof(sym_record); int SYM_TABLE_SIZE = sizeof(sym_table); int SYM_TABLE_ITEM_SIZE = sizeof(sym_table_item); int LIT_RECORD_SIZE = sizeof(literal_record); int LOCAL_LABEL_SIZE = sizeof(local_label); int ELF_TEMP_SIZE = sizeof(elf_temp); int ELF_INFO_SIZE = sizeof(elf_info); int SIZE_RECORD_SIZE = sizeof(size_record); /*----------------------------------------------------------------------------*/ /* Global variables */ instr_set instruction_set; /* ARM or Thumb */ char *input_file_name; char *symbols_file_name; char *list_file_name; char *hex_file_name; char *elf_file_name; char *hexpairs_file_name; FILE *fList, *fHex, *fElf; int symbols_stdout, list_stdout, hex_stdout, hexpairs_stdout, elf_stdout; /* Booleans */ label_sort symbols_order; int list_sym, list_kmd; unsigned int sym_print_extras; /* <0> set for locals, <1> for literals */ unsigned int arm_variant; unsigned int assembly_pointer; /* Address at which to plant instruction */ unsigned int def_increment; /* Offset reached from assembly_pointer */ boolean assembly_pointer_defined; unsigned int entry_address; boolean entry_address_defined; unsigned int data_pointer; /* Used for creating record offsets etc. */ unsigned int undefined_count; /* Number of references to undefined variables */ unsigned int defined_count; /* Number of variables defined this pass */ unsigned int redefined_count; /* Number of variables redefined this pass */ unsigned int pass_count; /* Pass number, starts at 0 */ unsigned int pass_errors; /* Errors occurred in this pass */ boolean div_zero_this_pass; /* Indicates /0 in pass, prevents code dump */ boolean dump_code; /* Allow output (FALSE on last pass if error) */ own_label *evaluate_own_label; /* Yuk! @@@@@ */ /* Because evaluate needs to know if there is a local label on -current- line */ literal_record *literal_list; /* Start of the list of literals from "LDR =" */ literal_record *literal_head; /* The next literal record `expected' */ literal_record *literal_tail; /* The last literal record `dumped' */ local_label *loc_lab_list; /* Start of the list of local labels */ local_label *loc_lab_position; /* The current local label position */ size_record *size_record_list; /* Start of list of ADRL (etc.) lengths */ size_record *size_record_current; /* Current record in above list */ unsigned int size_changed_count; /* Number of `instruction' size changes */ boolean if_stack[IF_STACK_SIZE + 1]; /* Used for nesting IF clauses */ int if_SP; unsigned int list_address; unsigned int list_byte; unsigned int list_line_position; /* Pos. in the src line copied to output */ char list_buffer[LIST_LINE_LENGTH]; unsigned int hex_address; boolean hex_address_defined; char hex_buffer[HEX_LINE_LENGTH]; int elf_section_valid; /* Flag: true if code dumped in elf_section */ unsigned int elf_section; /* Current elf section number (for labels) */ unsigned int elf_section_old; boolean elf_new_block; elf_temp *elf_record_list; elf_temp *current_elf_record; sym_table *variable_table; /* Assemble-time variables */ sym_table *arch_table; /* Table of possible processor architectures */ sym_table *operator_table; sym_table *register_table; sym_table *cregister_table; sym_table *copro_table; sym_table *shift_table; /*----------------------------------------------------------------------------*/ /* Entry point */ int main(int argc, char *argv[]) { FILE *fMnemonics, *fSource = NULL; char line[LINE_LENGTH]; sym_table *arm_mnemonic_table, *thumb_mnemonic_table, *directive_table; sym_table *symbol_table; sym_table_item *arm_mnemonic_list, *thumb_mnemonic_list; /* Real lists */ boolean finished, last_pass; unsigned int error_code; void code_pass(FILE *fHandle, char *filename)/* Recursion for INCLUDE files */ { unsigned int line_number; char *include_file_path; /* Path as far as directory of "filename" */ char *include_name; FILE *incl_handle; include_file_path = file_path(filename); /* Path to directory in use */ line_number = 1; while (!feof(fHandle)) { include_name = NULL; /* Don't normally return anything */ input_line(fHandle, line, LINE_LENGTH); /* Errors ignored @@@ */ if (instruction_set == THUMB) error_code = parse_source_line(line, thumb_mnemonic_list, symbol_table, pass_count, last_pass, &include_name); else error_code = parse_source_line(line, arm_mnemonic_list, symbol_table, pass_count, last_pass, &include_name); /* printf("Hello Y %08X %s\n", symbol_table->pList[0], line); */ if (error_code != eval_okay) print_error(line, line_number, error_code, filename, last_pass); else if (include_name != NULL) { char *pInclude; if (include_name[0] == '/') pInclude = include_name; /* Absolute */ else /* Relative path - create new string */ pInclude = pathname(include_file_path, include_name); /* Add path */ if ((incl_handle = fopen(pInclude, "r")) == NULL) { print_error(line, line_number, SYM_NO_INCLUDE, filename, last_pass); fprintf(stderr, "Can't open \"%s\"\n", include_name); finished = TRUE; } else { code_pass(incl_handle, pInclude); fclose(incl_handle); /* Doesn't leave file locked @@@ */ } if (pInclude != include_name) free(pInclude); /* If allocated (yuk) */ free(include_name); } line_number++; /* Local to file */ } free(include_file_path); return; } /* Create and initialise a symbol table */ sym_table *build_table(char *table_name, unsigned int flags, char **sym_names, int *values) { sym_table *table; int i; sym_record *dummy; /* Don't want returned pointer */ table = sym_create_table(table_name, flags); for (i = 0; *(sym_names[i]) != '\0'; i++) /* repeat until "" found */ sym_define_label(sym_names[i], values[i], 0, table, &dummy); return table; } arm_mnemonic_list = NULL; thumb_mnemonic_list = NULL; symbols_file_name = ""; /* Defaults */ list_file_name = ""; hex_file_name = ""; elf_file_name = ""; hexpairs_file_name= ""; symbols_stdout = FALSE; list_stdout = FALSE; hex_stdout = FALSE; elf_stdout = FALSE; hexpairs_stdout = FALSE; /* Parse command line and set options accordingly */ if (set_options(argc, argv)) { /* We have a source file name, at least! */ char full_name[200]; // Size? @@ /* Initialise a table for programmer's control variables */ variable_table = sym_create_table("User's variables", 0); /* Set up tables of operators, etc. */ { /* Architecture names */ char *arch_name[] = { "v3", "v3m", "v4", "v4xm", "v4t", "v4txm", "v5", "v5xm", "v5t", "v5txm", "v5te","v5texp", "all", "any", "" }; int arch_value[] = { v3, v3M, v4, v4xM, v4T, v4TxM, v5, v5xM, v5T, v5TxM, v5TE, v5TExP, 0, 0, -1 }; arch_table = build_table("Architectures", SYM_TAB_CASE_FLAG, arch_name, arch_value); } { /* Diadic expression operator definitions */ char *op_name[] = { "and", "or", "xor", "eor", "shl", "lsl", "shr", "lsr", "div", "mod", "" }; int op_value[] = { AND, OR, XOR, XOR, LEFT_SHIFT, LEFT_SHIFT, RIGHT_SHIFT, RIGHT_SHIFT, DIVIDE, MODULUS, -1 }; operator_table = build_table("Operators", SYM_TAB_CASE_FLAG, op_name, op_value); } { /* Register name definitions */ char *reg_name[] = {"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15", "sp", "lr", "pc", "a1", "a2", "a3", "a4", "v1", "v2", "v3", "v4", "v5", "sb", "v6", "sl", "v7", "fp", "ip", "" }; int reg_value[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 9, 10, 10, 11, 12, -1 }; register_table = build_table("Registers", SYM_TAB_CASE_FLAG, reg_name, reg_value); } { /* Coprocessor register name definitions */ char *creg_name[] = {"cr0", "cr1", "cr2", "cr3", "cr4", "cr5", "cr6", "cr7", "cr8", "cr9","cr10","cr11","cr12","cr13","cr14","cr15", "c0", "c1", "c2", "c3", "c4", "c5", "c6", "c7", "c8", "c9", "c10", "c11", "c12", "c13", "c14", "c15",""}; int creg_value[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1}; cregister_table = build_table("Copro_Registers", SYM_TAB_CASE_FLAG, creg_name, creg_value); } { /* Coprocessor name definitions */ char *copro_name[] = {"p0", "p1", "p2", "p3", "p4", "p5", "p6", "p7", "p8", "p9", "p10", "p11", "p12", "p13", "p14", "p15", "cp0", "cp1", "cp2", "cp3", "cp4", "cp5", "cp6", "cp7", "cp8", "cp9","cp10","cp11","cp12","cp13","cp14","cp15", "" }; int copro_value[] = { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, -1 }; copro_table = build_table("Coprocessors", SYM_TAB_CASE_FLAG, copro_name, copro_value); } { /* Shift definitions */ char *shift_name[] = {"lsl", "asl", "lsr", "asr", "ror", "rrx", ""}; int shift_value[] = { 0, 0, 1, 2, 3, 7, -1}; shift_table = build_table("Shifts",SYM_TAB_CASE_FLAG,shift_name,shift_value); } arm_mnemonic_table = sym_create_table("ARM Mnemonics", SYM_TAB_CASE_FLAG); thumb_mnemonic_table = sym_create_table("Thumb Mnemonics", SYM_TAB_CASE_FLAG); directive_table = sym_create_table("Directives", SYM_TAB_CASE_FLAG); /* Following is crude hack for test/commissioning purposes. @@@@@ */ #ifdef SHAREDIR strcpy(full_name, SHAREDIR"/radare/mnemonics"); #else realpath(argv[0], full_name); // full path to binary (?) @@ for (pChar = full_name; *pChar != '\0'; pChar++); // find end of string @@ while (*pChar != '/') pChar--; // Cut off last element pChar[1] = '\0'; // Terminate strcat(full_name, "mnemonics"); // Then append filename #endif if ((fMnemonics = fopen(full_name, "r")) == NULL) /* Read mnemonics */ fprintf(stderr, "Can't open %s\n", "mnemonics"); else { while (!feof(fMnemonics)) { input_line(fMnemonics, line, LINE_LENGTH); /* Errors ignored @@@ */ if (!parse_mnemonic_line(line, arm_mnemonic_table, thumb_mnemonic_table, directive_table)) fprintf(stderr, "Mnemonic file error\n %s\n", &line[0]); } /* no error checks @@@ */ fclose(fMnemonics); { /* Make up mnemonic table lists */ sym_table_item *pMnem, *pDir; pMnem = (sym_table_item*) malloc(SYM_TABLE_ITEM_SIZE); /* ARM defns. */ pDir = (sym_table_item*) malloc(SYM_TABLE_ITEM_SIZE); /* (hand built) */ pMnem->pTable = arm_mnemonic_table; pMnem->pNext = pDir; pDir->pTable = directive_table; pDir->pNext = NULL; arm_mnemonic_list = pMnem; pMnem = (sym_table_item*) malloc(SYM_TABLE_ITEM_SIZE); /* Thumb defns. */ pDir = (sym_table_item*) malloc(SYM_TABLE_ITEM_SIZE); /* (hand built) */ pMnem->pTable = thumb_mnemonic_table; pMnem->pNext = pDir; pDir->pTable = directive_table; pDir->pNext = NULL; thumb_mnemonic_list = pMnem; } symbol_table = sym_create_table("Labels", 0);/* Labels are case sensitive */ literal_list = NULL; loc_lab_list = NULL; size_record_list = NULL; pass_count = 0; finished = FALSE; last_pass = FALSE; dump_code = FALSE; fHex = open_output_file( hex_stdout, hex_file_name); /* Open required */ fList = open_output_file(list_stdout, list_file_name); /* output files */ fElf = open_output_file( elf_stdout, elf_file_name); if ((fList != NULL) && list_kmd) fprintf(fList, "KMD\n"); /* KMD marker */ if ((fSource = fopen(input_file_name, "r")) == NULL) /* Read file in */ { fprintf(stderr,"Can't open %s\n", input_file_name); finished = TRUE; } else finished = FALSE; while (!finished) { instruction_set = ARM; /* Default */ assembly_pointer = 0; /* Default */ data_pointer = 0; entry_address = 0; assembly_pointer_defined = TRUE; /* ??? @@@@ Okay for us! */ entry_address_defined = FALSE; arm_variant = 0; /* Default to any ARM architecture */ pass_errors = 0; div_zero_this_pass = FALSE; hex_address_defined = FALSE; elf_new_block = TRUE; undefined_count = 0; /* Reads of undefined variables on this pass */ defined_count = 0; /* Labels newly defined on this pass */ redefined_count = 0; /* Labels with values changed on this pass */ if_SP = 0; if_stack[0] = TRUE; elf_section_valid = FALSE; /* No bytes dumped yet */ elf_section = 1; literal_head = NULL; literal_tail = NULL; loc_lab_position = NULL; size_record_current = size_record_list; /* Go to front of list */ size_changed_count = 0; //@@ //if (last_pass) sym_print_table(variable_table, ALL, ALPHABETIC, TRUE, ""); //@@ rewind(fSource); /* Ensure at start of file */ code_pass(fSource, input_file_name); /* no error checks @@@ */ if (literal_tail != literal_head) /* Clear the literal pool */ { char *literals = "Remaining literals"; if (fList != NULL) list_start_line(assembly_pointer, FALSE); literal_dump(last_pass, literals, 0); /* Much like an instruction */ if (fList != NULL) list_end_line(literals); } hex_dump_flush(); /* Ensure buffer is cleared */ // printf("Pass %2d complete. ", pass_count); // printf("Label changes: defined %3d; ", defined_count); // printf("values changed %3d; ", redefined_count); // printf("read while undefined %3d;\n", undefined_count); //printf("\n"); //printf("Pass %2d complete: %d sizes changed.\n", pass_count, size_changed_count); pass_count++; if (pass_errors != 0) { finished = TRUE; printf("Pass %2d: terminating due to %d error", pass_count - 1, pass_errors); if (pass_errors == 1) printf("\n"); else printf("s\n"); } else { if (last_pass || (pass_count > MAX_PASSES)) finished = TRUE; else if ((defined_count==0)&&(redefined_count==0)&&(undefined_count==0)) { last_pass = TRUE; /* One more time ... */ dump_code = !div_zero_this_pass; /* If error don't plant code */ } } if (if_SP != 0) { printf("Pass completed with IF clause still open; terminating\n"); finished = TRUE; } } /* End of WHILE */ if (fSource != NULL) fclose(fSource); if ((fList != NULL) && list_sym) list_symbols(fList, symbol_table); /* Symbols into list file */ close_output_file(fList, list_file_name, pass_errors != 0); close_output_file(fHex, hex_file_name, pass_errors != 0); if (fElf != NULL) elf_dump_out(fElf, symbol_table); /* Organise & o/p ELF */ if (pass_count > MAX_PASSES) { printf("Can't do it ... fed up!\n\n"); printf("Undefined labels:\n"); sym_print_table(symbol_table, UNDEFINED, ALPHABETIC, TRUE, ""); } else { if (symbols_stdout || (symbols_file_name[0] != '\0')) { sym_print_table(symbol_table, ALL, symbols_order, symbols_stdout, symbols_file_name); if (!symbols_stdout) printf("Symbols in file: %s\n", symbols_file_name); } if (pass_errors == 0) { if (list_file_name[0]!='\0') printf("List file in: %s\n",list_file_name); if (hex_file_name[0] !='\0') printf("Hex dump in: %s\n", hex_file_name); if (elf_file_name[0] !='\0') printf("ELF file in: %s\n", elf_file_name); } else printf("No output generated.\n"); /* Errors => trash output files */ #if 0 if (pass_count == 1) printf("\n1 pass performed.\n"); else printf("\nComplete. %d passes performed.\n", pass_count); #endif } { /* Free local label list */ local_label *pTemp; while ((pTemp = loc_lab_list) != NULL) /* Syntactically grubby! */ { loc_lab_list = loc_lab_list->pNext; free(pTemp); } } { /* Free literal list */ literal_record *pTemp; while ((pTemp = literal_list) != NULL) /* Syntactically grubby! */ { literal_list = literal_list->pNext; free(pTemp); } } { /* Free size list */ size_record *pTemp; while ((pTemp = size_record_list) != NULL) /* Syntactically grubby! */ { size_record_list = size_record_list->pNext; /* Cut out first record */ free(pTemp); /* and delete it */ } } { /* Clear away lists of symbol tables */ sym_table_item *p1, *p2; p1 = arm_mnemonic_list; while (p1 != NULL) { p2 = p1; p1 = p1->pNext; free(p2); } p1 = thumb_mnemonic_list; while (p1 != NULL) { p2 = p1; p1 = p1->pNext; free(p2); } } sym_delete_table( symbol_table, FALSE); sym_delete_table( directive_table, FALSE); sym_delete_table( arm_mnemonic_table, FALSE); sym_delete_table(thumb_mnemonic_table, FALSE); sym_delete_table( variable_table, FALSE); sym_delete_table( arch_table, FALSE); sym_delete_table( operator_table, FALSE); sym_delete_table( register_table, FALSE); sym_delete_table( cregister_table, FALSE); sym_delete_table( copro_table, FALSE); sym_delete_table( shift_table, FALSE); } } else printf("No input file specified\n"); exit(0); } /*----------------------------------------------------------------------------*/ /* // Allow omission of spaces? @@@@ // Allow filename first ? @@@@*/ boolean set_options(int argc, char *argv[]) { boolean okay = FALSE; char c; void file_option(int *std_out, char **filename, char *err_mss) { if (argc > 2) { if ((argv[1])[0] == '-') *std_out = TRUE; else { *filename = &(*argv[1]); argc --; argv++; } } else printf("%s filename omitted\n", err_mss); return; } if (argc == 1) { printf("ARM assembler v0.26 (9/7/07)\n" "Usage: %s filename\n" "Options: -e specify ELF output file\n", argv[0]); printf(" -x dump output to stdout as hexpairs\n"); printf(" -h specify hex dump file\n"); printf(" -l specify list file\n"); printf(" -ls appends symbol table\n"); printf(" -lk produces a KMD file\n"); printf(" -s specify symbol table file\n"); printf(" -sd gives symbols in order of definition\n"); printf(" -sv gives symbols sorted by value\n"); printf(" -sl includes local labels\n"); printf(" -sp includes automatically generated literals\n"); printf("Omitting a filename (or using '-') directs to stdout\n"); } else { argv++; /* Next pointer */ while ((argc > 1) && ((*argv)[0] == '-')) { c = (*argv)[1]; switch (c) { case '\0': break; /* Can be used as a non-filename */ case 'x': case 'X': file_option(&hexpairs_stdout, &hexpairs_file_name, "hexpairs dump"); break; case 'E': case 'e': file_option(&elf_stdout, &elf_file_name, "Elf file"); break; case 'H': case 'h': file_option(&hex_stdout, &hex_file_name, "Hex dump"); break; case 'L': case 'l': list_sym = ((((*argv)[2]&0xDF) == 'S') || (((*argv)[2]&0xDF) == 'K')); /* 'S' or 'K' dumps symbols too */ list_kmd = (((*argv)[2] & 0xDF) == 'K'); /* K inserts "KMD" header */ file_option(&list_stdout, &list_file_name, "List"); break; case 'S': case 's': { int pos; pos = 2; switch ((*argv)[pos]) { case 'v': case 'V': symbols_order = VALUE; pos++; break; case 'd': case 'D': symbols_order = DEFINITION; pos++; break; default: symbols_order = ALPHABETIC; break; } while ((*argv)[pos] != '\0') { if (((*argv)[pos]=='l') || ((*argv)[pos]=='L')) sym_print_extras |= 1; if (((*argv)[pos]=='p') || ((*argv)[pos]=='P')) sym_print_extras |= 2; pos++; } file_option(&symbols_stdout, &symbols_file_name, "Symbol"); } break; default: printf("Unknown option %c\n", c); break; } argc--; /* Remove parameter from count */ argv++; /* Next pointer */ } if (argc > 1) { input_file_name = *argv; //printf("Input file: %s\n", input_file_name); okay = TRUE; } } return okay; } /*----------------------------------------------------------------------------*/ void print_error(char *line, unsigned int line_no, unsigned int error_code, char *filename, int last_pass) { unsigned int position; int i; if ((error_code & WARNING_ONLY) != 0) { if (!last_pass) return; /* Barf! */ else printf("Warning: "); } else pass_errors++; /* Don't tally warnings */ /* The position on the line is in the bottom 8 bits; 0 indicates undefined. */ position = error_code & 0x000000FF; switch (error_code & 0xFFFFFF00) { case SYM_ERR_SYNTAX: printf("Syntax error"); break; case SYM_ERR_NO_MNEM: printf("Mnemonic not found"); break; case SYM_ERR_NO_EQU: printf("Label missing"); break; case SYM_BAD_REG: printf("Bad register"); break; case SYM_BAD_REG_COMB: printf("Illegal register combination"); break; case SYM_NO_REGLIST: printf("Register list required"); break; case SYM_NO_RSQUIGGLE: printf("Missing '}'"); break; case SYM_OORANGE: printf("Value out of range"); break; case SYM_ENDLESS_STRING: printf("String unterminated"); break; case SYM_DEF_TWICE: printf("Label redefined"); break; case SYM_NO_COMMA: printf("',' expected"); break; case SYM_GARBAGE: printf("Garbage"); break; case SYM_ERR_NO_EXPORT: printf("Exported label not defined"); break; case SYM_INCONSISTENT: printf("Label redefined inconsistently"); break; case SYM_ERR_NO_FILENAME: printf("Filename missing"); break; case SYM_NO_LBR: printf("'[' expected"); break; case SYM_NO_RBR: printf("']' expected"); break; case SYM_ADDR_MODE_ERR: printf("Error in addressing mode"); break; case SYM_ADDR_MODE_BAD: printf("Illegal addressing mode"); break; case SYM_NO_LSQUIGGLE: printf("'{' expected"); break; case SYM_OFFSET_TOO_BIG: printf("Offset out of range"); break; case SYM_BAD_COPRO: printf("Coprocessor specifier expected"); break; case SYM_BAD_VARIANT: printf("Instruction not available"); break; case SYM_NO_COND: printf("Conditional execution forbidden"); break; case SYM_BAD_CP_OP: printf("Bad coprocessor operation"); break; case SYM_NO_LABELS: printf("No labels! Position uncertain"); break; case SYM_DOUBLE_ENTRY: printf("Entry already defined"); break; case SYM_NO_INCLUDE: printf("Include file missing"); break; case SYM_NO_BANG: printf("'!' expected"); break; case SYM_MISALIGNED: printf("Offset misaligned"); break; case SYM_OORANGE_BRANCH: printf("Branch out of range"); break; case SYM_UNALIGNED_BRANCH: printf("Branch to misaligned target"); break; case SYM_VAR_INCONSISTENT: printf("Variable redefined inconsistently"); break; case SYM_NO_IDENTIFIER: printf("Identifier expected"); break; case SYM_MANY_IFS: printf("Too many nested IFs"); break; case SYM_MANY_FIS: printf("ENDIF without an IF"); break; case SYM_LOST_ELSE: printf("Floating ELSE"); break; case SYM_NO_HASH: printf("'#' expected"); break; case eval_no_operand: printf("Operand expected"); break; case eval_no_operator: printf("Operator expected"); break; case eval_not_closebr: printf("Missing ')'"); break; case eval_not_openbr: printf("Extra ')'"); break; case eval_mathstack_limit: printf("Math stack overflow"); break; case eval_no_label: printf("Label not found"); break; case eval_label_undef: printf("Label undefined"); break; case eval_out_of_radix: printf("Number out of radix"); break; case eval_div_by_zero: printf("Division by zero"); break; case eval_operand_error: printf("Operand error"); break; case eval_bad_loc_lab: printf("Bad local label"); break; default: printf("Strange error"); break; } printf(" on line %d of file: %s\n", line_no, filename); /*printf(line); printf("\n"); // This suppresses '%' characters :-( */ for (i = 0; line[i] != '\0'; i++) printf("%c", line[i]);printf("\n"); /* Yuk! */ if (position > 0) /* else position not well defined */ { for (i = 0; i <= position-1; i++) /* 1 space less than the posn. */ if (line[i] == '\t') printf("\t"); else printf(" "); printf("^\n"); /* Mirrors TAB expansion (non-printing chars too? @@) */ } return; } /*----------------------------------------------------------------------------*/ boolean input_line(FILE *file, char *buffer, unsigned int max) { int i; char c; if (file != NULL) { i = 0; do { c = getc(file); if (!feof(file) && (i <= max - 1)) buffer[i++] = c; } while ((c != '\n') && (c != '\r') && !feof(file)); buffer[i] = '\0'; /* Terminate */ if ((i > 0) && ((buffer[i-1] == '\n') || (buffer[i-1] == '\r'))) buffer[i-1] = '\0'; /* Strip LF */ if (c == '\r') c = getc(file); /* Strip off any silly DOS-iness */ if (c != '\n') ungetc(c, file); /* Yuk! In case there's -just- a CR */ return TRUE; } else return FALSE; /* file not valid */ } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ boolean parse_mnemonic_line(char *line, sym_table *a_table, sym_table *t_table, sym_table *d_table) { int j, k, okay; unsigned int i; unsigned int value, token; sym_record *dummy; char buffer[SYM_NAME_MAX + 5]; /* Largest suffix is 5 bytes, inc. terminator */ char *conditions[] = {"eq", "ne", "cs hs", "cc lo", "mi", "pl", "vs", "vc", "hi", "ls", "ge", "lt", "gt", "le", "al"}; char *pCC; /* Wrapper to allow more suffixes (e.g. "S") on mnemonics */ void parse_mnem_variant(char *name2, unsigned int eos, unsigned int token2, unsigned int variation) { void extra_letter(char letter, unsigned int mask) /* Convenient abstraction */ { buffer[eos] = letter; buffer[eos + 1] = '\0'; /* Terminator */ sym_define_label(name2, token2 | mask, 0, a_table, &dummy); return; } switch (variation) { case 0x1: /* Arithmetic 'S' */ case 0xD: sym_define_label(name2, token2, 0, a_table, &dummy); extra_letter('s', 0x00100000); break; case 0x2: /* Multiplies 'S' + others with just register lists */ sym_define_label(name2, token2, 0, a_table, &dummy); switch (token2 & 0x0000F000) { case 0x00001000: extra_letter('s', 0x00100000); break; /* MUL etc. */ case 0x00002000: extra_letter('b', 0x00400000); break; /* SWP */ default: break; /* 0 - CLZ, 3 - QADD, 8-B - SMUL */ } break; case 0x3: /* LDR/STR - not LDRH etc. */ sym_define_label(name2, token2, 0, a_table, &dummy); extra_letter('t', 0x00001000); /* suffix 'T' */ extra_letter('b', 0x00400000); /* suffix 'B' */ eos++; /* Grubbily leaves previous 'B' in place */ extra_letter('t', 0x00401000); /* suffix 'BT' */ break; case 0x6: /* LDM/STM */ { char *ldm_mode[] = {"da fa", "ia fd", "db ea", "ib ed"}; char *stm_mode[] = {"da ed", "ia ea", "db fd", "ib fa"}; char *pMode; int mode, k; for (mode = 0; mode < 4; mode++) /* Loop over possible addressing modes */ { if ((token2 & 0x00100000) == 0) pMode = stm_mode[mode]; else pMode = ldm_mode[mode]; while (*pMode != '\0') /* While some items remain in string */ { k = eos; /* Points at `original' terminator in buffer */ while ((*pMode != '\0') && (*pMode != ' ')) buffer[k++] = *(pMode++); buffer[k] = '\0'; /* Copy suffix and terminate it */ sym_define_label(name2, token2 | (mode << 23), 0, a_table, &dummy); while (*pMode == ' ') pMode++;/* Skip spaces - next suffix (if any) */ } } } break; case 0x9: /* LDRH etc. */ extra_letter('h', 0x00000000); /* suffix 'H' */ if ((token2 & 0x00100000) != 0) /* Loads, only */ { buffer[eos++] = 's'; extra_letter('b', 0x00001000); /* suffix "SB" */ extra_letter('h', 0x00002000); /* suffix "SH" */ } break; case 0xB: /* LDC/STC */ sym_define_label(name2, token2, 0, a_table, &dummy); extra_letter('l', 0x00400000); break; case 0xC: /* LDRD/STRD */ extra_letter('d', 0x00000000); /* suffix 'D' */ break; case 0x4: /* Branch */ case 0x5: /* Miscellaneous */ case 0x7: /* MRS/MSR */ case 0x8: /* ADR */ case 0xA: /* CDP + MCR/MRC */ default: sym_define_label(name2, token2, 0, a_table, &dummy); break; } return; } i = skip_spc(line, 0); j = 0; /* Indicates end of `root' mnemonic */ if (!test_eol(line[i])) /* Something on line - not comment */ { while (alpha_numeric(line[i]) && (j < SYM_NAME_MAX)) buffer[j++] = line[i++]; /* Mnemonics may start with numeric */ buffer[j] = '\0'; /* Add terminator */ okay = get_num(line, &i, &value, 16); /* Get hex number */ /* use evaluate() - mark real symbols for export and decimate before use @@@ */ if (okay) { if ((value & 0xF0000000) == 0xF0000000) /* Straight directive */ sym_define_label(&buffer[0], value, 0, d_table, &dummy); else if ((value & 0x00000100) != 0) /* Thumb mnemonic */ sym_define_label(&buffer[0], value, 0, t_table, &dummy); else { token = value & 0x0FFFFFFF; parse_mnem_variant(&buffer[0], j, 0xE0000000 | token, (value>>16) & 0xF); /* Straightforward "always" */ if ((value & 0x40000000) != 0) /* Conditions too? */ { for (i = 0; i < 0xF; i++) { pCC = conditions[i]; while (*pCC != '\0') { k = j; /* Points at original terminator in buffer */ while ((*pCC != '\0') && (*pCC != ' ')) buffer[k++] = *(pCC++); buffer[k] = '\0'; /* Copy and terminate */ parse_mnem_variant(&buffer[0], k, (i<<28) | token, (value>>16)&0xF); while (*pCC == ' ') pCC++; /* Skip spaces */ } } } } } } else okay = TRUE; /* Blank line or comment */ return okay; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ unsigned int parse_source_line(char *line, sym_table_item *mnemonic_list, sym_table *symbols, int pass_count, int last_pass, char **include_name) { int pos, j; own_label label_this_line; sym_record *ptr; char buffer[LINE_LENGTH]; unsigned int value, error_code; boolean mnemonic; error_code = SYM_NO_ERROR; /* @@@@ */ mnemonic = FALSE; label_this_line.sort = NO_LABEL; pos = skip_spc(line, 0); if (last_pass && (fList != NULL)) list_start_line(assembly_pointer, FALSE); if (!test_eol(line[pos])) /* Something on line - not comment */ { if (get_num(line, &pos, &value, 10)) /* Look for a `local' (numeric) label */ { pos= skip_spc(line, pos); if (pass_count == 0) { local_label *pTemp; pTemp = (local_label*) malloc(LOCAL_LABEL_SIZE); /* New entry */ pTemp->pNext = NULL; pTemp->pPrev = loc_lab_position; if (loc_lab_position == NULL) loc_lab_list = pTemp; /* First entry */ else loc_lab_position->pNext = pTemp; /* Subsequent entry */ loc_lab_position = pTemp; loc_lab_position->label = value; loc_lab_position->flags = 0; } else /* After the first pass */ { if (loc_lab_position==NULL) loc_lab_position = loc_lab_list;/* 1st entry*/ else loc_lab_position = loc_lab_position->pNext; /* Subsequent entry */ } label_this_line.sort = LOCAL_LABEL; label_this_line.local = loc_lab_position; } else { if ((j = get_identifier(line, pos, buffer, LINE_LENGTH)) != 0) /* Element=>buffer */ { pos = pos + j; /* Move position in line */ if ((ptr = sym_find_label_list(buffer, mnemonic_list)) == NULL) { /* Not a mnemonic */ if (sym_locate_label(buffer, /* Pass in flag if in Thumb area */ instruction_set == THUMB ? SYM_REC_THUMB_FLAG : 0, symbols, &(label_this_line.symbol))) label_this_line.sort = SYMBOL; /* Found */ else { if (pass_count == 0) /* First pass */ label_this_line.sort = MAYBE_SYMBOL; /* Could be reg. name, etc. */ } } else mnemonic = TRUE; /* Mnemonic first - no label on this line */ } else error_code = pos | SYM_ERR_SYNTAX; /* 1st char. on line is non-alpha. */ } /* If all is well, at this point the first item on the */ /* line has been identified, classified and stripped. */ if ((error_code == eval_okay) && !mnemonic) /* Could check for other symbols (e.g. "=") first @@@@ */ { pos = skip_spc(line, pos); /* Find next item on line */ if ((j = get_identifier(line, pos, buffer, LINE_LENGTH)) != 0) { /* Possible identifier found */ if ((ptr = sym_find_label_list(buffer, mnemonic_list)) == NULL) error_code = pos | SYM_ERR_NO_MNEM; /* //### */ else { /* Mnemonic found */ mnemonic = TRUE; pos = pos + j; /* Move position in line */ } } else { /* Nothing recognisable found on line */ if (!test_eol(line[pos])) /* Effective EOL? */ { /* Label(?) followed by something unexpected */ error_code = pos | SYM_ERR_NO_MNEM; } else /* Just a label on this line */ { if (label_this_line.sort==MAYBE_SYMBOL) /* Uncertain only on 1st pass */ sym_add_to_table(symbols, label_this_line.symbol); assemble_redef_label(assembly_pointer, assembly_pointer_defined, &label_this_line, &error_code, 0, pass_count, last_pass, line); } } } if ((error_code == eval_okay) && mnemonic) { /* Check lower bits of token against current instruction set */ if ((ptr->value & arm_variant & 0x00000FFF) != 0) error_code = SYM_BAD_VARIANT; /* Disallowed in selected ARM variant */ else error_code = assemble_line(line, pos, ptr->value, &label_this_line, symbols, pass_count, last_pass, include_name); } } if (last_pass) { if (fList != NULL) list_end_line(&line[0]); if ((label_this_line.sort == SYMBOL) && ((label_this_line.symbol->flags & SYM_REC_EQU_FLAG) == 0)) label_this_line.symbol->elf_section = elf_section; /* Purely for ELF */ } return error_code; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Do almost all the processing when an "LDR Rd, =value" is met. */ /* On entry: instr_set is the current instruction set */ /* size is the transfer size */ /* ext_value points to a location for the return value */ /* On exit: *ext_value will have been modified as appropriate to the */ /* returned value. */ /* Returns: 0 if value can fit in a single MOV instruction */ /* ext_value contains the immediate field */ /* 1 if value can fit in a single MVN instruction */ /* ext_value contains the immediate field */ /* 2 if a load is required (data structures have been set up) */ /* ext_value contains the address to load */ /* -1 on error */ /* ext_value is undefined */ /* External variables: literal_head, literal_list, defined_count */ int do_literal(instr_set instr_type, type_size size, int *ext_value, boolean first_pass, unsigned int *pError) { unsigned int value; int what, PC_inc; literal_record *pTemp; value = *ext_value; if (instr_type == THUMB) PC_inc = 4; else PC_inc = 8; if (first_pass) { /* Create new literal entry */ pTemp = (literal_record*) malloc(LIT_RECORD_SIZE); pTemp->pNext = NULL; if (literal_head != NULL) literal_head->pNext = pTemp; literal_head = pTemp; if (literal_list == NULL) literal_list = pTemp; if (*pError == eval_okay) { literal_head->flags = LIT_DEFINED; /* Zeros other flags */ defined_count++; /* Is this a "label"?? @@@ */ if (size == TYPE_HALF) literal_head->flags |= LIT_HALF; literal_head->value = value; if ((data_op_imm(value) >= 0) || (data_op_imm(~value) >= 0)) literal_head->flags |= LIT_NO_DUMP; /* Short form */ } /* Doesn't check for duplicate values on first pass */ else literal_head->flags = 0; /* Not defined - or anything else */ } else { /* First move definition pointer */ if (literal_head == NULL) literal_head = literal_list; else literal_head = literal_head->pNext; if (*pError == eval_okay) { if ((literal_head->flags & LIT_DEFINED) == 0) /* undef? */ defined_count++; /* Is this a "label"?? @@@ */ else if (literal_head->value != value) redefined_count++; /* // Is this a "label"?? @@@ */ literal_head->flags |= LIT_DEFINED; /* Is, now ... */ literal_head->value = value; /* ... and this is it */ if (((value & ~0x000000FF) == 0) /* Thumb test - all ARM values pass */ || ((instr_type == ARM) && (data_op_imm(value) >= 0))) // || (data_op_imm(~value) >= 0)))) { what = 0; /* Can do a MOV */ *ext_value = value; /* Return value */ literal_head->flags |= LIT_NO_DUMP; /* Short form */ } else { if ((instr_type == ARM) && (data_op_imm(~value) >= 0)) { what = 1; /* Can do a MVN */ *ext_value = value; /* Return value */ literal_head->flags |= LIT_NO_DUMP; /* Short form */ } else { boolean found; what = 2; /* Needs a load */ literal_head->flags &= ~LIT_NO_DUMP; /* Long form */ /* -Needed- here to guarantee termination of loop below */ pTemp = literal_list; /* Guaranteed not NULL */ found = FALSE; /* This searches whole assembly, no just currently pending pool */ while (!found) /* Search for earlier, duplicate value */ { /* Always finds itself, if nothing else */ while ((pTemp->value != literal_head->value) /* Search ...*/ || ((pTemp->flags & LIT_NO_DUMP) != 0)) pTemp = pTemp->pNext; /* Find own value in list */ if (!(found = (pTemp == literal_head))) /* Flag if self */ { /* else see if alternative `nearby' */ if (((pTemp->flags & LIT_HALF) == 0) /* Alias is 32-bit */ || (size == TYPE_HALF)) /* or I'm only 16-bit */ { /* Range check to alias */ int range; range = pTemp->address - (assembly_pointer + PC_inc); if (instr_type == ARM) /* Range check of possible share */ { if (range < 0) range = -range; switch (size) { case TYPE_WORD: found = range < 4096; break; case TYPE_HALF: found = range < 256; break; case TYPE_CPRO: found = range < 1024; break; case TYPE_BYTE:found = range < 256; break; // ??? } } else /* Thumb is -much- more constrained */ found = (range >= 0) && (range < 1024); } /* else not found (word can't alias to halfword) */ } if (!found) pTemp = pTemp->pNext; /* Unlucky - try again */ } /* End of outer `while' */ if (pTemp != literal_head) literal_head->flags |= LIT_NO_DUMP; /* Shares literal */ else literal_head->flags &= ~LIT_NO_DUMP; /* Unique */ *ext_value = pTemp->address; /* Return value */ } } } } if (*pError == eval_okay) return what; else return -1; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Break immediate into a set of ARM immediate fields in "buffer" */ /* Returns number of entries required */ // Compare & maybe amalgamate with "adr_loop" @@@ unsigned int find_partials(unsigned int imm, unsigned int *buffer) { unsigned int i, count; if (imm == 0) { count = 1; buffer[0] = 0; } else { count = 0; /* Something to go at? */ while (imm != 0) { i = 0; if (imm != 0) while ((imm & (3 << (2 * i))) == 0) i++; /* Find LS bit pair, unless zero */ buffer[count] = data_op_imm(imm & (0xFF << (2 * i))); /* Isolate one byte */ imm = imm & ~(0xFF << (2 * i)); /* Peel off that byte */ count = count + 1; } } return count; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Make/maintain list of variable size items. */ /* Inputs: first_pass - build or use flag */ /* size - desired size of item */ /* Returns: size allocated (may be larger than desired) */ /* Globals: size_record_list, size_record_current, size_changed_count */ unsigned int variable_item_size(int first_pass, unsigned int size) { if (first_pass) /* Build list of variable size elements */ { size_record *pTemp; pTemp = (size_record*) malloc(SIZE_RECORD_SIZE); /* Append new record */ pTemp->pNext = NULL; pTemp->size = size; if (size_record_list == NULL) size_record_list = pTemp; /* Link in first */ else size_record_current->pNext = pTemp; /* or subsequent */ size_record_current = pTemp; /* Pointer to last in list */ } else { /* Check for changes in object code size */ if (size_record_current->size != size) { if ((pass_count < SHRINK_STOP) /* Can still shrink */ || (size_record_current->size < size)) /* or grow */ { size_record_current->size = size; size_changed_count++; /* Superfluous? @@@ */ } else size = size_record_current->size; /* Size fixed */ } size_record_current = size_record_current->pNext; /* Global ptr to next */ } return size; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* If an INCLUDE is found a string is allocated and pointed to by */ /* include_name. */ unsigned int assemble_line(char *line, unsigned int position, unsigned int token, own_label *my_label, sym_table *symbol_table, int pass_count, int last_pass, char **include_name) { unsigned int operand, error_code; unsigned int temp; int first_pass; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void assemble_define(int size) { /* Elongated by string definition */ boolean terminate, escape; char delimiter, c; terminate = FALSE; while (!terminate) { position = skip_spc(line, position); if (((line[position] == '"') || (line[position] == '\'') /* String */ || (line[position] == '/') || (line[position] == '`'))) /* delimiters */ { /* Input string */ delimiter = line[position++]; /* Strip & record delimiter */ while ((line[position] != delimiter) && !terminate) { c = line[position]; if ((escape = (c == '\\'))) /* C-style escape code */ c = line[++position]; /* Get next character */ if (c != '\0') { if (last_pass) { /* Bytes only */ if (escape) switch (c) { case '0': c = '\0'; break; case '\"': c = '\"'; break; case '\'': c = '\''; break; case '\?': c = '\?'; break; case '\\': c = '\\'; break; case 'a': c = '\a'; break; case 'b': c = '\b'; break; case 'f': c = '\f'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 't': c = '\t'; break; case 'v': c = '\v'; break; default: break; } byte_dump(assembly_pointer + def_increment, c, line, size); } def_increment = def_increment + size; /* Always one address here */ position++; } else { /* Line finished before string did */ error_code = SYM_ENDLESS_STRING; terminate = TRUE; } } if (!terminate) position=skip_spc(line, position+1); /*Skip delimiter*/ } else { error_code = evaluate(line, &position, &temp, symbol_table); /* Parse expression */ if ((error_code == eval_okay) || allow_error(error_code, first_pass, last_pass)) { if ((error_code == eval_okay) && (last_pass)) /* Plant, ltl endian */ byte_dump(assembly_pointer + def_increment, temp, line, size); if (!last_pass) error_code = eval_okay; /* Pretend it's okay */ def_increment += size; /* Continue, even if missing values */ } else terminate = TRUE; } if (!terminate) { if (line[position] == ',') position++; /* Another element? */ else terminate = TRUE; } } /* End of WHILE */ assembly_pointer += def_increment; /* Add total size at end */ return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void fill_space(unsigned int count) { /* Fill with value */ unsigned int fill; int i; position++; /* Skip comma */ error_code = evaluate(line, &position, &fill, symbol_table); if (allow_error(error_code, first_pass, last_pass)) error_code = eval_okay; if (last_pass && (error_code == eval_okay)) for (i = 0; i < operand; i++) byte_dump(assembly_pointer + i, fill & 0xFF, line, 1); return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Read, range check and insert a 8-bit immediate offset for a load or store */ /* "error_code" is `global' wrt this routine. */ /* `variation' indicates the type of instruction */ unsigned int ldr_offset(unsigned int op_code, unsigned int value, type_size variation) { int x; if (!last_pass) return op_code; /* Crude, but clear! */ if (error_code == eval_okay) { x = (int) value; /* Cast for convenience */ if (x < 0) x = -x; /* Make offset positive */ else op_code = op_code | 0x00800000; /* or set U bit */ switch (variation) /* Select on load/store type */ { case TYPE_WORD: /* LDR, LDRB, etc. */ if ((x & 0xFFFFF000) == 0) /* Used to trap the `min_int' case too */ op_code = op_code | x ; else if (last_pass) error_code = SYM_OFFSET_TOO_BIG; break; case TYPE_HALF: /* LDRH, LDRSB, etc. */ if ((x & 0xFFFFFF00) == 0) /* Used to trap the `min_int' case too */ op_code = op_code | ((x & 0xF0) << 4) | (x & 0x0F); else if (last_pass) error_code = SYM_OFFSET_TOO_BIG; break; case TYPE_CPRO: /* LDC, STC, etc. */ if ((x & 0xFFFFFC03) == 0) /* Used to trap the `min_int' case too */ op_code = op_code | (x >> 2); else if (last_pass) { if ((x & 3) != 0) error_code = SYM_MISALIGNED; else error_code = SYM_OFFSET_TOO_BIG; } break; default: break; } } return op_code; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Parse a data operation immediate field, explicitly or implicitly specified */ /* The Boolean `translate' flag allows a second data operation to be tried if */ /* the first attempt is out of range. */ unsigned int data_op_immediate(char *line, unsigned int *pPosition, unsigned int op_code, int translate) { unsigned int value, ror_value; int x; error_code = evaluate(line, pPosition, &value, symbol_table); if (error_code == eval_okay) { if (line[*pPosition] == ',') /* Allow "ROR" instead/too? @@@ */ { /* Explicit rotation code */ (*pPosition)++; /* Skip comma */ error_code = evaluate(line, pPosition, &ror_value, symbol_table); if (error_code == eval_okay) { if (((value & 0xFFFFFF00) == 0) /* Check value ranges */ && ((ror_value & 0xFFFFFFE1) == 0)) op_code = op_code | (ror_value << 7) | value; else error_code = SYM_OORANGE; } } else { /* Rotation implicit */ x = data_op_imm(value); /* Transform into rotate+field code */ if (x >= 0) op_code = op_code | x; else { /* Out of range */ int trans_type[]={ 0,-1, 1,-1, 1, 0, 0,-1,-1,-1, 1, 1,-1, 0, 0, 0}; int trans_instr[] = { 0xE, -1, 0x4, -1, 0x2, 0x6, 0x5, -1, -1, -1, 0xB, 0xA, -1, 0xF, 0x0, 0xD}; int i; i = (token >> 21) & 0xF; /* Data operation specifier */ if (translate && (trans_type[i] >= 0)) { /* Maybe can do as a different op. */ x = ~value + trans_type[i]; /* 0 = not, 1 = negate */ x = data_op_imm(x); /* Try a transform ... */ if (x >= 0) { /* Okay, so use new immediate and change operation */ op_code = op_code | x; op_code = (op_code & 0xFE1FFFFF) | (trans_instr[i] << 21); } else error_code = SYM_OORANGE; } else error_code = SYM_OORANGE; } } } return op_code | 0x02000000; /* Set I bit */ } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Look for a register shift specifier from line[*pPosition] */ /* Append the code, if found, to op_code, and return it (stripped from input) */ /* reg_shift is a Boolean which allows a register as the distance specifier */ /* "error_code" and "symbol_table" are `global' wrt this routine. */ unsigned int addr_shift(char *line, unsigned int *pPosition, unsigned int op_code, int reg_shift) { int shift; unsigned int value; shift = get_shift(line, pPosition); if (shift >= 0) /* Legitimate shift code */ { if ((shift & 4) != 0) /* Extended code */ op_code = op_code | 0x00000060; /* RRX */ else { op_code = op_code | (shift << 5); /* Insert shift op. code */ /* (removed later if #0) */ if (cmp_next_non_space(line, pPosition, 0, '#')) /* Check/strip '#' */ { error_code = evaluate(line, pPosition, &value, symbol_table); if (error_code == eval_okay) { if (value == 0) op_code = op_code & 0xFFFFFF9F; /* Back to LSL */ else if ((value & 0xFFFFFFC0) != 0) error_code = SYM_OORANGE; /* Coarse filter */ else switch (shift) { case 0: /* LSL and ROR (#0 already done) */ case 3: if (value <= 31) op_code = op_code | (value << 7); else error_code = SYM_OORANGE; break; case 1: /* LSR and ASR */ case 2: if (value <= 32) op_code = op_code | ((value & 0x1F) << 7); else error_code = SYM_OORANGE; break; default: break; /* Unreachable :-/ */ } } } else { if (reg_shift) /* Allowed on data ops. but not load/store */ { int reg; if ((reg = get_reg(line, &position)) >= 0) op_code = op_code | 0x00000010 | (reg << 8); else error_code = SYM_BAD_REG | position; } else error_code = SYM_ADDR_MODE_ERR | *pPosition; /* Only '#' legit. */ } } } else /* Check for `dangling' end after comma */ if (shift < -1) error_code = SYM_ERR_NO_MNEM | *pPosition; return op_code; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Parses a LDM-style register list and returns bit vector indicating which */ /* registers are found. Checks validity against an `allowed' vector and */ /* modifies (global) error_code if a bad register is requested. */ unsigned int parse_reg_list(unsigned int allowed) { unsigned int list, RegA, RegB; /* Bit positions/mask */ int reg; list = 0; /* Bitmask for collecting registers */ do { if (line[position] == ',') position++; /* Applies after 1st iter.*/ if ((reg = get_thumb_reg(line, &position, allowed)) >= 0) { RegA = 1 << reg; /* Bit position */ list = list | RegA; /* Put this register into mask */ if (cmp_next_non_space(line, &position, 0, '-')) { /* Register list coming up */ if ((reg = get_thumb_reg(line, &position, allowed)) >= 0) { RegB = 1 << reg; /* Last position in list */ while (RegA != RegB) /* Fill in the bits between */ { /* Iterate up or down, as required */ if (RegA < RegB) RegA = RegA << 1; else RegA = RegA >> 1; list = list | RegA; } } else error_code = SYM_BAD_REG | position; /* Bad list end reg. */ } /* End of register list processing */ } else error_code = SYM_BAD_REG | position; /* Bad individual/start reg. */ } /* Iterate while no errors and comma separators encountered */ while ((error_code==eval_okay)&&cmp_next_non_space(line,&position,0,',')); if ((list & ~allowed) != 0) error_code = SYM_BAD_REG; /* Posn. uncertain */ /* Else breakage possible if range used in Thumb (e.g. PUSH {R0-LR} ) */ return list; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Wrapper for parse_reg_list to deal with '{' '}' syntax (ARM only) */ unsigned int parse_ARM_reg_list(unsigned int op_code, unsigned int line_offset) { if (!cmp_next_non_space(line, &position, line_offset, '{')) error_code = SYM_NO_LSQUIGGLE | position; else { op_code |= parse_reg_list(0x0000FFFF); /* Get bitmask of registers */ if (error_code == eval_okay) { if (line[position] == '}') /* Check list terminated cleanly */ { if (cmp_next_non_space(line, &position, 1, '^')) op_code = op_code | 0x00400000; /* Add S bit if required */ } else error_code = SYM_NO_RSQUIGGLE | position; } } return op_code; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Parse an addressing mode */ /* size specifies the type of instruction and hence the particular syntax */ /* Returns op_code with the new coding appended */ unsigned int addressing_mode(unsigned int op_code, type_size size) { /* First, the parameters which differentiate LDR and LDRH */ unsigned int word_masks[] = {0x01000000, 0x02000000, 0x03000000, 0x010F0000}; unsigned int half_masks[] = {0x01400000, 0x00000000, 0x01000000, 0x014F0000}; unsigned int cpro_masks[] = {0x01000000, 0x00000000, 0x01000000, 0x010F0000}; unsigned int *parameter; unsigned int value; int reg; switch (size) { case TYPE_WORD: parameter = word_masks; break; case TYPE_HALF: parameter = half_masks; break; case TYPE_CPRO: parameter = cpro_masks; break; case TYPE_BYTE: parameter = half_masks; break; // uhu ?? } if (cmp_next_non_space(line, &position, 0, '[')) { if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | (reg << 16); /* Base register (Rn) */ position = skip_spc(line, position); switch (line[position]) /* What succeeds base register? */ { case ']': /* Post indexed or just "[Rn]" */ if (!cmp_next_non_space(line, &position, 1, ',')) op_code = op_code | parameter[0]; /* Just "[Rn]" */ else { /* Post-indexed mode */ if (cmp_next_non_space(line, &position, 0, '#')) /* Imm. ? */ { error_code = evaluate(line, &position, &value, symbol_table); op_code = ldr_offset(op_code, value, size); switch (size) { case TYPE_HALF: op_code |= 0x00400000; break; /* I bit */ case TYPE_CPRO: op_code |= 0x00200000; break; /* W bit */ default: break; } } else { /* Register offset, post-indexed */ if (size != TYPE_CPRO) { op_code = op_code | parameter[1]; if (line[position] == '-') position++; /* + or - op.? */ else { op_code = op_code | 0x00800000; /* Set 'U' bit */ if (line[position] == '+') position++; } if ((reg = get_reg(line, &position)) >= 0) /* Rm */ { if (size == TYPE_WORD) op_code = addr_shift(line, &position, op_code|reg, FALSE); else op_code = op_code | reg; /* No shift for LDRH */ } else error_code = SYM_BAD_REG | position; /* No offset reg. */ } else { /* LDC/STC "unindexed" mode */ if (line[position] == '{') { position++; error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { if ((value & 0xFFFFFF00) == 0x00000000) { op_code = op_code | value | 0x00800000; /* Set U bit */ if (!cmp_next_non_space(line, &position, 0, '}')) error_code = SYM_NO_RSQUIGGLE | position; } else error_code = SYM_OORANGE; } } else error_code = SYM_NO_LSQUIGGLE | position; } } } break; case ',': if (cmp_next_non_space(line, &position, 1, '#')) { /* Pre-index immediate */ op_code = op_code | parameter[0]; error_code = evaluate(line, &position, &value, symbol_table); op_code = ldr_offset(op_code, value, size); /* Offset */ if ((error_code == eval_okay) || allow_error(error_code, first_pass, last_pass)) { /* May need to tolerate an error to check syntax */ if (line[position] == ']') { if (cmp_next_non_space(line, &position, 1, '!')) op_code = op_code | 0x00200000; /* Set 'W' bit */ } else error_code = SYM_NO_RBR | position; } } else { /* Register offset, pre-indexed */ if (size != TYPE_CPRO) { op_code = op_code | parameter[2]; if (line[position] == '-') position++; /* + or - operator? */ else { if (line[position] == '+') position++; op_code = op_code | 0x00800000; /* Set 'U' bit */ } if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | reg; /* Rm */ if (!cmp_next_non_space(line, &position, 0, ']')) { /* Something else here ... */ if (size == TYPE_WORD) { /* Shift */ op_code = addr_shift(line, &position, op_code, FALSE); if ((error_code == eval_okay) || allow_error(error_code, first_pass, last_pass)) { if (line[position] == ']') position++; else error_code = SYM_NO_RBR | position; } } else error_code = SYM_NO_RBR | position; /* LDRH */ } if (cmp_next_non_space(line, &position, 0, '!')) op_code = op_code | 0x00200000; /* Set 'W' bit */ } else error_code = SYM_BAD_REG | position; /* Rm not IDed */ } else error_code = SYM_ADDR_MODE_BAD; /* Bad mode for LDC/STC */ } break; default: error_code = SYM_ADDR_MODE_ERR; break; } } else error_code = SYM_BAD_REG | position; /* Base register not found */ } else /* Addressing mode does not begin with '[' */ { if (line[position] == '=') { /* Literal pool stuff */ if ((size == TYPE_CPRO) || ((op_code & 0x00100000) == 0)) error_code = SYM_ADDR_MODE_ERR; /* Disallowed in LDC and all stores */ else { position++; error_code = evaluate(line, &position, &value, symbol_table); if ((error_code == eval_okay) || allow_error(error_code, first_pass, last_pass)) { switch (do_literal(ARM, size, &value, first_pass, &error_code)) /* Constant size? */ { /* (literal table appended as necessary) */ case 0: /* Will fit in instruction */ op_code = op_code & 0xF000F000; /* Fields to keep */ op_code = op_code | 0x03A00000 | data_op_imm( value); /* MOV */ break; case 1: /* Will fit in instruction */ op_code = op_code & 0xF000F000; /* Fields to keep */ op_code = op_code | 0x03E00000 | data_op_imm(~value); /* MVN */ break; case 2: /* Needs full-blooded LDR */ op_code = ldr_offset(op_code | parameter[3], value - (assembly_pointer + 8), size); break; default: break; } } } } else { /* Try for `absolute' address */ error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) op_code = ldr_offset(op_code | parameter[3], value - (assembly_pointer + 8), size); } } return op_code; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void arm_mnemonic() { /* Instructions, rather than directives */ unsigned int op_code, value, extras; int reg; extras = 0; /* Instruction length - 4 */ if (first_pass || last_pass || ((token & 0x00008000) != 0)) /* -skip- */ {/* Only do difficult stuff on first pass (syntax) and last pass (code dump) unless instruction may cause file length to vary (e.g. LDR Rd, =###) */ op_code = token & 0xFFF00000; if ((token & 0x00000800) != 0) op_code |= 0xF0000000; /*`New' always codes */ switch (token & 0x000F0000) { case 0x00000000: /* NOP (etc.) */ switch (token & 0x00F00000) { case 0x00000000: op_code = 0xE1A00000; break; /* NOP */ case 0x00100000: /* undefined */ op_code = (op_code & 0xF0000000) | 0x06000010; break; default: op_code = 0xE1A00000; break; /* NOP */ } break; case 0x00010000: /* Data operations */ if ((token & 0x00004000) != 0) { /* Destination register wanted? */ if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | (reg << 12); if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; } if (error_code == eval_okay) { /* Source Rn wanted? */ if ((token & 0x00002000) != 0) { if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | (reg << 16); if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } else { error_code = SYM_BAD_REG | position; } } /* Rm always present, so check omitted */ if (error_code == eval_okay) { if (cmp_next_non_space(line, &position, 0, '#')) { /* Imm. mode */ op_code = data_op_immediate(line, &position, op_code, TRUE); } else { /* Register mode */ if ((reg = get_reg(line, &position)) >= 0) op_code = addr_shift(line, &position, op_code | reg, TRUE); else error_code = SYM_BAD_REG | position; } } } break; case 0x00020000: /* Multiply operations */ { int mul_regs[] = { 16, 0, 8, -1 }; /* Bit positions of */ int mla_regs[] = { 16, 0, 8, 12, -1 }; /* the various */ int mull_regs[] = { 12, 16, 0, 8, -1 }; /* register fields */ int swp_regs[] = { 12, 0, -1 }; /* First 2 for SWP */ int clz_regs[] = { 12, 0, -1 }; int qadd_regs[] = { 12, 0, 16, -1 }; int not_def[] = { -1 }; int *pRegs, i; switch (token & 0x0000F000) { case 0x00000000: pRegs = clz_regs; op_code |= 0x000F0F10; break; case 0x00002000: pRegs = swp_regs; op_code |= 0x00000090; break; case 0x00003000: pRegs = qadd_regs; op_code |= 0x00000050; break; case 0x00001000: op_code = op_code | 0x00000090; switch (token & 0x00E00000) /* Decide where the reg. fields go */ { case 0x00000000: pRegs = mul_regs; break; case 0x00200000: pRegs = mla_regs; break; case 0x00800000: case 0x00A00000: case 0x00C00000: case 0x00E00000: pRegs = mull_regs; break; default: pRegs = not_def; break; } break; case 0x00008000: case 0x00009000: case 0x0000A000: case 0x0000B000: op_code = op_code | ((token >> 7) & 0x60) | 0x00000080; switch (token & 0x00600000) /* Decide where the reg. fields go */ { case 0x00000000: pRegs = mla_regs; break; case 0x00200000: if ((token&0x00001000) == 0) pRegs = mla_regs; else pRegs = mul_regs; break; case 0x00400000: pRegs = mull_regs; break; case 0x00600000: pRegs = mul_regs; break; } break; default: pRegs = not_def; break; } i = 0; while ((error_code == eval_okay) && (pRegs[i] >= 0)) { if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | ( reg << pRegs[i] ); i++; if (pRegs[i] >= 0) /* If there is a next register ... */ { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } else if ((token & 0x0000F000) == 0x00002000) /* SWP address bodged */ { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; else if (!cmp_next_non_space(line, &position, 0, '[')) error_code = SYM_NO_LBR | position; else if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | (reg << 16); if (!cmp_next_non_space(line, &position, 0, ']')) error_code = SYM_NO_RBR | position; } else error_code = SYM_BAD_REG | position; } } else error_code = SYM_BAD_REG | position; } } break; case 0x00030000: /* Normal LDR/STR operations */ case 0x00090000: /* LDRH etc. */ case 0x000C0000: /* LDRD/STRD */ { int err_pos; /* Used if real register Rd is disallowed */ err_pos = position; if ((reg = get_reg(line, &position)) >= 0) /* Reg. to transfer (Rd) */ { if (((token & 0x000F0000) == 0x000C0000) && ((reg & 1) != 0)) error_code = SYM_BAD_REG | skip_spc(line, err_pos); /* Even regs. only in LDRD; rederive position only if needed */ else { op_code = op_code | (reg << 12); if (cmp_next_non_space(line, &position, 0, ',')) /* Comma found */ { if ((token & 0x000F0000) == 0x00030000) /* LDR/STR */ op_code = addressing_mode(op_code, TYPE_WORD); else /* LDRH etc./LDRD */ op_code = addressing_mode(op_code, TYPE_HALF); } else error_code = SYM_NO_COMMA | position;/*',' after Rd missing*/ } } else error_code = SYM_BAD_REG | position; /* Rd not found */ switch (token & 0x000F0000) { /* Note: the following trap allows "[Rn]" for LDRT but also allows "[Rn, #0]" */ /* to be translated too. Is this acceptable? @@ */ case 0x00030000: /* LDR/STR only */ if ((error_code == eval_okay) && ((token & 0x00001000) != 0)) { /* 'T' option */ if (((op_code & 0x01200000) == 0x00000000) /* Post ind. mode? */ || ((op_code & 0x02000FFF) == 0x00000000)) /* or #0 offset? */ op_code = (op_code & 0xFEFFFFFF) | 0x00200000; /* Redefine addressing mode */ else error_code = SYM_ADDR_MODE_BAD; } break; case 0x00090000: /* Short-form LD/ST */ switch (token & 0x00007000) /* Which LDRH... instruction? */ { case 0x00000000: op_code = op_code | 0x000000B0; break;/*LDRH */ case 0x00001000: op_code = op_code | 0x000000D0; break;/*LDRSB*/ case 0x00002000: op_code = op_code | 0x000000F0; break;/*LDRSH*/ default: break; } break; case 0x000C0000: /* LDRD/STRD */ if ((token & 0x00001000) == 0) op_code |= 0x000000F0; /* STRD */ else op_code |= 0x000000D0; /* LDRD */ break; } } break; case 0x00040000: /* B and BL */ error_code = evaluate(line, &position, &value, symbol_table); value = value - (assembly_pointer + 8); if ((value & 3) != 0) /* Not word aligned */ error_code = SYM_UNALIGNED_BRANCH; else if (((value & 0xFE000000) == 0x00000000) /* or out of range */ || ((value & 0xFE000000) == 0xFE000000)) op_code = op_code | ((value >> 2) & 0x00FFFFFF); else error_code = SYM_OORANGE_BRANCH; break; case 0x00050000: /* Miscellany */ switch (token & 0x0000F000) { case 0x00000000: /* SWI */ error_code = evaluate(line, &position, &value, symbol_table); if ((value & 0xFF000000) == 0) op_code = op_code | value; else error_code = SYM_OORANGE; break; case 0x00001000: /* BX */ if ((reg = get_reg(line, &position)) >= 0) op_code = op_code | 0x000FFF10 | reg; else error_code = SYM_BAD_REG | position; /* Rm not found */ break; case 0x00002000: /* BKPT */ error_code = evaluate(line, &position, &value, symbol_table); if ((value & 0xFFFF0000) == 0) op_code = op_code | ((value&0xFFF0) << 4) | 0x70 | (value&0x000F); else error_code = SYM_OORANGE; break; case 0x00003000: /* BLX */ if ((reg = get_reg(line, &position)) >= 0) op_code = op_code | 0x012FFF30 | reg; else /* Rm not found */ if ((token & 0xF0000000) == 0xE0000000) /* Only unconditional */ { error_code = evaluate(line, &position, &value, symbol_table); value = value - (assembly_pointer + 8); if ((value & 1) != 0) /* Not halfword aligned */ error_code = SYM_UNALIGNED_BRANCH; else if (((value & 0xFE000000) == 0x00000000) /* In range? */ || ((value & 0xFE000000) == 0xFE000000)) op_code = 0xFA000000 | ((value&0x03FFFFFC) >> 2) | ((value&2) << 23); else error_code = SYM_OORANGE_BRANCH; } else error_code = SYM_NO_COND; break; case 0x00004000: /* PLD */ op_code = addressing_mode(op_code | 0x0000F000, TYPE_WORD); if ((op_code & 0x01200000) != 0x01000000) { /* Modes which write back are disallowed */ op_code = 0x00000000; error_code = SYM_ADDR_MODE_BAD; } break; case 0x00005000: /* PUSH/POP */ op_code = op_code | 0x000D0000 | parse_ARM_reg_list(op_code, 0); break; default: break; } break; /* End of case 0x00050000 "Miscellany" */ case 0x00060000: /* STM/LDM */ if ((reg = get_reg(line, &position)) >= 0) /* Base register (Rn) */ { op_code = op_code | (reg << 16); if (cmp_next_non_space(line, &position, 0, '!')) { op_code = op_code | 0x00200000; /* Set W bit */ position = skip_spc(line, position); } if (line[position] == ',') op_code = op_code | parse_ARM_reg_list(op_code, 1); else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; /* Rn not found */ break; case 0x00070000: /* MRS/MSR */ if ((token & 0x00200000) == 0) /* MRS */ { if ((reg = get_reg(line, &position)) >= 0) /* Register (Rd) */ { op_code = op_code | (reg << 12); if (cmp_next_non_space(line, &position, 0, ',')) { unsigned int old_pos; position = skip_spc(line, position); old_pos = position; /* Remember in case of error */ reg = get_psr(line, &position); /* PSR */ if ((reg >= 0) && ((reg & 0x0F) == 0x0F)) /* Reg. found */ op_code = op_code | (reg << 16); /* and legal here */ /* The lower `field mask' fills the SBO field <19>-<16> */ else error_code = SYM_BAD_REG | old_pos; } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; /* Rd not found */ } else /* MSR */ { position = skip_spc(line, position); reg = get_psr(line, &position); /* PSR */ if (reg >= 0) { op_code = op_code | (reg << 16) | 0x0000F000; if (cmp_next_non_space(line, &position, 0, ',')) { if (cmp_next_non_space(line, &position, 0, '#')) /* Skip ',' */ op_code = data_op_immediate(line, &position, op_code, FALSE); else { if ((reg = get_reg(line, &position)) >= 0) /* Register (Rm) */ op_code = op_code | reg; else error_code = SYM_BAD_REG | position; /*Missing source reg.*/ } } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; } break; case 0x00080000: /* ADR */ { void adr_loop(int value, int count) /* Local procedure */ { int i, fixed; fixed = count >= 0; /* Flag for loop termination */ while TRUE /* Something to go at? */ { i = 0; if (value != 0) while ((value & (3 << (2 * i))) == 0) i++; /* Find LS bit pair, unless zero */ op_code = op_code | data_op_imm(value & (0xFF << (2 * i))); value = value & ~(0xFF << (2 * i));/* Peel off byte from offset */ /* Finish if dealing with last word */ if (fixed) { count = count - 1; if (count < 0) break; } else if (value == 0) break; /* otherwise plant word and continue */ if (last_pass) byte_dump(assembly_pointer+extras,op_code,line,4); extras = extras + 4; /* Count extra word(s) */ op_code = (op_code & 0xFFF0F000) /* Modify op-code */ | ((op_code & 0x0000F000) << 4); } /* Closure of loop */ if (value != 0) error_code = SYM_OORANGE; /* Bits remain: error */ return; } if ((reg = get_reg(line, &position)) >= 0) { op_code = op_code | (reg << 12); if (cmp_next_non_space(line, &position, 0, ',')) { int x; error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { x = (int) (value - (assembly_pointer + 8)); /* Offset */ if (x < 0) { op_code = op_code | 0x024F0000; x = -x; } else op_code = op_code | 0x028F0000; /* Sign and mag. */ } if ((token & 0x0000B000) == 0x00008000) /* Var. length: ADRL */ { /* Crunch without restriction */ if (!last_pass) { if (error_code == eval_okay) adr_loop(x, -1); else extras = 12;/* If unknown, assume 3 extra words needed */ } else adr_loop(x, size_record_current->size / 4); extras = variable_item_size(first_pass, extras); } else /* Fixed length: ADR(n) */ if (error_code == eval_okay) adr_loop(x, (token >> 12) & 3); /* Pass length to cruncher */ else extras = (token >> 10) & 0xC; /* Length as specified */ } else error_code = SYM_NO_COMMA | position; /* ',' not found */ } else error_code = SYM_BAD_REG | position; /* Rd not found */ } break; case 0x000A0000: /* CDP + MCR/MRC */ { int cdp_parameters[] = { 0xFFFFFFF0, 20, 1, 1, 2 }; int mcr_parameters[] = { 0xFFFFFFF8, 21, 0, 1, 1 }; int mcrr_parameters[] = { 0xFFFFFFF0, 4, 0, 0, 0 }; int *parameters; int CDP; CDP = ((token & 0x0000F000) == 0x00000000); /* Differ. from MCR/MRC */ switch (token & 0x0000F000) { case 0x00000000: parameters= cdp_parameters; break; case 0x00001000: parameters= mcr_parameters;op_code|=0x00000010;break; case 0x00002000: parameters=mcrr_parameters; break; } if ((reg = get_copro(line, &position)) >= 0)/* `reg' is a temp var. */ { op_code = op_code | (reg << 8); /* cp_num */ if (cmp_next_non_space(line, &position, 0, ',')) { error_code = evaluate(line, &position, &value, symbol_table); if ((error_code == eval_okay) || (first_pass && ((error_code & ALLOW_ON_FIRST_PASS) != 0))) { if ((value & parameters[0]) == 0) /* opcode_1 */ { op_code = op_code | (value << parameters[1]); if (cmp_next_non_space(line, &position, 0, ',')) { if (parameters[2] == 0) reg = get_reg(line, &position); else reg = get_creg(line, &position); if (reg >= 0) { op_code = op_code | (reg << 12); /* CRd */ if (cmp_next_non_space(line, &position, 0, ',')) { if (parameters[3] == 0) reg = get_reg(line, &position); else reg = get_creg(line, &position); if (reg >= 0) { op_code = op_code | (reg << 16); /* CRn */ if (cmp_next_non_space(line, &position, 0, ',')) { if ((reg = get_creg(line, &position)) >= 0) { op_code = op_code | reg; /* CRm */ if (parameters[4] > 0) /* else finished (MCRR) */ { if (cmp_next_non_space(line, &position, 0, ',')) { error_code = evaluate(line, &position, &value, symbol_table); if ((error_code == eval_okay) || (first_pass && ((error_code&ALLOW_ON_FIRST_PASS) != 0))) { if ((value & 0xFFFFFFF8) == 0)/* opcode_2 */ op_code = op_code | (value << 5); else error_code = SYM_BAD_CP_OP; /*Bad Op. #2*/ } } else /* Last field optional for MCR/MRC */ if (parameters[4] == 2) /* CDP only */ error_code = SYM_NO_COMMA | position; } } else error_code = SYM_BAD_REG | position; /*No CRm*/ } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position;/*CRn missing*/ } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; /* CRd missing */ } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_CP_OP; /* Opcode 1 out of range */ } } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_COPRO | position; /* Copro. field missing */ } break; case 0x000B0000: /* LDC/STC */ if ((reg = get_copro(line, &position)) >= 0)/* `reg' is a temp var. */ { op_code = op_code | (reg << 8); /* cp_num */ if (cmp_next_non_space(line, &position, 0, ',')) { if ((reg = get_creg(line, &position)) >= 0) { op_code = op_code | (reg << 12); /* Rd */ if (cmp_next_non_space(line, &position, 0, ',')) op_code = addressing_mode(op_code, TYPE_CPRO); else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; /* CRd missing */ } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_COPRO | position; /* Copro. field missing */ break; case 0x000D0000: /* Long data-op. variants */ { unsigned int Rd, Rn, imm; unsigned int partial[4], alternate[4]; /* Buffers for imm. fields */ unsigned int count, alt_count, true_count, *ptr; unsigned int op_base; if ((Rd = get_reg(line, &position)) >= 0) /* Syntax parsing */ { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; else { if ((token & 0x00002000) != 0) /* Source Rn wanted? */ { /* (all except MOVL) */ if ((Rn = get_reg(line, &position)) >= 0) { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; } else Rn = 0; /* `Rn' for MOV/MVN shoud be R0 */ } } else error_code = SYM_BAD_REG | position; if (error_code == eval_okay) /* Get the immediate value */ { if (!cmp_next_non_space(line, &position, 0, '#')) error_code = SYM_NO_HASH | position; else error_code = evaluate(line, &position, &imm, symbol_table); } ptr = partial; /* Default setting */ if (error_code == eval_okay) /* Got the (possible) immediate value */ { if ((token & 0x0FE00000) == TOKEN_ANDX /* AND must be single op. */ && find_partials(imm, partial) != 1) /* else ANDX => BICX */ { token = ((token & 0xF01FFFFF) | TOKEN_BICX); imm = ~imm; } op_base = token & 0xFFF00000; count = find_partials(imm, partial); /* Break up imm */ switch (token & 0x0FE00000) /* Check for shorter alternatives */ { case TOKEN_ANDX: /* ANDX */ case TOKEN_EORX: /* EORX */ case TOKEN_ORRX: /* ORRX */ case TOKEN_BICX: /* BICX */ case TOKEN_RSBX: /* RSBX */ case TOKEN_RSCX: /* RSCX */ break; case TOKEN_SUBX: /* SUBX */ case TOKEN_ADDX: /* ADDX */ case TOKEN_ADCX: /* ADCX */ case TOKEN_SBCX: /* SBCX */ alt_count= find_partials(-imm, alternate); /* Negate */ if (alt_count < count) /* Use alternative op. */ { count = alt_count; ptr = alternate; switch (token & 0x0FE00000) /* Change op. code */ { case TOKEN_SUBX:op_base=(op_base&0xFE100000)|TOKEN_ADDX;break; case TOKEN_ADDX:op_base=(op_base&0xFE100000)|TOKEN_SUBX;break; case TOKEN_ADCX:op_base=(op_base&0xFE100000)|TOKEN_SBCX;break; case TOKEN_SBCX:op_base=(op_base&0xFE100000)|TOKEN_ADCX;break; } } break; /* Note: doesn't try 16-bit MOVs from v6T2 */ case TOKEN_MOVX: /* MOVX */ alt_count= find_partials(~imm, alternate); /* One's comp. */ if (alt_count < count) /* Use alternative op. */ { count = alt_count; ptr=alternate; op_base = op_base | 0x00400000; /* MVN */ } break; default: printf("Unknown `long' operation\n"); break; } } else count = 4; true_count = variable_item_size(first_pass, count); /* Account for variable length sequence */ if (!last_pass) extras = extras + 4 * (true_count - 1); else /* Only derive op. code(s) on last pass */ { unsigned int i; op_base = op_base | Rn << 16 | Rd << 12; /* Padding only used if length is `wrong' */ for (i = count; i < true_count; i++) ptr[i] = 0; /* Pad with 0 */ /* Zero is safe for any op. after 1st in sequence */ for (i = 0; i < true_count; i++) { /* After first word accumulate within Rd */ op_code = op_base | ptr[i]; if (i != true_count - 1) /* If not last word to plant ... */ { op_code = op_code & 0xFFEFFFFF; /* S bit only on last op. */ byte_dump(assembly_pointer + extras, op_code, line, 4); extras = extras + 4; /* Count extra word(s) */ } /* Now prepare for follow up operations */ if (i != 0) continue; /* Not -needed- probably faster */ op_base = (op_base & 0xFFF0F000 )| Rd << 16; /* Accumulator */ switch (token & 0x0FE00000) /* Change op. code? */ { /* No carry after first operation */ case TOKEN_SBCX: op_base=(op_base&0xFE1FFFFF)|TOKEN_SUBX; break; case TOKEN_RSBX: /* Remaining immediate is added on */ case TOKEN_RSCX: case TOKEN_ADCX: op_base=(op_base&0xFE1FFFFF)|TOKEN_ADDX; break; case TOKEN_MOVX: op_base=op_base&0xFFDFFFFF; break; } } /* End of `for' loop */ } } break; default: printf("Unprocessable opcode!\n"); break; } } /* end of -skip- */ if (error_code == eval_okay) { if (last_pass) byte_dump(assembly_pointer + extras, op_code, line, 4); } else { if (!last_pass) { if (allow_error(error_code, first_pass, last_pass)) error_code = eval_okay; /* Pretend we're okay */ } else /* Error on final pass */ byte_dump(assembly_pointer + extras, 0, line, 4); /* Dump 0x00000000 place holder */ } assembly_pointer = assembly_pointer + 4 + extras; return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void thumb_mmemonic() { unsigned int op_code, value, extras; int reg; extras = 0; /* Instruction length - 2 */ if (first_pass || last_pass || ((token & 0x00008000) != 0)) /* -skip- */ {/* Only do difficult stuff on first pass (syntax) and last pass (dump) unless instruction may cause file length to vary (e.g. LDR Rd, =###) */ op_code = (token >> 20) & 0x00000FFF; switch (token & 0x000F0000) { case 0x00000000: /* Straightforward data operations */ { /* ADC, AND, BIC, CMN, EOR, MUL, MVN, NEG, ORR, ROR, SBC, TST */ op_code = 0x4000 | (op_code << 6); reg = get_thumb_reg(line, &position, 0x00FF); /* First register */ if (reg >= 0) { op_code = op_code | reg; if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; if (error_code == eval_okay) { reg = get_thumb_reg(line, &position, 0x00FF); /* Second register */ if (reg >= 0) op_code = op_code | (reg << 3); else error_code = SYM_BAD_REG | position; } } break; case 0x00010000: /* Shifts {ASR, LSL, LSR} */ { /* (ROR is different format) */ unsigned int temp; reg = get_thumb_reg(line, &position, 0x00FF); /* First register */ if (reg >= 0) { temp = reg; if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } else error_code = SYM_BAD_REG | position; if (error_code == eval_okay) /* First register specifier read okay */ { reg = get_thumb_reg(line, &position, 0x00FF); if (reg >= 0) /* Second operand is a register too */ { temp = temp | (reg << 3); if (cmp_next_non_space(line, &position, 0, ',')) /* Any more? */ { if (cmp_next_non_space(line, &position, 0, '#')) /* (1) */ { /* Comma so immediate shift (probably) */ error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { unsigned int x; if ((token & 0x00300000) == 0x00000000) x = value; /* LSL */ else x = value - 1; /* ASR, LSR */ if ((x & ~0x1F) == 0) /* Range check (0-31 or 1-32) */ op_code = (op_code << 11) | ((value & 0x1F) << 6) | temp; else error_code = SYM_OORANGE; } } else error_code = SYM_ERR_SYNTAX | position; } else /* No comma so register shift */ op_code = 0x4000 | ((op_code + 2) << 6) | temp; /* (2) */ } else error_code = SYM_BAD_REG | position; /* 2nd op. not register */ } } break; case 0x00020000: /* ADD/SUB */ { unsigned int Rd_pos, Rn_pos; int Rd, Rn, Rm, imm; Rd_pos = position; Rd = get_reg(line, &position); if (Rd >= 0) { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; else if (cmp_next_non_space(line, &position, 0, '#')) /* Rd, #nn */ { error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { if (Rd < 8) /* (2) */ { if ((value & ~0xFF) == 0) { if (op_code == 0) op_code = 0x3000 | (Rd << 8) | value; else op_code = 0x3800 | (Rd << 8) | value; } else error_code = SYM_OORANGE; } else { if (Rd == 13) /* (7) */ { if ((value & ~0x1FC) == 0) { if (op_code == 0) op_code = 0xB000 | (value >> 2); else op_code = 0xB080 | (value >> 2); } else error_code = SYM_OORANGE; } else error_code = SYM_ERR_SYNTAX; } } } else /* Rd, Rn ... */ { Rn_pos = position; Rn = get_reg(line, &position); if (Rn >= 0) /* Should be another register by now */ { if (!cmp_next_non_space(line, &position, 0, ',')) /* (4) */ { if (op_code == 0) /* ADD */ { if (((Rd | Rn) & 8) == 0) /* Both low registers? */ op_code = 0x1800 | (Rn << 6) | (Rn << 3) | Rd; /* (3) */ else op_code = 0x4400 | ((Rd&8)<<4) | (Rn<<3) | (Rd&7); } else error_code = SYM_BAD_VARIANT; /* Not SUB */ } else /* Third operand reached */ { imm = cmp_next_non_space(line,&position,0,'#'); /* below */ if (Rd < 8) /* Should be so, here */ { if (Rn < 8) /* (1) or (3) */ { if (op_code==0) op_code = 0x1800; else op_code = 0x1A00; if (imm) /* (1) */ { error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { if ((value & ~0x7) == 0) op_code |= 0x0400 | (value << 6) | (Rn << 3) | Rd; else error_code = SYM_OORANGE; } } else /* (3) */ { Rm = get_thumb_reg(line, &position, 0x00FF); if (Rm >= 0) op_code |= (Rm << 6) | (Rn << 3) | Rd; else error_code = SYM_BAD_REG | position; } } else if (op_code == 0) /* ADD */ { if ((Rn | 0x2) == 0xF) /* (5) or (6) */ { if (imm) { if (Rn == 15) op_code = 0xA000; /* PC (5) */ else op_code = 0xA800; /* SP (6) */ error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { if ((value & ~0x3FC) == 0) op_code = op_code | Rd << 8 | (value >> 2); else error_code = SYM_OORANGE; } } else error_code = SYM_ERR_SYNTAX | position; } else error_code = SYM_BAD_REG | skip_spc(line, Rn_pos); } else error_code = SYM_BAD_VARIANT; /* Can't "SUB" */ } else error_code = SYM_BAD_REG | skip_spc(line, Rd_pos); } } else error_code = SYM_BAD_REG | skip_spc(line, Rn_pos); } } else error_code = SYM_BAD_REG | skip_spc(line, Rd_pos); } break; case 0x00030000: /* MOV/CMP */ { int Rd, Rm; unsigned int Rd_pos, Rm_pos; Rd_pos = position; Rd = get_reg(line, &position); if (Rd >= 0) { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; else if (cmp_next_non_space(line, &position, 0, '#')) /* Rd, #nn */ { /* (1) */ if (Rd < 8) { error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { if ((value & ~0xFF) == 0) { if (op_code == 0) op_code = 0x2000 | (Rd << 8) | value; else op_code = 0x2800 | (Rd << 8) | value; } else error_code = SYM_OORANGE; } } else error_code = SYM_BAD_REG | skip_spc(line, Rd_pos); } else { Rm_pos = position; Rm = get_reg(line, &position); if (Rm >= 0) { if (((Rm | Rd) & 8) == 0) /* Both low registers? */ { /* (2) */ if (op_code == 0) op_code = 0x1C00; else op_code = 0x4280; op_code = op_code | (Rm << 3) | Rd;/* MOV is really ADD # */ } else /* (3) */ { if (op_code == 0) op_code = 0x4600; else op_code = 0x4500; op_code |= ((Rd & 8) << 4) | (Rm << 3) | (Rd & 7); } } else error_code = SYM_BAD_REG | skip_spc(line, Rm_pos); } } else error_code = SYM_BAD_REG | skip_spc(line, Rd_pos); } break; case 0x00040000: /* Branches */ error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { value = value - (assembly_pointer + 4); if ((value & 1) != 0) /* Not halfword aligned */ error_code = SYM_UNALIGNED_BRANCH; else { if ((op_code & 0xF) == 0x000E) /* 11 bit branch range */ { if (((value & 0xFFFFF800) == 0x00000000) /* Out of range? */ || ((value & 0xFFFFF800) == 0xFFFFF800)) op_code = 0xE000 | ((value >> 1) & 0x000007FF); else error_code = SYM_OORANGE_BRANCH; } else { if (((value & 0xFFFFFF00) == 0x00000000) /* Out of range? */ || ((value & 0xFFFFFF00) == 0xFFFFFF00)) op_code = 0xD000 | ((op_code&0xF)<<8) | ((value>>1) & 0xFF); else error_code = SYM_OORANGE_BRANCH; } } } break; case 0x00050000: /* BX */ reg = get_reg(line, &position); if (reg >= 0) op_code = 0x4700 | (reg << 3); else error_code = SYM_BAD_REG | position; break; case 0x00060000: /* BL/BLX */ { unsigned int op, old_pos; op = op_code; /* Copy of operation type */ old_pos = position; reg = get_reg(line, &position); /* Don't prefilter here - want to know if PC specified */ if (reg >= 15) error_code = SYM_BAD_REG | skip_spc(line, old_pos); else { if (reg >= 0) { if (op != 0x0001) error_code = SYM_BAD_VARIANT; /* Not BLX */ else op_code = 0x4780 | (reg << 3); } else /* Fixed offset form */ { error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { value = value - (assembly_pointer + 4); if ((value & 1) != 0) /* Not halfword aligned */ error_code = SYM_UNALIGNED_BRANCH; else if (((value & 0xFFC00000) == 0x00000000) || ((value & 0xFFC00000) == 0xFFC00000)) { if (last_pass) { op_code = 0xF000 | ((value >> 12) & 0x07FF); byte_dump(assembly_pointer, op_code, line, 2); } extras = extras + 2; /* Count extra halfword */ if (op==0x0000) op_code = 0xF800 | ((value >> 1) & 0x07FF); else op_code = 0xE800 | ((value >> 1) & 0x07FE); } /* NB Bit 0 is cleared for BLX */ else error_code = SYM_OORANGE_BRANCH; } } } } break; case 0x00070000: /* SWI/BKPT */ error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { if ((value & ~0xFF) == 0) op_code = (op_code << 8) | value; else error_code = SYM_OORANGE; } break; case 0x00080000: /* Miscellany */ switch (op_code) { case 0x0000: op_code = 0x46C0; break; /* NOP (mov r8, r8) */ case 0x0001: op_code = 0xDE00; break; /* Undefined */ default: break; } break; case 0x00090000: /* Single register transfers */ { unsigned int Rd; boolean imm, no_offset; no_offset = FALSE; /* Used to amalgamate different syntaxes */ Rd = get_thumb_reg(line, &position, 0x00FF);/* Register to transfer */ if (Rd >= 0) { if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_ERR_SYNTAX | position; else { if (cmp_next_non_space(line, &position, 0, '[')) { unsigned int old_pos; old_pos = position; /* Survived to try for base register */ reg = get_reg(line, &position); /* Want `old_pos' in case mode disallowed */ if (!cmp_next_non_space(line, &position, 0, ',')) { if (line[position] == ']') no_offset = TRUE; /* No offset */ else error_code = SYM_ERR_SYNTAX | position; } if (error_code == eval_okay) { imm = no_offset /* No offset */ || cmp_next_non_space(line, &position, 0, '#');/* Immediate */ if (reg<0) error_code = SYM_BAD_REG | skip_spc(line, old_pos); else { switch (reg) /* Select according to base register */ { case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7: if (imm) /* R0-R7, immediate offset */ { if ((token & 0x00004000) != 0) /* Legal mode? */ { if (no_offset) value = 0; /* [Rn] form */ else error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) { int shifts;/* For immediate field justification */ if (!cmp_next_non_space(line, &position, 0, ']')) error_code = SYM_NO_RBR | position; else { switch (token & 0x00700000) { case 0x00000000: op_code=0x6000;break;/*STR */ case 0x00100000: op_code=0x8000;break;/*STRH*/ case 0x00200000: op_code=0x7000;break;/*STRB*/ case 0x00300000: op_code=0x0000;break; case 0x00400000: op_code=0x6800;break;/*LDR */ case 0x00500000: op_code=0x8800;break;/*LDRH*/ case 0x00600000: op_code=0x7800;break;/*LDRB*/ case 0x00700000: op_code=0x0000;break; } op_code = op_code | (reg << 3) | Rd; shifts = (token >> 24) & 3; if ((value & ~(0x1F<> 2; if (!cmp_next_non_space(line, &position, 0, ']')) error_code = SYM_NO_RBR | position; } else error_code = SYM_OORANGE; } } else error_code = SYM_BAD_VARIANT; break; default: error_code = SYM_BAD_VARIANT; break; } } } } else { if (line[position] == '=') { /* Literal pool stuff */ if ((token & 0xFFF00000) != 0x02400000) /* Only for LDR */ error_code = SYM_ADDR_MODE_BAD; else { position++; error_code = evaluate(line, &position, &value, symbol_table); if ((error_code == eval_okay) || allow_error(error_code, first_pass, last_pass)) { switch (do_literal(THUMB, TYPE_WORD, &value, first_pass, &error_code)) { case 0: /* Will fit in instruction */ op_code = 0x2000 | (Rd << 8) | value; /* => MOV */ break; case 1: printf("Assembler error: Thumb LDR=/MVN\n"); break; case 2: /* Needs full-blooded LDR */ op_code = thumb_pc_load(assembly_pointer, value, 0x4800, Rd, last_pass, &error_code); break; default: break; } } } } else /* Not '[' or '=' */ { /* Try for `absolute' address */ error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) op_code = thumb_pc_load(assembly_pointer, value, 0x4800, Rd, last_pass, &error_code); } } } } else error_code = SYM_BAD_REG | position; } break; case 0x000A0000: /* Multiple load/stores */ { unsigned int list; op_code = (op_code & 0xFF) << 8; if ((token & 0x0F000000) == 0x0C000000) /* LDM/STM */ { list = 0x00FF; /* Just R7-R0 */ reg = get_thumb_reg(line, &position, 0x00FF); if (reg < 0) error_code = SYM_BAD_REG | position; else { op_code = op_code | (reg << 8); /* Include base register */ if (!cmp_next_non_space(line, &position, 0, '!')) error_code = SYM_NO_BANG | position; else if (!cmp_next_non_space(line, &position, 0, ',')) error_code = SYM_NO_COMMA | position; } } else /* PUSH/POP */ { if ((token & 0x0FF00000) == 0x0B400000) list = 0x40FF;/* PUSH: LR */ else list = 0x80FF;/* POP: PC */ } if (error_code == eval_okay) /* Should be ready for register list */ { if (cmp_next_non_space(line, &position, 0, '{')) { list = parse_reg_list(list);/* Replace allowed with actual list */ if (error_code == eval_okay) { if ((list & 0xC000) != 0) op_code = op_code | 0x0100; op_code = op_code | (list & 0xFF); if (!cmp_next_non_space(line, &position, 0, '}')) error_code = SYM_NO_RSQUIGGLE | position; } } else error_code = SYM_NO_REGLIST | position; } } break; case 0x000B0000: /* ADR */ { /* Only single instruction ops. at present */ if ((reg = get_thumb_reg(line, &position, 0x00FF)) >= 0) { if (cmp_next_non_space(line, &position, 0, ',')) { error_code = evaluate(line, &position, &value, symbol_table); if (error_code == eval_okay) op_code = thumb_pc_load(assembly_pointer, value, 0xA000, reg, last_pass, &error_code); } else error_code = SYM_NO_COMMA | position; /* ',' not found */ } else error_code = SYM_BAD_REG | position; /* Rd not found */ } break; default: printf("Unprocessable opcode!\n"); break; } } if (error_code == eval_okay) { if (last_pass) byte_dump(assembly_pointer + extras, op_code, line, 2); } else { if (!last_pass) { if (allow_error(error_code, first_pass, last_pass)) error_code = eval_okay; /* Pretend we're okay */ } else /* Error on final pass */ byte_dump(assembly_pointer + extras, 0, line, 2); /* Dump 0x0000 place holder */ } assembly_pointer = assembly_pointer + 2 + extras; return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Separated out so other functions (e.g. "ARM") can call it too. */ void do_align() { int fill; error_code = evaluate(line, &position, &operand, symbol_table); if ((error_code & 0xFFFFFF00) == eval_no_operand) /* Code - position */ { error_code = eval_okay; if (instruction_set == THUMB) operand = 2; /* Thumb default = 2 */ else operand = 4; /* else default = 4 */ } if (error_code == eval_okay) { if (operand != 0) { /* (ALIGN 0 has no effect) */ temp = (assembly_pointer - 1) % operand; operand = operand - (temp + 1); /* No. of elements to skip(/fill) */ } if ((fill = (line[position] == ','))) /*Note where any label should go*/ fill_space(operand); /* Fill with value (?) */ else /* Start new section if leaving gap */ { //dumping literals inside ALIGN @@@ //literal_dump(last_pass, line, assembly_pointer + operand); //printf("Hello?\n"); if (fList != NULL) list_start_line(assembly_pointer+operand, FALSE); /* Revise list file address */ if (operand != 0) elf_new_section_maybe(); /* Only reorigin in needed */ } } if (error_code == eval_okay) /* Still OK? */ { if (fill) /* Any label is at source point */ assemble_redef_label(assembly_pointer, assembly_pointer_defined, my_label, &error_code, 0, pass_count, last_pass, line); else /* Any label is after alignment */ assemble_redef_label(assembly_pointer + operand, assembly_pointer_defined, my_label, &error_code, 0, pass_count, last_pass, line); assembly_pointer = assembly_pointer + operand; } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ error_code = eval_okay; /* #DEFINE ?? @@@@ */ first_pass = (pass_count == 0); evaluate_own_label = my_label; /* Yuk! @@@@@ */ /* Global, to pass local label definition to evaluate */ if (((token & 0xF4000000) != 0xF4000000) && (my_label->sort == MAYBE_SYMBOL)) sym_add_to_table(symbol_table, my_label->symbol); /* Must be a label */ if (((token & 0xF8000000) != 0xF8000000) && (my_label->sort != NO_LABEL)) /* Redefine label if present/required unless directive such as EQU */ assemble_redef_label(assembly_pointer, assembly_pointer_defined, my_label, &error_code, 0, pass_count, last_pass, line); def_increment = 0; /* Default to first position/item on line */ if (error_code == eval_okay) { //### Check this error trap correct. if ((token & 0xF0000000) == 0xF0000000) { /* Directive */ switch (token) { /* Defining code */ case 0xF0000000: assemble_define(1); break; /* DEFB */ case 0xF0010000: assemble_define(2); break; /* DEFH */ case 0xF0020000: assemble_define(4); break; /* DEFW */ case 0xF0030000: /* DEFS */ error_code = evaluate(line, &position, &operand, symbol_table); if (allow_error(error_code, first_pass, last_pass)) error_code = eval_okay; if (error_code == eval_okay) { if (line[position] == ',') fill_space(operand);/*Fill with value (?)*/ else /* Reorigin ELF by starting new section */ if (operand != 0) elf_new_section_maybe(); /* Reorigin in needed */ if (error_code == eval_okay) assembly_pointer += operand;/*Still OK?*/ } break; case 0xF0040000: /* EXPORT */ { boolean terminate; int i; char ident[LINE_LENGTH]; sym_record *symbol; terminate = FALSE; while (!terminate) { position = skip_spc(line, position); if ((i = get_identifier(line, position, ident, LINE_LENGTH)) > 0) { if (last_pass) /* Only care when about to complete */ { if ((i == 3) && ((ident[0] & 0xDF) == 'A') /* Bodgy test */ && ((ident[1] & 0xDF) == 'L') && ((ident[2] & 0xDF) == 'L')) symbol_table->flags |= SYM_TAB_EXPORT_FLAG; /*Mark whole table*/ else { if ((symbol = sym_find_label(ident, symbol_table)) != NULL) symbol->flags |= SYM_REC_EXPORT_FLAG; else error_code = SYM_ERR_NO_EXPORT; } } position = position + i; } else { error_code = SYM_ERR_SYNTAX | position; terminate = TRUE; } if (!cmp_next_non_space(line, &position, 0, ',')) terminate = TRUE; } } break; case 0xF0050000: /* INCLUDE */ { // Allow " " around name? @@@ int i; position = skip_spc(line, position); if (test_eol(line[position])) /* Effective EOL? */ { error_code = SYM_ERR_NO_FILENAME | position; /* Filename missing */ } else { /* Got name; make and fill buffer */ *include_name = (char*) malloc(LINE_LENGTH+1); /* Overkill-so what? */ i = 0; while (!test_eol(line[position]) && (line[position] != ' ') && (line[position] != '\t')) (*include_name)[i++] = line[position++]; (*include_name)[i] = '\0'; /* Terminate filename string */ } } break; case 0xF0060000: /* LITERAL */ literal_dump(last_pass, line, 0); /* Get rid of any pending literals */ if (my_label->sort != NO_LABEL) error_code = SYM_NO_LABELS; break; case 0xF0070000: /* ARCH */ { int arch; arch = get_thing(line, &position, arch_table); if (arch >= 0) arm_variant = arch; else error_code = SYM_ERR_SYNTAX | position; } break; case 0xF0080000: /* ENTRY */ if (!entry_address_defined) { entry_address = assembly_pointer; entry_address_defined = TRUE; } else error_code = SYM_DOUBLE_ENTRY; break; case 0xF0090000: /* ARM */ instruction_set = ARM; do_align(); /* Automatic realignment (correct choice of action?) */ break; case 0xF00A0000: /* THUMB */ instruction_set = THUMB; break; case 0xF00B0000: /* SET variable */ { char name[SYM_NAME_MAX]; // @@@ Size of buffer (also below) int j; position = skip_spc(line, position); if ((j = get_identifier(line, position, name, SYM_NAME_MAX)) != 0) { /* Element=>buffer */ position = position + j; if (cmp_next_non_space(line, &position, 0, ',')) { int value; sym_record *variable, *temp; error_code = evaluate(line, &position, &value, variable_table); if (first_pass) /* Insist on resolving these on Pass 0 */ { temp = sym_create_record(name, 0, 0, variable_table->flags); variable = sym_find_record(variable_table, temp); /* Search */ if (variable != NULL) { /* Already defined once */ sym_delete_record(temp); /* Lose temporary record */ if (variable->value != value) error_code = SYM_VAR_INCONSISTENT; } else { temp->value = value; temp->flags = SYM_USER_VARIABLE | SYM_REC_DEF_FLAG; sym_add_to_table(variable_table, temp); } } // Unify with label handling code (?) //##@@ } else error_code = SYM_NO_COMMA | position; } else error_code = SYM_NO_IDENTIFIER | position; } break; case 0xF00C0000: /* IF */ { char name[SYM_NAME_MAX]; // @@@ Size of buffer (also below) int j, condition; if (if_SP >= IF_STACK_SIZE) error_code = SYM_MANY_IFS; else { position = skip_spc(line, position); if ((j = get_identifier(line, position, name, SYM_NAME_MAX)) != 0) { /* Element=>buffer */ position = position + j; condition = (sym_find_label(name, variable_table) != NULL); // Should be logical expression @@@ if_stack[++if_SP] = condition; } else error_code = SYM_NO_IDENTIFIER | position; } } break; case 0xF00D0000: /* FI */ if (if_SP > 0) if_SP--; else error_code = SYM_MANY_FIS; break; case 0xF00E0000: /* ELSE */ if (if_SP > 0) if_stack[if_SP] = !if_stack[if_SP]; else error_code = SYM_LOST_ELSE; break; /* Defining label */ case 0xF8000000: /* EQU */ error_code = evaluate(line, &position, &temp, symbol_table); if (my_label->symbol != NULL) assemble_redef_label(temp, TRUE, my_label, &error_code, SYM_REC_EQU_FLAG, pass_count, last_pass, line); else error_code = SYM_ERR_NO_EQU; break; case 0xF8010000: /* ORG */ error_code = evaluate(line, &position, &assembly_pointer, symbol_table); assembly_pointer_defined = (error_code == eval_okay); /* Result may be `undefined' */ if (allow_error(error_code, first_pass, last_pass)) error_code = SYM_NO_ERROR;/* ORG undefined -itself- is not an error */ if (fList != NULL) list_start_line(assembly_pointer, FALSE); /* Revise list file address */ assemble_redef_label(assembly_pointer, assembly_pointer_defined, my_label, &error_code, 0, pass_count, last_pass, line); elf_new_section_maybe(); /* else reuse previous (unused) number */ break; case 0xF8020000: /* ALIGN */ do_align(); break; case 0xF8030000: /* RECORD */ error_code = evaluate(line, &position, &temp, symbol_table); if (((error_code & 0xFFFFFF00) == eval_no_operand) || allow_error(error_code, first_pass, last_pass)) { temp = 0; /* If no operand found then assume zero start */ error_code = eval_okay; } if (error_code == eval_okay) { data_pointer = temp; assemble_redef_label(data_pointer, TRUE, my_label, &error_code, SYM_REC_DATA_FLAG, pass_count, last_pass, line); } break; case 0xF8040000: /* REC_ALIGN */ error_code = evaluate(line, &position, &temp, symbol_table); if (((error_code & 0xFFFFFF00) == eval_no_operand) || allow_error(error_code, first_pass, last_pass)) { temp = 4; error_code = eval_okay; } if (error_code == eval_okay) { if (temp != 0) data_pointer = data_pointer-(data_pointer%temp)+temp; /* Any label is after alignment */ assemble_redef_label(data_pointer, TRUE, my_label, &error_code, SYM_REC_DATA_FLAG, pass_count, last_pass, line); } break; case 0xF8100000: /* ALIAS */ case 0xF8110000: /* BYTE */ case 0xF8120000: /* HALFWORD */ case 0xF8140000: /* WORD */ case 0xF8180000: /* DOUBLE */ { unsigned int size; size = (token >> 16) & 0xF; /* Size of one element */ error_code = evaluate(line, &position, &temp, symbol_table); if (((error_code & 0xFFFFFF00) == eval_no_operand) || allow_error(error_code, first_pass, last_pass)) { temp = 1; /* If no operand found then assume one element */ error_code = eval_okay; } if (error_code == eval_okay) { assemble_redef_label(data_pointer, TRUE, my_label, &error_code, SYM_REC_DATA_FLAG, pass_count, last_pass, line); data_pointer = data_pointer + (temp * size); } } break; case 0xF4000000: /* RN */ if (first_pass) /* Must be resolved on first pass */ { if (my_label->sort == MAYBE_SYMBOL) { if ((my_label->symbol->value = get_reg(line, &position)) >= 0) redefine_symbol(line, my_label->symbol, register_table); else error_code = SYM_BAD_REG | position; } else error_code = SYM_ERR_NO_EQU; } break; case 0xF4010000: /* CN */ if (first_pass) /* Must be resolved on first pass */ { if (my_label->sort == MAYBE_SYMBOL) { if ((my_label->symbol->value = get_creg(line, &position)) >= 0) redefine_symbol(line, my_label->symbol, cregister_table); else error_code = SYM_BAD_REG | position; } else error_code = SYM_ERR_NO_EQU; } break; case 0xF4020000: /* CP */ if (first_pass) /* Must be resolved on first pass */ { if (my_label->sort == MAYBE_SYMBOL) { if ((my_label->symbol->value = get_copro(line, &position)) >= 0) redefine_symbol(line, my_label->symbol, copro_table); else error_code = SYM_BAD_COPRO | position; } else error_code = SYM_ERR_NO_EQU; } break; default: error_code = SYM_ERR_BROKEN; break; } } else { switch (instruction_set) { case ARM: arm_mnemonic(); break; case THUMB: thumb_mmemonic(); break; default: printf("Got into an undefined instruction set :-(\n"); break; } } }// ### if (first_pass && (error_code == eval_okay)) { /* Check that nothing remains on line (first pass only) */ position = skip_spc(line, position); if (!test_eol(line[position])) error_code = SYM_GARBAGE | position; } return error_code; } /*----------------------------------------------------------------------------*/ /* Fully parameterised utility routines */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Look up a value in a symbol table. */ /* Intended to recover positive values only; returns -1 if not found. */ #define THING_BUFFER_LENGTH 16 int get_thing(char *line, unsigned int *pos, sym_table *table) { int i, result; char buffer[THING_BUFFER_LENGTH]; sym_record *ptr; *pos = skip_spc(line, *pos); result = -1; /* Not found code */ if ((i = get_identifier(line, *pos, buffer, THING_BUFFER_LENGTH)) > 0) { /* Something taken */ if ((ptr = sym_find_label(buffer, table)) != NULL) { /* Symbol recognised */ result = ptr->value; *pos += i; } } return result; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int get_reg(char *line, unsigned int *pos) /* Expand into code? @@@@ */ { return get_thing(line, pos, register_table); } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Like get_reg but accepts a mask of which subset of registers are allowed. */ /* If mask doesn't match then leaves *pos at start of symbol. */ int get_thumb_reg(char *line, unsigned int *pos, unsigned int reg_mask) { int reg; unsigned int start_pos; start_pos = *pos; reg = get_thing(line, pos, register_table); /* Allowed register? */ if ((reg >= 0) && (((1 << reg) & reg_mask) == 0)) { reg = -1; *pos = skip_spc(line, start_pos); /* Back off pointer (to error position) */ } return reg; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int get_creg(char *line, unsigned int *pos) { return get_thing(line, pos, cregister_table); } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int get_copro(char *line, unsigned int *pos) { return get_thing(line, pos, copro_table); } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int get_psr(char *line, unsigned int *pPos) { int reg; if ((line[*pPos] & 0xDF) == 'C') reg = 0x00; /* Possibly CPSR */ else if ((line[*pPos] & 0xDF) == 'S') reg = 0x40; /* Possibly SPSR */ else reg = -1; /* Definitely not found */ if (reg >= 0) { if (((line[(*pPos) + 1] & 0xDF) == 'P') && ((line[(*pPos) + 2] & 0xDF) == 'S') && ((line[(*pPos) + 3] & 0xDF) == 'R')) { *pPos = *pPos + 4; if (line[(*pPos)] != '_') reg = reg | 0x0F; /* Assume "_all" as default */ else /* Search out fields and assemble field mask */ { boolean okay; okay = TRUE; (*pPos)++; while (okay) switch (line[*pPos]) { case 'F': case 'f': reg = reg | 0x08; (*pPos)++; break; case 'S': case 's': reg = reg | 0x04; (*pPos)++; break; case 'X': case 'x': reg = reg | 0x02; (*pPos)++; break; case 'C': case 'c': reg = reg | 0x01; (*pPos)++; break; default: okay = FALSE; break; } } } else reg = -1; /* Not found after all */ } return reg; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int get_shift(char *line, unsigned int *pos) { int result, flag; *pos = skip_spc(line, *pos); if (line[*pos] == ',') { flag = -1; (*pos)++; } /* Allow -optional- ',' */ else { flag = 0; } result = get_thing(line, pos, shift_table); if (result < 0) result = result + flag; /* Signify ',' but not shift found */ return result; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Change a 32-bit value into a 4-bit ROR + 8-bit immediate form; -1 if can't */ int data_op_imm(unsigned int value) /* Not particularly efficient */ { unsigned int i; boolean found; unsigned int rol32(unsigned int x, unsigned int j) { return (((x & 0xFFFFFFFF) >> (32 - j)) | (x << j)) & 0xFFFFFFFF; } found = FALSE; i = 0; while ((i < 16) && !found) { if ((rol32(value, 2*i) & 0xFFFFFF00) == 0) found = TRUE; else i++; } if (found) return rol32(value, 2*i) | (i << 8); else return -1; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ unsigned int thumb_pc_load(unsigned int here, unsigned int there, unsigned int op_code, int reg, int last_pass, unsigned int *error_code) { there = there - ((here & ~0x00000002) + 4); /* Calculate offset */ if ((there & ~0x000003FC) == 0) op_code = op_code | (reg << 8) | (there >> 2); else if (last_pass) { if ((there & 3) != 0) *error_code = SYM_MISALIGNED; else *error_code = SYM_OFFSET_TOO_BIG; } return op_code; } /*----------------------------------------------------------------------------*/ /* Refetch first identifier from source line (in case it was truncated) and */ /* re-hash into old symbol with appropriate rules. */ void redefine_symbol(char *line, sym_record *record, sym_table *table) { char ident[LINE_LENGTH]; get_identifier(line, skip_spc(line, 0), ident, LINE_LENGTH); sym_string_copy(ident, record, table->flags); sym_add_to_table(table, record); return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Redefine a label on the current line */ void assemble_redef_label(unsigned int value, int defined, own_label *my_label, unsigned int *error_code, int type_change, int pass_count, int last_pass, char *line) { int value_defined; /* Genuine value supplied */ unsigned int old_value; int flags; if (my_label->sort != NO_LABEL) /* Reject cases that don't apply */ { if ((my_label->sort == SYMBOL) || (my_label->sort == MAYBE_SYMBOL)) { /* Symbolic (ordinary) label on current line */ old_value = my_label->symbol->value; flags = my_label->symbol->flags; } else if (my_label->sort == LOCAL_LABEL) { /* Local label on current line */ old_value = my_label->local->value; flags = my_label->local->flags; } value_defined = (*error_code == eval_okay) && defined; // Clumsy - 2 parameters @@ if ((pass_count != (flags & 0xFF)) /* First encounter this pass? */ || ((flags & SYM_REC_DEF_FLAG) == 0)) /* or was undefined */ { /* Treat as new encounter */ if (value_defined) /* New value is defined value */ { if (((flags & SYM_REC_DEF_FLAG) == 0) /* Undefined ... */ || (old_value != value)) /* ...or changed */ { if ((flags & SYM_REC_DEF_FLAG) == 0) defined_count++; /* Undefined */ else redefined_count++; /* Note what was done */ flags |= SYM_REC_DEF_FLAG; /* Mark as defined */ } } else { flags &= ~SYM_REC_DEF_FLAG; /* Mark label as undefined */ if (allow_error(*error_code, pass_count==0, last_pass)) *error_code = SYM_NO_ERROR; // But flag up something @@@@ } } else { /* Repeat encounter with defined label */ if (!value_defined || (value != old_value)) /* Different! */ *error_code = SYM_INCONSISTENT; } flags = (flags & 0xFFFFFF00) | pass_count; if ((my_label->sort == SYMBOL) || (my_label->sort == MAYBE_SYMBOL)) { /* Symbolic (ordinary) label on current line */ my_label->symbol->value = value; my_label->symbol->flags = flags; } else if (my_label->sort == LOCAL_LABEL) { /* Local label on current line */ my_label->local->value = value; my_label->local->flags = flags; } if (type_change != 0) /* Maybe want to override type */ { if (my_label->sort == LOCAL_LABEL) my_label->local->flags |= type_change; /* `type' indicator */ else my_label->symbol->flags |= type_change; /* `type' indicator */ } } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Dump any pending literal records into code */ /* `last_pass' is a boolean which enables code dumping */ /* `line' is the input source line */ /* `limit' is a dump address not to exceed, unless 0 which indicates no limit */ void literal_dump(int last_pass, char *line, unsigned int limit) { unsigned int address; /* Needed because assembly pointer is static */ /* for each `instruction' in the list file */ unsigned int size; /* Each plant aligns to the appropriate boundary */ int i; char *align_message = "(padding)"; char *my_message; address = assembly_pointer; my_message = align_message; /* In case we need to align first */ // For dumping inside ALIGN etc. @@@ //while ((literal_tail != literal_head) /* Strip any unwanted entries at start */ // && (literal_tail != NULL) // && ((literal_tail->flags & LIT_NO_DUMP) != 0)) // if (literal_tail == NULL) literal_tail = literal_list; // else literal_tail = literal_tail->pNext; while ((literal_tail != literal_head) && ((limit == 0) || ((address + (((literal_tail->flags & LIT_HALF) != 0) ? 2 : 4)) <= limit))) { /* Something to dump and space to dump it in */ if (literal_tail == NULL) literal_tail = literal_list; else literal_tail = literal_tail->pNext; if ((literal_tail->flags & LIT_HALF) == 0) size = 4; else size = 2; if ((literal_tail->flags & LIT_NO_DUMP) == 0) /* If -not- converted to MOV */ { for (i = 0 ; ((address + i) & (size - 1)) != 0; i++) /* Align */ if (last_pass) byte_dump(address + i, 0, my_message, 1); /* Padded */ /* Padding avoids need to mess about with sections in elf output */ address = address + i; /* Step, even if not planting */ if ((fList != NULL) && ((i != 0) /* Needed to align first */ || ((size == 4) && ((list_byte % 4) != 0)))) /* or unaligned for word */ { /* Start new list line if alignment was needed */ list_end_line(my_message); list_start_line(address, (my_message == line)); /* May *continue' */ } } if ((literal_tail->flags & LIT_DEFINED) == 0) undefined_count++; // Is this a "label"?? @@@ else { if (address != literal_tail->address) redefined_count++; // Is this a "label"?? @@@ /* Addr. change => offset may change => other literals (/labels) may move */ } literal_tail->address = address; /* Note dump address in record anyway */ if ((literal_tail->flags & LIT_NO_DUMP) == 0) /* If -not- converted to MOV */ { my_message = line; /* Real output line (if any) now */ if (last_pass) byte_dump(address, literal_tail->value, line, size);/*Plant*/ address = address + size; /* Step on */ } } for (i = 0 ; ((address + i) & 3) != 0; i++) /* Realign to word boundary */ if (last_pass) byte_dump(address + i, 0, line, 1); /* padding, if needed */ assembly_pointer = address + i; /* Finally, allow global modification */ return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ FILE *open_output_file(int std, char *filename) { if (std) return stdout; else if (filename[0] != '\0') return fopen(filename, "w"); // Ignores errors if any @@@ else return NULL; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void close_output_file(FILE *handle, char *filename, int errors) { if ((handle != stdout) && (handle != NULL)) { fclose(handle); if (errors) remove(filename); } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Prepare the list output buffer at the start of a line. */ void list_start_line(unsigned int address, int cont) { list_byte = 0; if (!cont) list_line_position = 0; list_address = address; return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ // Parameterisation a bit dubious; due for re-analysis & revision @@@@ void list_mid_line(unsigned int value, char *line, int size) { if (list_byte == 0) /* At start of first line */ list_buffer_init(line, list_byte, TRUE); /* Zero output buffer */ else if (((list_byte % 4) == 0) /* Start of another line */ || (((list_byte % 4) + size) > 4)) /* or about to overflow */ { if (list_byte != 0) list_file_out(); /* Dump buffer (?) */ list_buffer_init(line, list_byte, TRUE); /* Zero output buffer */ } list_hex(value, 2 * size, &list_buffer[10 + 3 * (list_byte % 4)]); list_byte = list_byte + size; return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void list_end_line(char *line) { if (list_byte == 0) list_buffer_init(line, list_byte, TRUE); /* No bytes were dumped */ list_file_out(); /* Deal with any continuation lines */ while (line[list_line_position] != '\0') { list_buffer_init(line, 0, FALSE); list_file_out(); } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Listing line dumped to appropriate file */ /* Excessive use of globals (?? @@) */ void list_file_out(void) { if (dump_code && (fList != NULL)) fprintf(fList, "%s\n", list_buffer); /* Shouldn't reach here unless there -is- an output file */ return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Add the symbol table to the list file */ void list_symbols(FILE *fList, sym_table *table) { unsigned int sym_count; sym_record *sorted_list, *pSym; int i; sym_count = sym_count_symbols(table, ALL); if (sym_count > 0) fprintf(fList, "\nSymbol Table: %s\n", table->name); { sorted_list = sym_sort_symbols(table, ALL, DEFINITION); /* Generate record list */ pSym = sorted_list; while (pSym != NULL) { fprintf(fList, ": "); for (i = 0; i < SYM_NAME_MAX; i++) { if (i < pSym->count) fprintf(fList, "%c", pSym->name[i]); else fprintf(fList, " "); } if ((pSym->flags & SYM_REC_DEF_FLAG) != 0) fprintf(fList, " %08X", pSym->value); else fprintf(fList, " 00000000"); //, pSym->value); if ((pSym->flags&SYM_REC_EQU_FLAG) !=0) fprintf(fList," Value"); else if ((pSym->flags&SYM_REC_DATA_FLAG) !=0) fprintf(fList," Offset"); else if ((pSym->flags&SYM_REC_DEF_FLAG) ==0) fprintf(fList," Undefined"); else { if ((pSym->flags&SYM_REC_EXPORT_FLAG)!=0) fprintf(fList," Global -"); else fprintf(fList," Local --"); if ((pSym->flags&SYM_REC_THUMB_FLAG)==0) fprintf(fList, " ARM"); else fprintf(fList, " Thumb"); } fprintf(fList, "\n"); pSym = pSym->pNext; } sym_delete_record_list(&sorted_list, FALSE); /* Destroy temporary list */ } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void list_buffer_init(char *line, unsigned int offset, int do_address) { int i; for (i = 0; i < LIST_BYTE_FIELD; i++) list_buffer[i] = ' '; if (do_address) { list_hex(list_address + offset, 8, &list_buffer[0]); list_buffer[8] = ':'; } list_buffer[LIST_BYTE_FIELD - 2] = ';'; for (i = 0; (i < LIST_LINE_LIST) && (line[list_line_position] != '\0'); i++, list_line_position++) { if (line[list_line_position] != '\t') /* Not a TAB */ list_buffer[LIST_BYTE_FIELD + i] = line[list_line_position]; else { /* Expand TAB into list line (space to column # next multiple of 8) */ do /* "DO" to guarantee at least one space */ { list_buffer[LIST_BYTE_FIELD + i] = ' '; i++; } while (((i % 8) != 0) && (i < LIST_LINE_LIST)); i--; /* DO loop post-increments; so does surrounding FOR, so step back */ } } list_buffer[LIST_BYTE_FIELD + i] = '\0'; /* Terminate buffer */ return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Create a new, empty symbol table with given attributes. */ /* On input: name is a zero terminated ASCII string, given to the table */ /* flags contain the associated attributes */ /* Returns: pointer (handle) for the table (NULL on failure) */ sym_table *sym_create_table(char *name, unsigned int flags) { sym_table *new_table; int i; for (i = 0; name[i] != '\0'; i++);/* Find length of string (excl. terminator) */ new_table = (sym_table*) malloc(SYM_TABLE_SIZE); /* Allocate header */ if (new_table != NULL) { new_table->name = (char*) malloc(i+1); /* Allocate name string */ if (new_table->name == NULL) { /* Problem - tidy up and leave */ free(new_table); new_table = NULL; } else { new_table->symbol_number = 0; /* Next unique identifier for record */ while (i >= 0) {new_table->name[i] = name[i]; i--;}/* Includes terminator */ new_table->flags = flags; for (i = 0; i < SYM_TAB_LIST_COUNT; i++) /* Initialise linked lists */ new_table->pList[i] = NULL; } } return new_table; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Delete a symbol table, including all its contents, unless records are both */ /* wanted and marked for export. */ /* On input: old_table is the symbol table for destruction */ /* export is a Boolean - TRUE allows records marked for export to */ /* retained */ /* Returns: Boolean - TRUE if some of the table remains */ int sym_delete_table(sym_table *old_table, boolean export) { int i; boolean some_kept; some_kept = export && ((old_table->flags & SYM_TAB_EXPORT_FLAG) != 0); if (!some_kept) /* Not exporting whole table */ for (i=0; ipList[i]), export)) some_kept = TRUE; if (!some_kept) { free(old_table->name); free(old_table); } /* Free, if poss. */ return some_kept; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Define a label with the given name, value and attributes in the specified */ /* symbol table. Allocates memory as appropriate (linked into symbol table). */ /* On input: *name points to a string which is the label name */ /* value holds the value for definition */ /* flags holds the attributes */ /* table points to an existing symbol table */ /* **record defines a pointer for a return value */ /* Returns: enumerated type indicating the action taken */ /* pointer to the appropriate record in var. specified by **record */ defn_return sym_define_label(char *name, unsigned int value, unsigned int flags, sym_table *table, sym_record **record) { sym_record *ptr1, *ptr2; defn_return result; ptr1 = sym_create_record(name, value, flags | SYM_REC_DEF_FLAG, table->flags); if ((table == NULL) || (ptr1 == NULL)) result = SYM_REC_ERROR; /* Oooer! */ else { if ((ptr2 = sym_find_record(table, ptr1)) == NULL) /* Label already exists? */ { sym_add_to_table(table, ptr1); /* No - add the new record */ *record = ptr1; /* Point at new record */ result = SYM_REC_ADDED; } else { if ((ptr2->flags & SYM_REC_DEF_FLAG) == 0) /* Undefined? */ { ptr2->flags |= SYM_REC_DEF_FLAG; /* First definition of existing label */ ptr2->value = ptr1->value; /* Update value */ result = SYM_REC_DEFINED; } else if (ptr2->value != ptr1->value) /* Value different? */ { ptr2->value = ptr1->value; /* Update value */ result = SYM_REC_REDEFINED; } else result = SYM_REC_UNCHANGED; *record = ptr2; /* Point at discovered record */ sym_delete_record(ptr1); /* Trash temporary record */ } } return result; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Locate a label with the given name and attributes in the specified symbol */ /* table. Creates the entry if it wasn't there. The value is undefined. */ /* Allocates memory as appropriate (linked into symbol table). */ /* On input: *name points to a string which is the label name */ /* flags holds the attributes */ /* table points to an existing symbol table */ /* **record defines a pointer for a return value */ /* Returns: TRUE if the record was found (previously existed) */ /* pointer to the appropriate record in var. specified by **record */ int sym_locate_label(char *name, unsigned int flags, sym_table *table, sym_record **record) { sym_record *ptr1, *ptr2; boolean result; //defn_return result; ptr1 = sym_create_record(name, 0, flags & ~SYM_REC_DEF_FLAG, table->flags); if ((ptr2 = sym_find_record(table, ptr1)) == NULL) /* Label already exists? */ { *record = ptr1; /* Point at new record */ result = FALSE; } else { sym_delete_record(ptr1); /* Trash temporary record */ *record = ptr2; /* Point at discovered record */ result = TRUE; } return result; } // Errors? (If allocation fails?) @@@@@@ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Find a label (by name) in the designated list of tables. */ /* On input: name points to a string which is the label name */ /* table points to an existing list of symbol tables */ /* Returns: pointer to record (NULL if not found) */ sym_record *sym_find_label_list(char *name, sym_table_item *item) { sym_table *table; sym_record *result; result = NULL; /* In case nothing in list */ while ((item != NULL) && (result == NULL)) /* Terminate if EOList or found */ { table = item->pTable; if (table != NULL) result = sym_find_label(name, table); item = item->pNext; } return result; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Find a label (by name) in the designated table. */ /* On input: name points to a string which is the label name */ /* table points to an existing symbol table */ /* Returns: pointer to record (NULL if not found) */ sym_record *sym_find_label(char *name, sym_table *table) { sym_record *temp, *result; temp = sym_create_record(name, 0, 0, table->flags); /* Hash name */ result = sym_find_record(table, temp); /* Search */ sym_delete_record(temp); /* Lose temporary record */ return result; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Create a new symbol record, complete with hashing etc. */ /* On input: name is the label name (ASCII string) */ /* value is the initial value for the record */ /* flags define other aspects of the record */ /* global_flags define the symbol table properties */ /* Returns: pointer to allocated record (NULL if this failed) */ sym_record *sym_create_record(char *name, unsigned int value, unsigned int flags, unsigned int global_flags) { sym_record *new_record; new_record = (sym_record*) malloc(SYM_RECORD_SIZE); /* Allocate record */ if (new_record != NULL) { sym_string_copy(name, new_record, global_flags); new_record->pNext = NULL; new_record->value = value; new_record->flags = flags; } return new_record; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Delete a single linked list of symbol records. */ /* Will retain records marked for export if requested to. */ /* On input: ptr1 is the adddress of the start of list pointer */ /* export is a Boolean indicating that records may be retained */ /* Returns: TRUE if any records have been kept */ int sym_delete_record_list(sym_record **ptr1, int export) { boolean some_kept; sym_record *ptr2, *ptr3; /* Current and next records; ptr1 => current pointer */ some_kept = FALSE; /* Default to keeping nothing */ while (*ptr1 != NULL) /* While not end of list ... */ { ptr2 = *ptr1; /* Record for consideration */ if (!export || ((ptr2->flags & SYM_REC_EXPORT_FLAG) == 0)) { /* Delete record */ ptr3 = ptr2->pNext; /* Salvage link to next record */ *ptr1 = ptr3; /* Point previous link past current record */ sym_delete_record(ptr2); /* Trash current record */ } else { ptr1 = &ptr2->pNext; /* Move on ... */ some_kept = TRUE; /* Noting that something was retained */ } } return some_kept; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Delete a single symbol record */ void sym_delete_record(sym_record *old_record) { /* Can deallocate strings etc. if such have been allocated @@ */ free(old_record); return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Add record to appropriate part of table (front of list) */ int sym_add_to_table(sym_table *table, sym_record *record) { unsigned int list; /* Which data substructure is used */ if (table != NULL) { list = record->hash & SYM_TAB_LIST_MASK; record->identifier = table->symbol_number++; /* Allocate unique record No */ record->pNext = table->pList[list]; table->pList[list] = record; return SYM_NO_ERROR; } else return SYM_NO_TABLE; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Search for record's twin in specified table and return a pointer. */ /* Returns NULL if not found. */ sym_record *sym_find_record(sym_table *table, sym_record *record) { sym_record *ptr; boolean found; int i; if (table != NULL) { ptr = table->pList[record->hash & SYM_TAB_LIST_MASK]; /* Correct list start */ found = FALSE; while ((ptr != NULL) && !found) { if ((ptr->hash == record->hash) && (ptr->count == record->count)) { i = 0; found = TRUE; /* Speculation, at present */ while ((i < ptr->count) && found) /* Scan string */ { found = (ptr->name[i] == record->name[i]); /* Not found after all? */ i++; } } if (!found) ptr = ptr->pNext; /* If not found, try again */ } return ptr; } else return NULL; /* If table pointer not valid, not found */ } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Copy a string into a specified record, including case conversion, */ /* generating hash functions, etc. */ void sym_string_copy(char *string, sym_record *record, unsigned int table_flags) { unsigned int hash, count; int case_insensitive; char c; case_insensitive = ((table_flags & SYM_TAB_CASE_FLAG) != 0); count = 0; hash = 0; while ((c = string[count]) != '\0') { if (case_insensitive && (c >= 'a') && (c <= 'z')) c = c&0xDF; /* Case conv? */ if (count < SYM_NAME_MAX) record->name[count] = c; /* Keep characters whilst there is space */ hash = (((hash<<5) ^ (hash>>11)) + c); /* Crude but spreads LSBs */ count++; } /* Doesn't copy the terminator */ record->count = count; record->hash = hash; return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Make up an array of all the strings in the symbol table */ /* Used for ELF symbol table output */ char *sym_strtab(sym_record *start, unsigned int count, unsigned int *length) { unsigned int index, i; char *array; sym_record *ptr; ptr = start; *length = 1; /* For null string at start */ /* Measure space for symbol strings */ while (ptr != NULL) { *length = *length + ptr->count + 1; ptr = ptr->pNext; } *length = (*length + 3) & 0xFFFFFFFC; /* Word align */ array = (char*) malloc(*length); /* Allocate buffer space */ // No error checking @@@ index = 0; array[index++] = '\0'; /* "" at start */ ptr = start; while (ptr != NULL) { for (i = 0; i < ptr->count; i++) array[index++] = ptr->name[i]; array[index++] = '\0'; /* Terminator */ ptr = ptr->pNext; } while ((index & 3) != 0) array[index++] = '\0'; /* Pad to word */ return array; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Count entries of a specified type in a specified symbol table */ unsigned int sym_count_symbols(sym_table *table, label_category what) { unsigned int i, count = 0; sym_record *ptr; /* For all structures */ for (i = 0; i < SYM_TAB_LIST_COUNT; i++) { ptr = table->pList[i]; /* Start of list */ while (ptr != NULL) { if ((what != EXPORTED) || ((ptr->flags & SYM_REC_EXPORT_FLAG) != 0)) count++; ptr = ptr->pNext; } } return count; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Returns a newly created (allocated) linked list of symbol records copied */ /* from the designated table and sorted as specified. */ sym_record *sym_sort_symbols(sym_table *table, label_category what, label_sort how) { void sym_dup_record(sym_record *old_record, sym_record *new_record) { int i; new_record->count = old_record->count; new_record->hash = old_record->hash; new_record->flags = old_record->flags; new_record->identifier = old_record->identifier; new_record->value = old_record->value; new_record->elf_section = old_record->elf_section; for (i = 0; i < old_record->count; i++) new_record->name[i] = old_record->name[i]; return; } sym_record *temp_record, *sorted_list, *ptr1, *ptr2, **pptr; int i, j, min, after; boolean found; unsigned int flag_mask, flag_match; switch (what) /* Class of records to include */ { case ALL: flag_mask = 0; flag_match = 0; break; case EXPORTED: flag_mask = SYM_REC_EXPORT_FLAG; flag_match = SYM_REC_EXPORT_FLAG; break; case DEFINED: flag_mask = SYM_REC_DEF_FLAG; flag_match = SYM_REC_DEF_FLAG; break; case UNDEFINED: flag_mask = SYM_REC_DEF_FLAG; flag_match = 0; break; default: flag_mask = 0; flag_match = 0; break; } sorted_list = NULL; for (i = 0; i < SYM_TAB_LIST_COUNT; i++) { ptr1 = table->pList[i]; while (ptr1 != NULL) { if ((ptr1->flags & flag_mask) == flag_match) /* Criteria for output */ { temp_record = (sym_record*) malloc(SYM_RECORD_SIZE); sym_dup_record(ptr1, temp_record); if ((table->flags & SYM_TAB_EXPORT_FLAG) != 0) temp_record->flags |= SYM_REC_EXPORT_FLAG; /* Global => local flag */ pptr = &sorted_list; /* Linked list insertion sort */ ptr2 = sorted_list; found = FALSE; while ((ptr2 != NULL) && !found) { switch (how) /* Field used for sorting */ { case ALPHABETIC: /* Sort alphabetically */ if (temp_record->count < ptr2->count) min = temp_record->count; else min = ptr2->count; if (min > SYM_NAME_MAX) min = SYM_NAME_MAX; /* Clip to field length */ j = 0; while ((temp_record->name[j] == ptr2->name[j]) && (j < min)) j++; after = (temp_record->name[j] > ptr2->name[j])/* After candidate? */ || ((j >= min) && (temp_record->count > j)); /* New string > ? */ break; case VALUE: /* Sort numerically */ after = (temp_record->value > ptr2->value) && ((temp_record->flags & SYM_REC_DEF_FLAG) != 0); break; case DEFINITION: /* In order of definition */ after = (temp_record->identifier > ptr2->identifier); break; case FOR_ELF: /* In order of definition, locals first */ after = ((((temp_record->flags & SYM_REC_EXPORT_FLAG) != 0) && ((ptr2->flags & SYM_REC_EXPORT_FLAG) == 0)) || (temp_record->identifier > ptr2->identifier)); break; } if (after) { pptr = &(ptr2->pNext); ptr2 = ptr2->pNext; /* Lower, keep going */ } else found = TRUE; // DUPLICATES ??? } temp_record->pNext = ptr2; /* Insert created record */ *pptr = temp_record; } ptr1 = ptr1->pNext; /* Next source record */ } } return sorted_list; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Print out symbols in table. Tedious, because symbols need sorting. */ void sym_print_table(sym_table *table, label_category what, label_sort how, int std_out, char *file) { sym_record *sorted_list, *ptr; int i; FILE *handle; if (std_out) handle=stdout; else handle=fopen(file,"w"); /* Open output file */ if (file == NULL) fprintf(stderr, "Can't open symbol file: %s\n", file); else { sorted_list = sym_sort_symbols(table, what, how); /* Generate record list */ fprintf(handle, "\nSymbol table: %s\n", table->name); fprintf(handle, "Label"); for (i = 0; i < SYM_NAME_MAX - 2; i++) fprintf(handle, " "); // fprintf(handle, " ID Length Hash Value Type\n"); fprintf(handle, " ID Value Type\n"); ptr = sorted_list; while (ptr != NULL) { for (i = 0; i < SYM_NAME_MAX; i++) { if (i < ptr->count) fprintf(handle, "%c", ptr->name[i]); else if (i > ptr->count + 1) fprintf(handle, "."); else fprintf(handle, " "); } fprintf(handle, " %08X", ptr->identifier); // fprintf(handle, " %08X", ptr->count); // fprintf(handle, " %08X", ptr->hash); if ((ptr->flags & SYM_REC_DEF_FLAG) != 0) fprintf(handle, " %08X", ptr->value); else fprintf(handle, " Undefined"); //, ptr->value); if ((ptr->flags & SYM_USER_VARIABLE) != 0) fprintf(handle, " Assembly "); else if ((ptr->flags & SYM_REC_EQU_FLAG) != 0) fprintf(handle, " Value "); else if ((ptr->flags&SYM_REC_DATA_FLAG)!= 0) fprintf(handle, " Offset "); else { if ((ptr->flags&SYM_REC_THUMB_FLAG)==0) fprintf(handle, " ARM label "); else fprintf(handle, " Thumb label"); } if ((ptr->flags & SYM_REC_EXPORT_FLAG) != 0) /* Table flags in temp recd. */ fprintf(handle, " (exported)"); fprintf(handle, "\n"); ptr = ptr->pNext; } sym_delete_record_list(&sorted_list, FALSE); /* Destroy temporary list */ if ((sym_print_extras & 1) != 0) local_label_dump(loc_lab_list, handle); if ((sym_print_extras & 2) != 0) lit_print_table(literal_list, handle); if (handle != stdout) fclose(handle); } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void local_label_dump(local_label *pTable, FILE *handle) { if (pTable != NULL) { fprintf(handle, "\nLocal (labels in order of definition):\n"); fprintf(handle, " Local Label Value\n"); while (pTable != NULL) { fprintf(handle, "%22d: %08X\n", pTable->label, pTable->value); pTable = pTable->pNext; } } return; } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void lit_print_table(literal_record *pTemp, FILE *handle) { boolean nothing; nothing = TRUE; while (pTemp != NULL) { if ((pTemp->flags & LIT_NO_DUMP) == 0) { if (nothing) { fprintf(handle, "\nLiteral pool: Address Value\n"); nothing = FALSE; } fprintf(handle, " "); if ((pTemp->flags & LIT_HALF) == 0) fprintf(handle, "%08X: %08X\n", pTemp->address, pTemp->value); else fprintf(handle, "%08X: %04X\n", pTemp->address, pTemp->value); } pTemp = pTemp->pNext; } return; } /*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/ /* Evaluate - modulo current word length */ /* On entry: *string points to a pointer to the input string */ /* *pos points to an offset in the string */ /* *value points to the location for the result value */ /* *symbol_table points to the symbol table to search [@@ extend] */ /* On exit: the pointer at *pos is adjusted to the end of the expression */ /* the value at *value contains the result, assuming no error */ /* the return value is the error status */ unsigned int evaluate(char *string, unsigned int *pos, int *value, sym_table *symbol_table) { int math_stack[mathstack_size]; unsigned int math_SP, error, first_error; void Eval_inner(int priority, int *value) { /* Main function shares stack etc. */ boolean done, bracket; int operator, operand, unary; done = FALSE; /* Termination indicator */ math_stack[math_SP] = priority; math_SP = math_SP + 1; /* Stack `start' marker */ while (!done) { error = get_variable(string, pos, &operand, &unary, &bracket, symbol_table); if ((error & ALL_EXCEPT_LAST_PASS) != 0) /* Error not instantly fatal */ { if (first_error == eval_okay) first_error = error;/* Keep note of error */ error = eval_okay; /* and pretend everything is still okay */ } if (error == eval_okay) { /* May return error */ if (bracket) Eval_inner(1, &operand); if (error == eval_okay) { /* Can now apply unary to returned value */ switch (unary) { case PLUS: break; case MINUS: operand = -operand; break; case NOT: operand = ~operand; break; /* Truncated log2 of operand */ case LOG: { unsigned int i; i=operand; operand=-1; while(i>0){ operand++; i=i>>1; }} break; } if ((error = get_operator(string,pos,&operator,&priority)) == eval_okay) { /* If priority decreasing and previous a real operator, OPERATE */ while ((priority <= math_stack[math_SP - 1]) && (math_stack[math_SP - 1] > 1)) { switch (math_stack[math_SP - 2]) { case PLUS: operand = math_stack[math_SP - 3] + operand; break; case MINUS: operand = math_stack[math_SP - 3] - operand; break; case MULTIPLY: operand = math_stack[math_SP - 3] * operand; break; case DIVIDE: if (operand != 0) operand = math_stack[math_SP - 3] / operand; else { operand = -1; if ((error == eval_okay) && (first_error == eval_okay)) error = eval_div_by_zero; div_zero_this_pass = TRUE; } break; case MODULUS: if (operand != 0) /* else leave it alone */ operand = math_stack[math_SP - 3] % operand; break; case LEFT_SHIFT: operand = math_stack[math_SP - 3] << operand; break; case RIGHT_SHIFT: operand = math_stack[math_SP - 3] >> operand; break; case AND: operand = math_stack[math_SP - 3] & operand; break; case OR: operand = math_stack[math_SP - 3] | operand; break; case XOR: operand = math_stack[math_SP - 3] ^ operand; break; default: break; } math_SP = math_SP - 3; } done = (priority <= 1); /* Next operator a ")" or end */ if (!done) { /* Priority must be increasing */ if ((math_SP + 3) <= mathstack_size) /* PUSH */ { math_stack[math_SP] = operand; math_stack[math_SP + 1] = operator; math_stack[math_SP + 2] = priority; math_SP = math_SP + 3; } else error = eval_mathstack_limit; /* Don't overflow stack */ } else { /* Now bracketed by terminators. Matched? */ if (priority == math_stack[math_SP - 1]) math_SP = math_SP - 1; else if (priority == 0) error = eval_not_closebr; /* Errors */ else error = eval_not_openbr; } } } } if (error != eval_okay) { done = TRUE; /* Terminate on error whatever else */ if (error == eval_not_openbr) /* Include position on line (if poss.) */ error = error | (*pos - 1); /* Has stepped over extra ')' */ else if (error != eval_div_by_zero) /* Arithmetic error will occur late */ error = error | *pos; /* Include position on line */ } } *value = operand; return; } error = eval_okay; /* "Evaluate" initialised and called from here */ first_error = eval_okay; /* Used to note if labels undefined, etc. */ math_SP = 0; Eval_inner(0, value); /* Potentially recursive evaluation code */ /* Signal any problems held over */ if (error == eval_okay) return first_error; return error; } /*----------------------------------------------------------------------------*/ /* Get a quantity from the front of the passed ASCII input string, stripping */ /* the value in the process. */ /* On entry: *input points to the input string */ /* *pos points to the offset in this string */ /* *value points to the location for the result value */ /* *unary points to the location for the result's unary indicator */ /* *bracket points to the location of a Boolean "found '(' signal */ /* *symbol_table points to the symbol table to search [@@ extend] */ /* On exit: the position at *pos is adjusted to the end of the variable */ /* the value at *value contains the result, assuming no error */ /* the value at *unary contains a unary code, assuming no error */ /* the value at *bracket contains a "'(' found instead" indicator */ /* the return value is the error status */ int get_variable(char *input, unsigned int *pos, int *value, int *unary, boolean *bracket, sym_table *symbol_table) { int status, radix; unsigned int ii; status = eval_no_operand; /* In case nothing found */ radix = -1; /* Indicates no numeric constant spotted */ *pos = skip_spc(input, *pos); /* In case of error want this at next item */ ii = *pos; /* String pointer within routine */ *unary = PLUS; /* Default */ *bracket = FALSE; /* Default - no brackets */ *value = 0; /* Deal with unary operators */ if (input[ii] == '+') { ii = skip_spc(input, ii + 1);} else if (input[ii] == '-') { *unary = MINUS; ii = skip_spc(input, ii + 1);} else if (input[ii] == '~') { *unary = NOT; ii = skip_spc(input, ii + 1);} else if (input[ii] == '|') { *unary = LOG; ii = skip_spc(input, ii + 1);} /* Open brackets instead of value */ if (input[ii] == '(') { *bracket = TRUE; ii++; /* Skip bracket */ status = eval_okay; /* Legal syntax */ } else { int i; char ident[LINE_LENGTH]; sym_record *symbol; if ((i = get_identifier(input, ii, ident, LINE_LENGTH)) > 0) { /* Something taken */ if ((symbol = sym_find_label(ident, symbol_table)) != NULL) { if ((symbol->flags & SYM_REC_DEF_FLAG) != 0) { /* Label present and with a valid value */ *value = symbol->value; status = eval_okay; } else { /* Label found but value invalid */ status = eval_label_undef | ii; undefined_count++; /* Increment global variable */ } } else { /* Label not found */ status = eval_no_label | ii; } ii = ii + i; /* Step pointer on */ } else { /* End of label gathering */ if (input[ii] == '%') { local_label *pStart, *pTemp; char c; int directions; /* Bit flags for search directions */ unsigned int label; c = input[ii + 1] & 0xDF; if (c == 'B') { directions = 1; ii = ii + 2; } /* Backwards */ else if (c == 'F') { directions = 2; ii = ii + 2; } /* Forwards */ else { directions = 3; ii = ii + 1; } /* Both ways */ /* If searching forwards only and no local label on this line */ if ((evaluate_own_label->sort != LOCAL_LABEL) && ((directions & 1) == 0)) { if (loc_lab_position == NULL) pStart = loc_lab_list;/* Start of list */ else pStart = loc_lab_position->pNext; } else /* If searching backwards, own label will be present already */ pStart = loc_lab_position; if (!get_num(input, &ii, &label, 10)) status = eval_bad_loc_lab; else { boolean found = FALSE; /* Seach backwards */ if ((directions & 1) != 0) { pTemp = pStart; while ((pTemp != NULL) && !found) if (!(found = (label == pTemp->label))) pTemp = pTemp->pPrev; } /* Seach forwards */ if (!found && ((directions & 2) != 0)) { pTemp = pStart; while ((pTemp != NULL) && !found) if (!(found = (label == pTemp->label))) pTemp = pTemp->pNext; } if (found) { status = eval_okay; *value = pTemp->value; } else status = eval_no_label; } } else { if (input[ii] == '\'') /* Character constant */ { ii++; if ((input[ii] != '\0') && (input[ii] != '\n') && (input[ii+1] == '\'')) { *value = input[ii]; ii += 2; status = eval_okay; } else status = eval_operand_error | ii; } else { if (input[ii] == '.') { if (assembly_pointer_defined) { *value = assembly_pointer + def_increment; status = eval_okay; } else status = eval_label_undef | ii; ii++; } else { /* Try for a number */ if (input[ii] == '0') /* 'orrible 'ex prefices, etc. */ { if ((input[ii+1] & 0xDF) == 'X') { ii+=2; radix = 16; } else if ((input[ii+1] & 0xDF) == 'B') { ii+=2; radix = 2; } } if (radix < 0) /* Not yet identified */ { if ((input[ii] >= '0') && (input[ii] <= '9')) radix = 10; else if (input[ii] == '$') { ii++; radix = 16; } else if (input[ii] == '&') { ii++; radix = 16; } else if (input[ii] == ':') { ii++; radix = 2; } else if (input[ii] == '@') { ii++; radix = 8; } } if (radix > 0) { if (get_num(input, &ii, value, radix)) status = eval_okay; else status = eval_out_of_radix; } } } } } } if ((status == eval_okay) || ((status & ALL_EXCEPT_LAST_PASS) != 0)) *pos = ii; /* Move input pointer if successful (in some degree) */ return status; /* Return error code */ } /*----------------------------------------------------------------------------*/ /* Get an operator from the front of the passed ASCII input string, stripping */ /* it in the process. Returns the token and the priority. */ /* On entry: *input points to the input string */ /* *pos points to the offset in this string */ /* *operator points to the location for the operator code */ /* *priority points to the location for the priority code */ /* 0 is the lowest priority and is reserved for terminators */ /* priority 1 is reserved for brackets */ /* On exit: the pointer at *pos is adjusted to the end of the expression */ /* the value at *operator contains the operator code */ /* the value at *priority contains the operator priority */ /* the return value is the error status */ int get_operator(char *input, unsigned int *pos, int *operator, int *priority) { int status; unsigned int ii; *pos = skip_spc(input, *pos); /* In case of error want this at next item */ ii = *pos; /* String pointer within routine */ status = eval_no_operator; /* in case no operator was found, this will be the default */ switch (input[ii]) { case '\0': /* Terminator cases */ case ',': case ';': case ']': case '}': case '\n': *operator = END; status=eval_okay; break; case '+': *operator = PLUS; ii++; status=eval_okay; break; case '-': *operator = MINUS; ii++; status=eval_okay; break; case '*': *operator = MULTIPLY; ii++; status=eval_okay; break; case '/': *operator = DIVIDE; ii++; status=eval_okay; break; case '\\': *operator = MODULUS; ii++; status=eval_okay; break; case ')': *operator = CLOSEBR; ii++; status=eval_okay; break; case '|': *operator = OR; ii++; status=eval_okay; break; // case '&': *operator = AND; ii++; status=eval_okay; break; case '^': *operator = XOR; ii++; status=eval_okay; break; case '<': if (input[ii+1] == '<') *operator=LEFT_SHIFT; ii+=2; status=eval_okay; break; case '>': if (input[ii+1] == '>') *operator=RIGHT_SHIFT; ii+=2; status=eval_okay; break; default: { /* Have a go at symbolically defined operators */ int i; char buffer[SYM_NAME_MAX]; sym_record *ptr; if ((i = get_identifier(input, ii, buffer, SYM_NAME_MAX)) > 0) { /* Something taken */ if ((ptr = sym_find_label(buffer, operator_table)) != NULL) { /* Symbol recognised */ *operator = ptr->value; ii += i; status = eval_okay; } } } } switch (*operator) /* Priority "look up" */ { /* The first two priorities are fixed */ case END: *priority = 0; break; case CLOSEBR: *priority = 1; break; case PLUS: *priority = 2; break; case MINUS: *priority = 2; break; case MULTIPLY: *priority = 3; break; case DIVIDE: *priority = 3; break; case MODULUS: *priority = 3; break; case LEFT_SHIFT: *priority = 6; break; case RIGHT_SHIFT: *priority = 6; break; case AND: *priority = 5; break; case OR: *priority = 4; break; case XOR: *priority = 4; break; } if (status == eval_okay) *pos = ii; /* Move input pointer if successful */ return status; /* Return error code */ } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ unsigned int get_identifier(char *line, unsigned int position, char *buffer, unsigned int max_length) { unsigned int i; i = 0; if (alphabetic(line[position])) while ((alpha_numeric(line[position])) && (i < max_length - 1)) buffer[i++] = line[position++]; /* Truncates if too long for buffer */ buffer[i] = '\0'; return i; /* Length of symbol (sans terminator) */ } /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Test abstracted for convenience of use */ int allow_error(unsigned int error_code, boolean first_pass, boolean last_pass) { return (!last_pass && ((error_code & ALLOW_ON_INTER_PASS) != 0)) || (first_pass && ((error_code & ALLOW_ON_FIRST_PASS) != 0)); } /*============================================================================*/ radare-1.5.2/src/arch/arm/aasm/aasm.h000066400000000000000000000446651141417717500173020ustar00rootroot00000000000000#ifndef _INCLUDE_AASM_H_ #define _INCLUDE_AASM_H_ #define TOKEN_ANDX 0x02000000 /* Just to aid readability below */ #define TOKEN_EORX 0x02200000 #define TOKEN_SUBX 0x02400000 #define TOKEN_RSBX 0x02600000 #define TOKEN_ADDX 0x02800000 #define TOKEN_ADCX 0x02A00000 #define TOKEN_SBCX 0x02C00000 #define TOKEN_RSCX 0x02E00000 #define TOKEN_ORRX 0x03800000 #define TOKEN_MOVX 0x03A00000 #define TOKEN_BICX 0x03C00000 #include #include #include #define TRUE (0 == 0) #define FALSE (0 != 0) #define MAX_PASSES 20 /* No of reiterations before giving up */ #define SHRINK_STOP (MAX_PASSES - 3) /* First pass where shrinkage forbidden */ #define IF_STACK_SIZE 10 /* Maximum nesting of IF clauses */ #define SYM_TAB_HASH_BITS 4 #define SYM_TAB_LIST_COUNT (1 << SYM_TAB_HASH_BITS) #define SYM_TAB_LIST_MASK (SYM_TAB_LIST_COUNT - 1) #define SYM_NAME_MAX 32 #define LINE_LENGTH 256 #define SYM_TAB_CASE_FLAG 1 /* Bit mask for case insensitive flag */ #define SYM_TAB_EXPORT_FLAG 2 /* Keep whole table */ #define SYM_REC_DEF_FLAG 0x0100 /* Bit mask for `symbol defined' flag */ #define SYM_REC_EXPORT_FLAG 0x0200 /* Bit mask for `export' flag */ #define SYM_REC_EQU_FLAG 0x0400 /* Indicate `type' as EQU (abs) */ #define SYM_REC_THUMB_FLAG 0x0800 /* Indicate label in `Thumb' area */ /* Lowest 8 bits used for pass count */ #define SYM_REC_DATA_FLAG 0x1000 /* Data space offset */ #define SYM_USER_VARIABLE 0x2000 /* Assembler control variable */ #define ALLOW_ON_FIRST_PASS 0x00010000 /* Bit masks to prevent errors */ #define ALLOW_ON_INTER_PASS 0x00020000 /* occurring when not wanted. */ #define WARNING_ONLY 0x00040000 #define ALL_EXCEPT_LAST_PASS (ALLOW_ON_FIRST_PASS | ALLOW_ON_INTER_PASS) #define SYM_NO_ERROR 0 #define SYM_ERR_SYNTAX 0x0100 #define SYM_ERR_NO_MNEM 0x0200 #define SYM_ERR_NO_EQU 0x0300 #define SYM_BAD_REG 0x0400 #define SYM_BAD_REG_COMB 0x0500 #define SYM_NO_REGLIST 0x0600 #define SYM_NO_RSQUIGGLE 0x0700 #define SYM_OORANGE (0x0800 | ALL_EXCEPT_LAST_PASS) #define SYM_ENDLESS_STRING 0x0900 #define SYM_DEF_TWICE 0x0A00 #define SYM_NO_COMMA 0x0B00 #define SYM_NO_TABLE 0x0C00 #define SYM_GARBAGE 0x0D00 #define SYM_ERR_NO_EXPORT (0x0E00 | WARNING_ONLY) #define SYM_INCONSISTENT 0x0F00 #define SYM_ERR_NO_FILENAME 0x1000 #define SYM_NO_LBR 0x1100 #define SYM_NO_RBR 0x1200 #define SYM_ADDR_MODE_ERR 0x1300 #define SYM_ADDR_MODE_BAD 0x1400 #define SYM_NO_LSQUIGGLE 0x1500 #define SYM_OFFSET_TOO_BIG (0x1600 | ALL_EXCEPT_LAST_PASS) #define SYM_BAD_COPRO 0x1700 #define SYM_BAD_VARIANT 0x1800 #define SYM_NO_COND 0x1900 #define SYM_BAD_CP_OP 0x1A00 #define SYM_NO_LABELS (0x1B00 | WARNING_ONLY) #define SYM_DOUBLE_ENTRY 0x1C00 #define SYM_NO_INCLUDE 0x1D00 #define SYM_NO_BANG 0x1E00 #define SYM_MISALIGNED (0x1F00 | ALL_EXCEPT_LAST_PASS) #define SYM_OORANGE_BRANCH (0x2000 | ALL_EXCEPT_LAST_PASS) #define SYM_UNALIGNED_BRANCH (0x2100 | ALL_EXCEPT_LAST_PASS) #define SYM_VAR_INCONSISTENT 0x2200 #define SYM_NO_IDENTIFIER 0x2300 #define SYM_MANY_IFS 0x2400 #define SYM_MANY_FIS 0x2500 #define SYM_LOST_ELSE 0x2600 #define SYM_NO_HASH 0x2700 #define SYM_ERR_BROKEN 0xFF00 /* TEMP uncommitted @@@ */ /* evaluate return error states */ /* #define eval_okay 0x0000 // Rationalise @@@ */ #define eval_okay SYM_NO_ERROR #define eval_no_operand 0x3000 #define eval_no_operator 0x3100 #define eval_not_closebr 0x3200 #define eval_not_openbr 0x3300 #define eval_mathstack_limit 0x3400 #define eval_no_label (0x3500 | ALLOW_ON_FIRST_PASS) #define eval_label_undef (0x3600 | ALL_EXCEPT_LAST_PASS) #define eval_out_of_radix 0x3700 #define eval_div_by_zero (0x3800 | ALL_EXCEPT_LAST_PASS) #define eval_operand_error 0x3900 #define eval_bad_loc_lab 0x3A00 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Literal pool flags */ #define LIT_DEFINED 0x01 /* Set when a literal pool entry has a value */ #define LIT_NO_DUMP 0x02 /* Set when record needn't be planted */ #define LIT_HALF 0x04 /* Set when value is halfword */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* Expression evaluator */ #define mathstack_size 20 /* Enumerations used for both unary and binary operators */ #define PLUS 0 #define MINUS 1 #define NOT 2 #define MULTIPLY 3 #define DIVIDE 4 #define MODULUS 5 #define CLOSEBR 6 #define LEFT_SHIFT 7 #define RIGHT_SHIFT 8 #define AND 9 #define OR 10 #define XOR 11 #define LOG 12 #define END 13 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ /* List file formatting constants */ #define LIST_LINE_LENGTH 120 /* Total line length */ #define LIST_LINE_ADDRESS 10 /* Address field width */ #define LIST_BYTE_COUNT 4 /* Number of bytes per line */ #define LIST_BYTE_FIELD (LIST_LINE_ADDRESS + 3 * LIST_BYTE_COUNT + 2) #define LIST_LINE_LIST (LIST_LINE_LENGTH - 1 - LIST_BYTE_FIELD) #define HEX_LINE_ADDRESS 10 #define HEX_BYTE_COUNT 16 #define HEX_LINE_LENGTH (HEX_LINE_ADDRESS + 3 * HEX_BYTE_COUNT) #define ELF_TEMP_LENGTH 20 #define ELF_MACHINE 40 /* ARM (?) */ #define ELF_EHSIZE 52 /* Defined in standard */ #define ELF_PHENTSIZE (4 * 8) /* Defined in standard */ #define ELF_SHENTSIZE (4 * 10) /* Defined in standard */ #define ELF_SHN_ABS 0xFFF1 /* Defined in standard */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ #define v3 0xFF #define v3M 0xFE #define v4 0xFC #define v4xM 0xFD #define v4T 0xF8 #define v4TxM 0xF9 #define v5 0xF0 #define v5xM 0xF1 #define v5T 0xF0 #define v5TxM 0xF1 #define v5TE 0xC0 #define v5TExP 0xE0 /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ typedef int boolean; typedef enum { ARM, THUMB } instr_set; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ typedef enum { TYPE_BYTE, TYPE_HALF, TYPE_WORD, TYPE_CPRO } type_size; typedef enum { NO_LABEL, MAYBE_SYMBOL, SYMBOL, LOCAL_LABEL } label_type; typedef enum { ALL, EXPORTED, DEFINED, UNDEFINED } label_category; typedef enum { ALPHABETIC, VALUE, DEFINITION, FOR_ELF } label_sort; typedef enum { SYM_REC_ADDED, SYM_REC_DEFINED, SYM_REC_REDEFINED, SYM_REC_UNCHANGED, SYM_REC_ERROR } defn_return; /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ typedef struct sym_record_name /* Symbol record definition */ { struct sym_record_name *pNext; /* Pointer to next record */ unsigned int count; /* Number of characters in name */ unsigned int hash; unsigned int flags; unsigned int identifier; /* Record identifier, also definition order */ unsigned int elf_section; /* Section number - purely for ELF driver */ int value; char name[SYM_NAME_MAX]; /* Fixed field for name (quick) */ } sym_record; typedef struct /* Symbol table header definition */ { char *name; unsigned int symbol_number; unsigned int flags; sym_record *pList[SYM_TAB_LIST_COUNT]; } sym_table; typedef struct sym_table_item_name /* So we can make lists of symbol tables */ { sym_table *pTable; /* Pointer to symbol table (or NULL) */ struct sym_table_item_name *pNext; /* Pointer to next record (or NULL) */ } sym_table_item; typedef struct local_label_name /* Literal pool element holder definition */ { struct local_label_name *pNext; /* Pointer to next record */ struct local_label_name *pPrev; /* Pointer to previous record */ unsigned int label; /* The value of the label (number) */ unsigned int value; /* The label word value */ unsigned int flags; } local_label; typedef struct own_label_name /* Definition of label on current line */ { label_type sort; /* What `sort' of label, if any */ struct sym_record_name *symbol; /* Pointer to symbol record, if present */ struct local_label_name *local; /* Pointer to local label, if present */ } own_label; typedef struct literal_record_name /* Literal pool element holder definition */ { struct literal_record_name *pNext; /* Pointer to next record */ unsigned int address; /* The address of the literal word */ unsigned int value; /* The literal word value */ unsigned int flags; } literal_record; typedef struct elf_temp_name { struct elf_temp_name *pNext; boolean continuation; unsigned int section; unsigned int address; unsigned int count; char data[ELF_TEMP_LENGTH]; } elf_temp; typedef struct elf_info_name /* Section info collecting point */ { /* Just the bits I think need collecting */ struct elf_info_name *pNext; unsigned int name; unsigned int address; unsigned int position; unsigned int size; } elf_info; typedef struct size_record_name /* Size of variable length operation */ { /* (form an ordered list) */ struct size_record_name *pNext; unsigned int size; } size_record; /* functions */ boolean set_options(int argc, char *argv[]); boolean input_line(FILE*, char*, unsigned int); boolean parse_mnemonic_line(char*, sym_table*, sym_table*, sym_table*); unsigned int parse_source_line(char*,sym_table_item*,sym_table*,int,int,char**); void print_error(char*, unsigned int, unsigned int, char*, int); unsigned int assemble_line(char*, unsigned int, unsigned int, own_label*, sym_table*, int, int, char**); int do_literal(instr_set, type_size, int*, boolean, unsigned int*); unsigned int find_partials(unsigned int, unsigned int*); unsigned int variable_item_size(int, unsigned int); int get_thing(char*, unsigned int*, sym_table*); int get_reg(char*, unsigned int*); int get_thumb_reg(char*, unsigned int*, unsigned int); int get_creg(char*, unsigned int*); int get_copro(char*, unsigned int*); int get_psr(char*, unsigned int*); int get_shift(char*, unsigned int*); int data_op_imm(unsigned int); unsigned int thumb_pc_load(unsigned int, unsigned int, unsigned int, int, int, unsigned int*); void redefine_symbol(char*, sym_record*, sym_table*); void assemble_redef_label(unsigned int, int, own_label*, unsigned int*, int, int, int, char*); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ unsigned int evaluate(char*, unsigned int*, int*, sym_table*); int get_variable(char*, unsigned int*, int*, int*, boolean*, sym_table*); int get_operator(char*, unsigned int*, int*, int*); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ sym_table *sym_create_table(char*, unsigned int); int sym_delete_table(sym_table*, boolean); defn_return sym_define_label(char*, unsigned int, unsigned int, sym_table*, sym_record**); int sym_locate_label(char*, unsigned int, sym_table*, sym_record**); sym_record *sym_find_label_list(char*, sym_table_item*); sym_record *sym_find_label(char*, sym_table*); sym_record *sym_create_record(char*, unsigned int, unsigned int, unsigned int); void sym_delete_record(sym_record*); int sym_delete_record_list(sym_record**, int); int sym_add_to_table(sym_table*, sym_record*); sym_record *sym_find_record(sym_table*, sym_record*); void sym_string_copy(char*, sym_record*, unsigned int); char *sym_strtab(sym_record*, unsigned int, unsigned int*); sym_record *sym_sort_symbols(sym_table*, label_category, label_sort); unsigned int sym_count_symbols(sym_table*, label_category); void sym_print_table(sym_table*,label_category,label_sort,int,char*); void local_label_dump(local_label*, FILE*); void lit_print_table(literal_record*, FILE*); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ void byte_dump(unsigned int, unsigned int, char*, int); void literal_dump(int, char*, unsigned int); FILE *open_output_file(int, char*); void close_output_file(FILE*, char*, int); void hex_dump(unsigned int, char); void hex_dump_flush(void); void hexpairs_dump(unsigned int address, char value); void elf_dump(unsigned int, char); void elf_new_section_maybe(void); void elf_dump_out(FILE*, sym_table*); void list_file_out(void); void list_start_line(unsigned int, int); void list_mid_line(unsigned int, char*, int); void list_end_line(char*); void list_symbols(FILE*, sym_table*); void list_buffer_init(char*, unsigned int, int); void list_hex(unsigned int, unsigned int, char*); /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ int skip_spc(char*, int); char *file_path(char*); char *pathname(char*, char*); boolean cmp_next_non_space(char*, int*, int, char); boolean test_eol(char); unsigned int get_identifier(char*, unsigned int, char*, unsigned int); boolean alpha_numeric(char); boolean alphabetic(char); int get_num(char*, unsigned int*, unsigned int*, unsigned int); int allow_error(unsigned int, boolean, boolean); /* GLOBAL WTFU */ /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/ extern int SYM_RECORD_SIZE; extern int SYM_TABLE_SIZE; extern int SYM_TABLE_ITEM_SIZE; extern int LIT_RECORD_SIZE; extern int LOCAL_LABEL_SIZE; extern int ELF_TEMP_SIZE; extern int ELF_INFO_SIZE; extern int SIZE_RECORD_SIZE; /*----------------------------------------------------------------------------*/ /* Global variables */ extern instr_set instruction_set; /* ARM or Thumb */ extern char *input_file_name; extern char *symbols_file_name; extern char *list_file_name; extern char *hex_file_name; extern char *elf_file_name; extern char *hexpairs_file_name; extern FILE *fList, *fHex, *fElf; extern int symbols_stdout, list_stdout, hex_stdout, hexpairs_stdout, elf_stdout; /* Booleans */ extern label_sort symbols_order; extern int list_sym, list_kmd; extern unsigned int sym_print_extras; /* <0> set for locals, <1> for literals */ extern unsigned int arm_variant; extern unsigned int assembly_pointer; /* Address at which to plant instruction */ extern unsigned int def_increment; /* Offset reached from assembly_pointer */ extern boolean assembly_pointer_defined; extern unsigned int entry_address; extern boolean entry_address_defined; extern unsigned int data_pointer; /* Used for creating record offsets etc. */ extern unsigned int undefined_count; /* Number of references to undefined variables */ extern unsigned int defined_count; /* Number of variables defined this pass */ extern unsigned int redefined_count; /* Number of variables redefined this pass */ extern unsigned int pass_count; /* Pass number, starts at 0 */ extern unsigned int pass_errors; /* Errors occurred in this pass */ extern boolean div_zero_this_pass; /* Indicates /0 in pass, prevents code dump */ extern boolean dump_code; /* Allow output (FALSE on last pass if error) */ extern own_label *evaluate_own_label; /* Yuk! @@@@@ */ /* Because evaluate needs to know if there is a local label on -current- line */ extern literal_record *literal_list; /* Start of the list of literals from "LDR =" */ extern literal_record *literal_head; /* The next literal record `expected' */ extern literal_record *literal_tail; /* The last literal record `dumped' */ extern local_label *loc_lab_list; /* Start of the list of local labels */ extern local_label *loc_lab_position; /* The current local label position */ extern size_record *size_record_list; /* Start of list of ADRL (etc.) lengths */ extern size_record *size_record_current; /* Current record in above list */ extern unsigned int size_changed_count; /* Number of `instruction' size changes */ extern boolean if_stack[IF_STACK_SIZE + 1]; /* Used for nesting IF clauses */ extern int if_SP; extern unsigned int list_address; extern unsigned int list_byte; extern unsigned int list_line_position; /* Pos. in the src line copied to output */ extern char list_buffer[LIST_LINE_LENGTH]; extern unsigned int hex_address; extern boolean hex_address_defined; extern char hex_buffer[HEX_LINE_LENGTH]; extern int elf_section_valid; /* Flag: true if code dumped in elf_section */ extern unsigned int elf_section; /* Current elf section number (for labels) */ extern unsigned int elf_section_old; extern boolean elf_new_block; extern elf_temp *elf_record_list; extern elf_temp *current_elf_record; extern sym_table *variable_table; /* Assemble-time variables */ extern sym_table *arch_table; /* Table of possible processor architectures */ extern sym_table *operator_table; extern sym_table *register_table; extern sym_table *cregister_table; extern sym_table *copro_table; extern sym_table *shift_table; #endif radare-1.5.2/src/arch/arm/aasm/aasm_manual000066400000000000000000000271141141417717500203770ustar00rootroot00000000000000 AASM Manual =========== (This is more of a set of notes than a true manual.) Alpha++ release! Required: {binary file, token specifier "mnemonics", source file} Command line format ~~~~~~~~~~~~~~~~~~~ qasm [-s[d,v][{l, p}], , -l , -h , -e ] -s dumps the symbol table to the specified file. the default is to dump in alphabetical order the -sd option dumps symbols in order of Definition the -sv option sorts symbols into ascending Value adding an 'l' will dump the Local labels too adding a 'p' will dump the literal Pools too -l dumps the list output to the specified file. the -ls option will list the symbol table too the -lk option will list the symbol table and insert a "KMD" identifier -h dumps ASCII hexadecimal to the specified file. -e dumps ELF to the specified file. omitting the filename (or substituting '-') directs to stdout. (Further options will be added later.) Output information ~~~~~~~~~~~~~~~~~~ Each pass attempts to define and refine label values. On each pass information is echoed indicating "Label changes": "defined" is the number of labels which were defined for the first time on that pass. "value changed" is the number of labels whose definition has been altered on that pass; this is normally due to the object code changing size as offsets are adjusted. "read while undefined" indicates references to labels which have not yet had any definition. Iteration continues until all these values are zero - at which time a final pass generates code - or the assembler becomes fed up, which implies that the source code is not sensible. In this case labels still undefined are reported. Errors are reported as they are determined and, if a pass contains errors, assembly will be aborted at the end of the pass. Source file input format ~~~~~~~~~~~~~~~~~~~~~~~~ Standard assembly language: optional label followed by a mnemonic - with addressing mode(s) as required - followed by an optional comment. Any field may be omitted where sensible. No restrictions on mnemonic/label formatting (1st column, etc.) Mnemonics (including directives) are case insensitive. Labels are case sensitive. Lines are terminated by or . A line is truncated to a limit of 255 characters. (Alterable in source file.) Directives supported are: INCLUDE Include file as part of source GET Synonym for "INCLUDE" EQU Equate EXPORT