Commit graph

735 commits

Author SHA1 Message Date
pancake
143033b5d6 Add PE DOS header struct in r2 -nn (via maijin) 2014-09-20 13:27:54 +02:00
Jonathan Neuschäfer
4f7526d721 Add "const" in two places 2014-09-18 18:56:57 +02:00
pancake
dec5580bf4 Fix some ELF OOB crashes (thanks @maijin for reporting) 2014-09-17 00:09:00 +02:00
pancake
63f00d0b0f Implement working ESIL backend for Brainfuck. Requires manual init 2014-09-13 02:24:50 +02:00
pancake
4bcb57955f Initial test exposing elf headers into Sdb and fix crash in bin-any 2014-09-08 04:17:38 +02:00
pancake
a62e8603f7 Fix read on freed memory in bin/p/bin_any.c 2014-09-08 02:23:26 +02:00
pancake
d809200fa2 Fix more memleaks 2014-08-29 16:42:00 +02:00
pancake
67171b86a5 Hackaround to get r2 -B0 working. 2014-08-28 00:19:51 +02:00
deeso
689d29e444 Remove the TODO from libr/bin/p/bin_any.c 2014-08-25 09:10:53 -05:00
jvoisin
052d576ae6 coverifix 2014-08-24 19:40:08 +02:00
pancake
dbc1625777 Fix build 2014-08-23 01:53:58 +02:00
Adam Pridgen
e3aa90d4be changed default arch from 'x86' to '' 2014-08-23 01:52:33 +02:00
Adam Pridgen
6a5a91f9c9 added type enumeration with lib magic in bin_any.c plugin 2014-08-23 01:52:33 +02:00
pancake
1386bbd2b8 Fix crash in elf parser (rbinfile != rbin != rbinobj) 2014-08-19 11:37:17 +02:00
pancake
87afa5cc06 Workaround to get tiny.elf loaded properly 2014-08-19 00:05:14 +02:00
jvoisin
702ac741b9 More coverifix 2014-08-17 21:04:12 +02:00
pancake
4b7e3cdd3f Fix CID 1231791 2014-08-17 20:22:30 +02:00
pancake
a0570b4144 More fixes related to paddr/vaddr on PE/ELF/XBE 2014-08-15 12:47:05 +02:00
pancake
5a66d7a4d4 Fix #1203 - ELF64 symbol addresses. 2014-08-15 03:55:37 +02:00
pancake
9a55e866b0 Fix rabin2 -Z . Implement it for DEX too. 2014-08-07 01:00:04 +02:00
pancake
ebc691d47e Fix crash when loading COFF files 2014-08-05 02:11:19 +02:00
condret
424cf30430 return R_TRUFAE for load_bytes 2014-08-04 23:20:47 +02:00
pancake
b2a4e24f8a Fix PE64 identifcation issue. 2014-08-04 19:08:29 +02:00
jvoisin
f7b05fe65d Coverifix rampage! 2014-08-04 01:21:38 +02:00
jvoisin
942dba7efd Makes davispuh happy 2014-08-02 02:22:07 +02:00
pancake
3eb4b44bfb Fix other elf tests after the previous regression 2014-07-30 11:14:22 +02:00
pancake
8d2d8eae93 Fix avr symbol addressing issues 2014-07-29 03:16:12 +02:00
jvoisin
5c61d6f2d7 Fix some coverity issues. 2014-07-24 18:46:46 +02:00
jvoisin
8fdfefb080 Fix coverity issues (and some PE tests \o/) 2014-07-24 02:05:17 +02:00
pancake
7e06e13b3b Fix #1133 - gdbr warnings, and some other 2014-07-21 18:19:31 +02:00
pancake
314ab38a78 Fix all latest coverity issues 2014-07-21 17:51:20 +02:00
pancake
cf64a5dd75 Fix #1117 - Bring back rabin2 -c 2014-07-17 09:40:35 +02:00
pancake
381d86de2a Fix null deref and bad indent 2014-07-17 05:49:20 +02:00
LemonBoy
6d83b07224 Prettify the mach0 baddr method 2014-07-11 23:32:44 +02:00
LemonBoy
0acf0b1dd2 Various fixes to stop the vaddr translation madness 2014-07-11 23:32:44 +02:00
LemonBoy
37409c3f34 COFF/MZ improvements 2014-07-11 23:32:44 +02:00
pancake
f986ad51a1 More link order fixes 2014-07-09 11:30:18 +02:00
pancake
740a421e81 Fixes for the new linking order 2014-07-09 11:00:41 +02:00
pancake
feee9f62c9 Fix re100.exe PE crash 2014-07-08 22:59:38 +02:00
pancake
2b6816a13e Fix invalid memory access for mach0s 2014-07-06 00:32:21 +02:00
pancake
9368fc7253 Bump capstone again and fix some warns 2014-07-02 17:14:32 +02:00
pancake
3dfadc0b30 Fixed several issues on PE/ELF/MACH0
- relocs, entry0 vaddr and baddr
- fix tiny.elf crash (null deref on *bin ptr)
2014-06-27 01:20:54 +02:00
pancake
1533c31a2f Fix #1071 - rename constants 2014-06-25 18:02:36 +02:00
pancake
4d6f59f52b Fix build again 2014-06-25 04:29:59 +02:00
pancake
046b014dee Make bin/core java plugins use libr_java.a 2014-06-25 04:25:38 +02:00
pancake
1a3ffef8b4 Fix static build 2014-06-25 04:11:43 +02:00
pancake
377b5bb2fe Clean a huge list of warnings 2014-06-25 02:07:38 +02:00
LemonBoy
50f30ce907 Make the MZ loader use non-CS relative offsets. Fixes #1044 2014-06-21 12:54:29 +02:00
Jonathan Neuschäfer
6790d8d432 Fix out-of-bounds read in COFF and P9 file recognition
(In check_bytes, that is.)
2014-06-21 01:39:27 +02:00
pancake
e60552452d Fix coverity issues 2014-06-17 10:29:15 +02:00
Joshua Roys
62b2c60031 Fix #1031 - incorrect call offsets calculated in DOS EXEs
Also fix the incorrect MZ entrypoint calculation.
2014-06-15 22:40:55 +02:00
Jonathan Neuschäfer
8f49aad1f7 Fix out-of-bounds read in the PE loader (check_bytes)
While at it also change the magic from hexpairs to "MZ" and "PE".
2014-06-15 12:08:22 +02:00
Jonathan Neuschäfer
4c612db79b a few cleanups in bin and lang
* libr/bin/bin.c: remove duplicate condition (xtr && xtr)
* libr/bin/p/bin_elf.c!libs: use r_list_newf
* libr/lang/p/Makefile: add empty "clean" target to silence make warning
2014-06-14 02:14:08 +02:00
pancake
8330ea59fc Fix stale pointer issue in RBinELF. Add r_mem_dup 2014-06-14 00:04:40 +02:00
pancake
3e5eb05eda Fix PE exports parsing (adapted inisider patch) and some code cleanup 2014-06-13 16:00:39 +02:00
pancake
63ae19c650 Implement RBinInfo->is_stripped for MACH0 files 2014-06-10 20:50:48 +02:00
jvoisin
0612c9c593 minor cleanup (thanks @LemonBoy ) 2014-06-10 18:04:37 +02:00
pancake
11080c54c4 Skip build errors of dynamic static plugins 2014-06-05 16:14:33 +02:00
pancake
6883f74d57 Add info/elf.relro sdb instance 2014-06-05 15:38:33 +02:00
pancake
1686073c8b Implement RBinInfo.nx check for ELF (need tests) 2014-06-05 15:26:46 +02:00
pancake
be7ae52faa Hackaround dupped dynplugins builds 2014-06-05 04:32:47 +02:00
pancake
00d283a398 Fix all latest coverity issues 2014-06-04 23:57:24 +02:00
LemonBoy
a00abae9d3 fix #977 2014-06-04 01:37:02 +02:00
Maijin
71b212dfa5 Refactor dll_characteristics for PE 2014-05-31 19:32:52 +02:00
Anton Kochkov
f028985765 Fix CID 1216468 2014-05-31 02:22:17 +04:00
pancake
c225694c7c Fix build and several coverity issues 2014-05-29 15:27:18 +02:00
pancake
8d663ceb94 Some rework on RBin.baddr and laddr to make it work again
Not all fileformats return correct data in Sections, this is
why sometimes the relocation with baddr (needed for aslr) fails
on mach0 for example. This code needs to be redesigned and fixed.
2014-05-29 00:49:28 +02:00
LemonBoy
2fc7c4d34a fixes the xbe loader to handle dodgy files 2014-05-28 21:49:09 +02:00
LemonBoy
8c7984e350 basic sanity checks when loading the thunk import table 2014-05-26 21:00:34 +02:00
LemonBoy
90df6195e1 xbe loader 2014-05-26 20:07:24 +02:00
pancake
810b976b73 More regression fixes for baddr on ELF and MACH0 2014-05-26 12:04:07 +02:00
pancake
98d33eb084 Fix several segfaults found by matalaz in PE, MACH0 and COFF 2014-05-23 14:34:27 +02:00
pancake
d11a2b42da Add more sdb entries for bin/pe 2014-05-21 22:52:12 +02:00
deeso
2c0f1531de Fixing part of the elf tests 2014-05-21 15:02:07 -05:00
jvoisin
7f0c542df6 Fix some warnings in bin_pe (and likely an import-related bug) 2014-05-21 16:04:46 +02:00
pancake
c0750f62a8 List .rela.text relocations, still incomplete 2014-05-21 03:46:31 +02:00
pancake
ac60b07b19 Swap no-seh condition 2014-05-21 03:23:30 +02:00
pancake
a1224b2156 Refactor rva > vaddr and offset > paddr.
That change may make mixing vaddr and paddr more visible
2014-05-21 03:18:00 +02:00
pancake
ea874fcdd7 Fix #947 - PE libs not working 2014-05-20 22:05:06 +02:00
pancake
302d4c245c Show pe.seh value in 'sdb' 2014-05-20 01:53:14 +02:00
pancake
644acb8590 Add rabin2 -k to query sdb info, sdbize MZ debug printfs 2014-05-19 01:42:36 +02:00
pancake
ca18aedb94 Add Capstone SystemZ and SPARC disassembler and analysis plugins 2014-05-17 02:53:37 +02:00
Anton Kochkov
6b56999020 Fix CID 1214308 2014-05-17 03:39:42 +04:00
Anton Kochkov
c33835add1 Fix CID 1214323 2014-05-17 03:28:00 +04:00
Anton Kochkov
0267c89bc5 Fix CID 1214327 2014-05-17 03:22:00 +04:00
Anton Kochkov
9f0fba11f3 Fix CID 1214307 2014-05-17 03:19:03 +04:00
Anton Kochkov
2ff3b1d312 Fix CID 1214321 2014-05-17 03:11:51 +04:00
Anton Kochkov
4b94e61661 Fix CID 1214326 2014-05-17 02:33:02 +04:00
Anton Kochkov
137ca311fc Fix CID 1214306 2014-05-17 02:27:50 +04:00
pancake
41692b70e6 Fix regression: PE baddr, update uncrustify 2014-05-16 02:46:07 +02:00
Adam Pridgen
19760814be Fix CID: 1214312 2014-05-15 08:33:45 -05:00
Adam Pridgen
ccd69e569e Fixing how virtual addresses are assigned to elfs 2014-05-15 00:02:41 -05:00
pancake
587c5f51c2 Implement MACH0- crypto and UUID inside Sdb bin/<fd>/info 2014-05-14 05:48:03 +02:00
deeso
1fbc7f2168 Added load_bytes, Pushed curplugin down to RBinObj, Reworking the RBinFIle loading to accomodate RBinObj reworked how all bins are loaded. Needed to hack IO to make
this work with rbinfiles and rbinobjects.

Conflicts:
	libr/bin/bin.c
	libr/bin/p/bin_te.c
2014-05-13 21:54:18 -05:00
jvoisin
1ec978e844 Fix relocs for PE 2014-05-14 02:58:13 +02:00
pancake
031b6495c4 Fix RBin DEX header check (blame @jvoisin) 2014-05-12 17:20:56 +02:00
pancake
962ac8d307 Fix all java warnings 2014-05-12 10:16:15 +02:00
pancake
bd82919761 Iinitial warning cleanup 2014-05-12 04:06:40 +02:00
jvoisin
ac9354d455 Add NX/ASLR detection for PE 2014-05-09 19:25:31 +02:00
jvoisin
86ad83c2df Add canary detection for Windows 2014-05-09 17:18:07 +02:00
jvoisin
4dd5fbe7ec Fix CID 1212091 and refactor check_bytes 2014-05-09 16:53:19 +02:00
jvoisin
77fb4aadea Fix CID 1212090 2014-05-09 15:50:39 +02:00
jvoisin
822088e159 Fix CID 1135051 2014-05-09 15:45:42 +02:00
jvoisin
48c72e9fa0 Fix CID 1212095 2014-05-09 00:52:48 +02:00
deeso
4ad0f2a400 Tweaking bin plugins so that they can check bytes along with a binfile and fixed extraneous * in buf.c and r_util.h 2014-05-08 14:09:10 -05:00
deeso
03cff1625a Fixing missing get_vaddr function in bin plugin elf64 2014-05-06 23:51:22 -05:00
Fedor Sakharov
99f8ab6b81 Cherry-pick cmd_meta refactoring for CL
- Adds CL* and CL-* commands
- Fix invalid free
- dwarf: Use | as file line delimeter in addrinfo sdb
- Move CL to separate function and use info from sdb
- Move filter_line to a separate function
2014-05-05 01:03:05 +02:00
Adam Pridgen
bd297f6788 reworked how bins environmnent variables are set (e.g. io.va, arch, bits, etc.) and fixed some more mach0 regressions 2014-05-04 17:15:55 -05:00
deeso
3adcb54f17 Overhauled how files are loaded. Now *all* files use an IO plugin the default one is mmap'ed 2014-05-01 20:13:57 -05:00
jvoisin
6420ff29db Fix CID 1134955 2014-05-01 19:08:10 +02:00
deeso
8802b42ca0 removed some unused variables, and grouped unused functions which happen to be used by different components 2014-04-30 20:42:05 -05:00
jvoisin
09060466a6 Fix CID 1134860 2014-04-30 20:37:23 +02:00
Anton Kochkov
b541c014eb Fix CID 1171365 2014-04-30 02:34:45 +04:00
pancake
7216d9772c Fix linkage in OSX 2014-04-28 22:51:42 +02:00
deeso
ce7f33480e fixing warnings (not the unused ones) in various files 2014-04-28 12:58:35 -05:00
Adam Pridgen
c3d6664756 Adding multi-bin support for files that contain multiple objects and lots of other fixes in libr/bin 2014-04-28 12:11:14 -05:00
jvoisin
698d6d340f Add canary detection for ELF 2014-04-28 14:45:02 +02:00
Anton Kochkov
f7c8f1cf96 Fix CID 1134970 2014-04-27 05:25:21 +04:00
Anton Kochkov
3dafba2512 Fix CID 1134874 2014-04-27 05:25:21 +04:00
Anton Kochkov
c511700337 Fix CID 1134865 2014-04-27 05:25:21 +04:00
Anton Kochkov
607f6886bc Fix CID 1134864 2014-04-27 05:25:21 +04:00
Anton Kochkov
64cedbc578 Fix CID 1134829 2014-04-27 05:25:21 +04:00
pancake
ce4e6de42f Implement RBin.Symbols for PE 2014-04-26 04:25:13 +02:00
pancake
eec8512e8b Fix linkage 2014-04-21 19:31:30 +02:00
Fedor Sakharov
219a8497d0 Move size() out of ifdef for elf so it works for elf64 2014-04-21 19:22:37 +04:00
Fedor Sakharov
6c5505b39d Use sdb to store dwarf lineaddr info 2014-04-21 19:22:37 +04:00
pancake
a5fc0fd92a Fix dblfree in dex 2014-04-07 17:09:10 +02:00
pancake
bd7f7cb74c Fill symbol type bin info for coff 2014-04-05 02:09:45 +02:00
Adam Pridgen
3048a34783 Trying to fix mem-leaks, and allow updating of bin object infos 2014-04-03 14:04:07 -05:00
condret
27d7725950 Code clean up and fix o+ 2014-03-26 22:32:45 +01:00
pancake
a727663f98 Add radiff2 -a and -b flags 2014-03-19 10:41:13 +01:00
pancake
f80d659912 Fix java linkage 2014-03-18 00:15:10 +01:00
pancake
53edf7c17d Merge RCmd inside RCore 2014-03-18 00:05:44 +01:00
pancake
8fb6b41f32 Fix linkage 2014-03-12 17:50:36 +01:00
condret
b202b05774 Add support for GBA roms and update GB opcode table
see http://gbdev.gg8.se/wiki/articles/CPU_Instruction_Set
2014-03-12 15:32:29 +01:00
pancake
7c8daf1e70 Refactoring RBinMeta into RBinDbgInfo 2014-03-10 02:27:32 +01:00
pancake
110934227e Autodetect lang="msil" in .NET PE binaries 2014-02-26 01:13:14 +01:00
pancake
d25cafe4d4 Check Java version in RBin's check(), cleanup (-44LOC) 2014-02-22 00:19:16 +01:00
Fedor Sakharov
dff9e0d420 coff: Remove debug prints. 2014-02-20 14:01:49 +04:00
Fedor Sakharov
d31c3623cc coff: Let's support TI coff and tms320 files. 2014-02-20 13:39:05 +04:00
Fedor Sakharov
1dafb6b029 coff: Use beginning of .text section if no entry point specified. 2014-02-20 13:39:05 +04:00
Fedor Sakharov
35e84450a3 Adds some fixes to support x86, amd64 and h8000 together. 2014-02-20 13:39:05 +04:00
Fedor Sakharov
7da39c208e coff: Try to detect coff. Only h8300 now. 2014-02-20 13:39:05 +04:00
Fedor Sakharov
ead69073ed coff: Small fixups and coff bin object free implementation. 2014-02-20 13:39:05 +04:00
Fedor Sakharov
906bb8b3ff coff: Implement optional header, symbols and sections. 2014-02-20 13:39:05 +04:00
Fedor Sakharov
7a76f2f3e1 coff: Initial commit 2014-02-20 13:39:05 +04:00
pancake
25809a0887 Fix some warnings and indentations 2014-02-20 03:08:12 +01:00
pancake
987addf9c0 Fix build 2014-02-18 03:09:28 +01:00
pancake
693653068e Fix strings and main offsets in PE 2014-02-13 01:48:15 +01:00
pancake
1390d9f2d5 Add length and size fields in RBinString 2014-02-11 00:08:12 +01:00
condret
0a8fd8b931 Merge condret's GameBoy pull request
- Update analysis
- Add p2 (2bpp print command)
- Insert more auto comments for gb roms
- Delete mbc
- Handle gb-halt as cjmp (correct in most situations)
- Update gameboy register profile
- Add symbols for hard-interrupt-handlers
2014-02-10 17:02:43 +01:00
Jüri Aedla
44c58435cd Fix PE64 vaddr calculation 2014-02-09 15:04:10 +02:00
jvoisin
65bb8c5ec6 Coverity fixes #590
- Sandbox r2agent
- Check a return value
- Add missing parentheses
- Add missing parentheses
- Fix a division by zero
- Fix a wrong assignation
2014-02-02 23:58:50 +01:00
pancake
1f1367382b Add 'aos' to sdb-ize the esil, file.suppress_warnings renamed to file.nowarn 2014-01-31 02:02:51 +01:00
pancake
6e8073a67f Fix @b: command suffix for 'pd' and fix issue with malformed mach0 2014-01-29 02:42:22 +01:00
Eduardo de la Arada
05b2fb5ec1 Fix #571 TinyPE creation 2014-01-25 13:07:30 +01:00
pancake
5ff6065335 Bump for new sdb 2014-01-23 01:56:35 +01:00
Maijin
e891990811 Resource leaks fixes CID 1134965 2014-01-22 00:16:29 +01:00
Maijin
1682eb21c0 Resource leaks fixes CID 1134965 2014-01-21 23:33:41 +01:00
Adam Pridgen
db1bb1a089 Changed the location of RBinObject, and created RBinFile to conform similarly to
RCoreFile, where RBinFile contains meta information for RBinObjects.  Now
RBinFiles are swapped out along with the RCoreFile when the priority is changed.
2014-01-20 02:44:25 +01:00
Adam Pridgen
285e9ee1ef Moving the bin_obj (internal format into RBinObject proper 2014-01-17 12:41:37 -06:00
Maijin
0772466145 Resource leaks fixes CID 1134957 2014-01-17 00:13:36 +01:00
pancake
9f0d7e44d3 Fix some issues reported by coverity 2014-01-15 01:56:28 +01:00
pancake
a34f3d5434 Fix #534 - segfault when loading some ELF, MACH0 and PEs 2014-01-14 03:48:38 +01:00
pancake
1b3c2fed4f Fix bin_java deinit 2014-01-14 03:26:48 +01:00
pancake
15c069aa2d Fix build 2014-01-14 03:08:07 +01:00
Fedor Sakharov
6d1df284cc Fix invalid pointer dereference in classname field of RBinSymbol 2014-01-13 18:20:15 +04:00
Adam Pridgen
415a77dca0 Java can now load multiple bins into radare space, and analyse the different bins.
See libr/bin/p.bin_java.c libr/anal/p/anal_java.c for the hacky details.
Fixed the coverity issue.
2014-01-12 17:36:47 -06:00
Adam Pridgen
9bdd742a43 Fix null pointer issues with java's use of sdb. Re-did the way keys for cp object, methods, and fields are entered into the sdb. Updated the way bin objects are referenced in asm and anal plugins for java. 2014-01-10 00:35:25 -06:00
Adam Pridgen
79ffe311ec updated the way shlr java persists bin_objs, so that they can be used by other components. Mac OSX still broken, now its an SDB problem. 2014-01-09 07:43:13 -06:00
pancake
7c273cfc39 Fix TE section name issue again 2014-01-08 17:19:52 +01:00
pancake
35d14529a4 Fix minstrlen issue with elf binaries and Cd -X 2013-12-29 03:42:18 +01:00
pancake
0a3e867392 Fix linking and do some minor changes 2013-12-22 03:24:12 +01:00
condret
0338b6d1ac Update bin_ningb.c
just an aesthetic issue
2013-12-22 01:57:54 +01:00
Adam Pridgen
77bc339184 Added cp_opj info into the sdb. CP Info is a primitive serialization that describes the file location, type, and values (dependant on type) in a dotted string format. 2013-12-22 01:56:18 +01:00
pancake
bf1d0ff08a Fix build and various random fixes 2013-12-20 04:32:38 +01:00
pancake
1185a8210b Integrate SDB into RBin accessible with the 'ik' command 2013-12-20 01:20:17 +01:00
Roi Martin (@nibble_ds)
3f5ebd9d16 Fix #458 - Negative baddr
Fix r_bin_get_vaddr() (needs further testing due to changes in r_io)
2013-12-19 19:43:44 +01:00
Adam Pridgen
ddf540d0ab Squashed merge of @deeso's pullreq for the Java RBin plugin
Added basic interpretation of java access flags for classes, fields, and methods
Added a visibility_str to RBinSymbol and RBinClass, and updated getters in Java
Added minstrlen to bin_java plugin struct
Fixed bin->minstrlen not being set in r_bin_init_items
Fixed iinc instruction.
2013-12-17 02:23:16 +01:00
condret
eccfc0e233 fix plainly wrong bank-addressing
sorry, I thought, that the hardware were addressed in the rom, but I was wrong http://www.romhacking.net/documents/%5B544%5DGameBoyProgrammingManual.pdf (page 218)
2013-12-12 23:13:45 +01:00
pancake
bbe6e8c8a2 Add license to RBin, RDebug and RIO plugins 2013-12-10 04:19:04 +01:00
pancake
c165361124 Add bin.bf for brainfuck and use static ESIL struct 2013-12-10 03:35:59 +01:00
aaSSfxxx
cfa95afa98 Fix ELF vaddr, Disable bogus alignment and re-enable PHDR calculation 2013-12-09 04:28:39 +01:00
Adam Pridgen
1289476120 Cleaning up functionality and fix some bugs for Java 2013-12-06 05:42:35 +01:00
Adam Pridgen
ec5a679ec8 Fixed IO plugin load again, would not properly load the plugin 2013-12-03 04:52:46 +01:00
pancake
9beb0cea90 Fix #405 - [bin_ningb:] Entrypoints??? 2013-12-02 01:37:46 +01:00
Adam Pridgen
b5b6348691 Updated some missing Java Byte code Ops and cleaned up some code parsing. 2013-12-02 01:23:50 +01:00
pancake
da8c0a420b Fix ranal2 build, remove ningb debug-printf 2013-11-28 05:07:32 +01:00
pancake
904751ce86 Fix some startup valgrind warnings 2013-11-25 00:45:18 +01:00
condret
ee62e9d1b9 moar banks for gb 2013-11-24 19:32:05 +01:00
Adam Pridgen
ffc8cc14a3 Chasing a segfault, when program exits 2013-11-22 12:28:44 -06:00
pancake
fb654160e9 Add GameBoy support in RBin
- Can identify rom, romtype (mbc,sram, ...), arch, entrypoint and 2 rombanks
2013-11-22 09:45:49 +01:00
aaSSfxxx
ba3065fb99 Add get_vaddr to RBinPlugin and fix vaddr calculation for PE files 2013-11-20 12:16:45 +01:00
pancake
42a8bb440e Fix #345 - fix some segfaults in yank and num.c 2013-09-05 05:10:57 +02:00
pancake
f1c9943df2 Fix #313 - Add bin.baddr and r2 -B to set base address for r_bin 2013-11-06 01:32:24 +01:00
pancake
1769a767cd Fix cpp warnings 2013-11-04 04:50:37 +01:00
Adam Pridgen
1b690e5638 - Fixed number of issues
1) Fixed CP Object off-by-one bug, which led too
2) Fixed the listing in consoles so now fully qualified Obj names and descriptions are right
3) Implemented byte look-ups using an array.
2013-10-23 19:44:12 +02:00
pancake
de857fa91d Fix #251 - Segmentation fault running "rabin2 -I classes.dex" 2013-10-14 23:28:17 +02:00
Adam Pridgen
a1cddb68cf - Fixed an issue where r_bin_java_get_entrypoints will return an RList*
directly rather than relying on the entries in libr/bin/p/bin_java to
  perform the conversion.
2013-10-04 10:53:51 +02:00
pancake
ae317798af Fix warnings in bin_elf.c 2013-10-01 17:20:16 +02:00
pancake
08cce66e68 Initial arm64 analysis. Fix loading mach0 kernels. Fix #230 2013-09-30 03:49:08 +02:00
pancake
81d7e5a8a3 Better support for ARM64 and OS autodetect for MACH0 binaries 2013-09-29 20:20:47 +02:00
pancake
666954b00e Filter trash in import names for PE 2013-09-28 23:58:55 +02:00
pancake
93b1e2e9aa Fix segfault in ELF parser (thanks a0rtega) 2013-09-28 11:44:43 +02:00
pancake
0f2fd99986 Fix some warnings and add a specific plugins.cfg for emscripten 2013-09-15 23:57:22 +02:00
pancake
ae97789986 Fix lot of warnings 2013-09-14 14:04:08 +02:00
pancake
dece987ca3 Fix various bugs on 64bits (mach0 entry, assembler, ragg) 2013-09-14 02:42:02 +02:00
Adam Pridgen
da5bf8db45 Squashed commit of the following:
commit 7800f979cc84c48395581b7106627f7f23563ee2
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Sep 4 21:58:35 2013 -0500

    - Added visibility field to structures RBinField, RBinMethod, RBinBind, RBinReloc, and RBinImport
    - Added handling for listing java classes

commit 1e7014342d16094fe21ddcb9b6b1991c5e3908b1
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Sep 4 18:41:00 2013 -0500

    -- Added mappings for access flags

commit cb8e4f0af99fc77f04263ddf292442835e128cff
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Sep 4 17:53:04 2013 -0500

    -- Updated the get sections command.
2013-09-06 16:22:26 +02:00
Adam Pridgen
38420cb91f - Updated the symbols and strings retrieval. Now methods and fields
that were parsed will be retrieved and added to the symbols list, and
all UTF8 strings from the constant-pool items will be retrieved as strings.

- I did not attempt to retrieve strings from the byte code.
2013-09-06 16:22:17 +02:00
Adam Pridgen
31e47f1c47 Squashed commit of the following:
commit 109915c7812305b9a442d3a0febd9bc43f7104b5
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Sep 4 09:50:08 2013 -0500

    - Added author rewrite tag

commit 5fe0d07f3a318f871bc5d6a8499afd9ceab26e33
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Sep 4 09:37:57 2013 -0500

    - Added a print statement for the number of attributes in the Code Attribute
    - Added a default stack frame creation

commit 4b1bca0d79c53421c1d7a9c59da070a5463ba05b
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Sep 4 08:58:55 2013 -0500

    - Added the R_API prefix to all function declarations and definitions
    - Removed the offset<=size from loops.  Not sure why this check is failing, but it needs to be added in the future (probably add it to the list of defects.)
    - Code appears to parse the classfile correctly

commit 5f5a28302da8c605800946df739c67a0f4f80b0d
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Tue Sep 3 23:11:00 2013 -0500

    - still minor bug in the parsing code on the Type Verification
     or somewhere in the StackMapAttr.  The right number of bytes are
     being read, but not all the bytes are being consumed

commit 1c9d8b490c8d7d8592f898e019aed3b56f9406c8
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Tue Sep 3 20:59:08 2013 -0500

    - fixed some compiler warnings in class.c

commit c185248aa478c6c78f6dbe14cf65ee3396287302
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Tue Sep 3 20:58:21 2013 -0500

    - Propogated the change to code.c from changes from classes.

commit 927542a0672f37b41b23345533bc7e6f2d1a5369
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Tue Sep 3 17:10:40 2013 -0500

    Fixed some minor parsing bugs:

    code_attr offet was not updated correctly after reading the length of the attribute
    attr_buf was not initialized correctly before use

commit b43a7189e9934369d1fdbd96de020edcab907430
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Tue Sep 3 16:33:36 2013 -0500

    - Code compiles.  Time to test.

commit ea7b332d84b88baca1abc466d02b00b2b8739bca
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Mon Sep 2 23:55:44 2013 -0500

    - Added in size calculations for the CP Objects.
    - Need to add method or field references calculations for size after compiling

commit ba55375dc0e835fb46550d0063758e419ec0ed7b
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Mon Sep 2 22:56:56 2013 -0500

    - Revamped all of the attribute parsing.  The parsers will handle buffers rather than simply
      parsing straight from the file.

    - added a size calculator for each of the attributes, which opens up the way for creating
      writers for the attributes and such.

commit be6f2e038f01beeb56ace7d4daaf4d90ad3fdad7
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Sat Aug 31 12:19:18 2013 -0500

    - Cleaned up code and removed some of the compiler warnings.

commit 4c81812f2609e4a80c7036053d122306039dd6ef
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 30 15:24:15 2013 -0500

    - Compiler and linker errors have been resolved.
    - Need to work on testing

commit 429ed30621d9abff1eec99ef50a35c57bbed76ad
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 30 13:35:39 2013 -0500

    Added the RunTime Annotations and Parameter annotations.
    Time to start compiling and testing.

commit b6044e1c74cc10874902bd34da7c8fcbdb5713cc
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 30 12:34:14 2013 -0500

    Added BootstrapMethodsAttr Parsing code along with supporting stuff, like creating
      the method and argument structures and mapping the REF_types to strings

    More should be done to map the REF_types to specific resolutions.

    Added in the MethodType, MethodHandle, and InvokeDynamic ConstantPool Objects

commit 2c9317be5d2be0608131fb9aa10f713885c89471
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 30 00:21:34 2013 -0500

    Finished drafting the code for annotation, element values, element value pairs,
       and annotation default attribute.

    TODO: RTI, RTV, and then Bootstrap attributes.

commit cbee3a10c18342f6a8fb941245568de885fe5666
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Thu Aug 29 15:42:00 2013 -0500

    Fixed the r_bin_java_element_value_new function definition.

commit ab98a76fabf2bd7764a51f3363d821c5a4cf1200
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Thu Aug 29 15:39:28 2013 -0500

    - worked out some of the initial compile errors.
    - worked out an outline for parsing the element_values
    - need to work through parsing the element value, freeing the element value, and then printing a summary.

commit b543d904f2aebd0d1f9c0ac8ec8401b6ab698f36
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Thu Aug 29 08:21:33 2013 -0500

    Most of the heavy lifting is done for attributes.  Need to implement a few of the methods,
    and then compiling should be able to happen.

    Added in all attribute values to the enums, the function call tables, and then the Metas information.

    Need implement an ElementValue parser bleh.

    Need to implement RuntimeAnnotations, Annotations, ElementValue parsing and make sure that
    the attribute unions are all updated.

commit 81f9ca2da2ed7e007a97a20ecb8eb260dfd55e7e
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Aug 28 22:33:43 2013 -0500

    Finished adding some logic to handle the StackMapFrame types.

commit 9a0965cc06021ad56d2127d279b918eef613bec9
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Wed Aug 28 17:54:52 2013 -0500

    Got some of the StackMapTable Atrribute parsing working.  Right now,
    only the FullStackFrame will correctly parse.

commit ea12bd6a8ae9969fa05cbcab622651c8b426917a
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 23 17:51:33 2013 -0500

    Added some debugging code while trying to figure out how to parse the StackMapTable.

commit 6141b57ee94c7bd0569d0ea76725fdce1ac50edf
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 23 17:00:12 2013 -0500

    Code compiles.

commit a7ad14050eb6184a1171620c4dcdba71b2f791aa
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 23 10:29:17 2013 -0500

    - Added a basic Signature element
    - Added declarations for the new functions to handle the parsing of the
      StackMapTable related structures.

commit 54cca3d9af60463dbfa77e23ef1d562ae82d6e5a
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Fri Aug 23 10:18:50 2013 -0500

    Finished an initial coding implementation of the StackMapTable.
    -- Will perform testing later in the day.
    -- Need to look-up the Signature Attribute

commit a14238eece865f4d1c5f2d6b1f482b000d10d94e
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Thu Aug 22 20:23:45 2013 -0500

    StackMap stuff is wip.

commit f011a5d948d31cc6197eed1bbea497a4dde362aa
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Thu Aug 22 18:44:23 2013 -0500

    Made the globals match the R_* standard.  Also tried to clean up naming stuff.

commit 6e61e15572744c2ed722ac3df8d988cc02f1316c
Author: Adam Pridgen <adam.pridgen@thecoverofnight.com>
Date:   Thu Aug 22 16:40:08 2013 -0500

    Plugging progress into the repo.  Adding fixes to handle the Java
    Class file appropriately.  This modification is mostly a re-write
    of the Class File parser, and it "tries" to do a better job of
    creating better objects for each of the Classfile elements.

    Currently this code is experimental, and current TODOs are:
    1) Testing
    2) StackMapTable
    3) LocalVariableTypeTable
2013-09-04 18:52:42 +02:00
Anton Kochkov
cc72328f86 Fix error in handling non-bios images as bios images
Just added size check
2013-08-19 17:55:56 +04:00
Juan RP
9101835c58 Accept @xtraeme's massive warning cleanup 2013-07-25 15:14:49 +02:00
Eduard Burtescu
96ca1d3815 r_bin/mach0: new relocs using dyld_info bind opcodes. 2013-07-19 09:53:43 +03:00
Eduard Burtescu
4a30d17266 Mach-O: new relocs implementation and complementary fixes for imports. 2013-07-19 09:29:58 +03:00
Eduard Burtescu
88030d6f38 r_bin/PE: implement new relocs. 2013-07-19 09:29:58 +03:00
Eduard Burtescu
5e096a4fd7 r_bin: new generalized relocs, with only arch-independent types.
Basic implementation for ELF relocs (x86, x64 and ARM).
2013-07-19 09:29:58 +03:00
Eduard Burtescu
b8e031d91c r_bin: removed hint from RBinImport, as it's only used in PE and even there it's doubtfully relevant. 2013-07-19 09:29:58 +03:00
Eduard Burtescu
8403699f2e r_bin: removed rva, offset and size from imports.
PLT-like lazy import wrappers are now part of symbols, where applicable.
The "imp." prefix is a temporary solution, it should be a flag.
2013-07-19 09:29:58 +03:00
pancake
7cb31941a6 Fix double free when loading malformed PE file
FMI: https://corkami.googlecode.com/svn/trunk/src/PE/lfanew_relocW7.asm
2013-07-03 11:57:37 +02:00
pancake
4aa2867486 Workaround to fix ELF object symbol offsets 2013-06-27 19:12:14 +02:00
pancake
04cfefb9d8 Fixes on dyldcache list and x86 branch analysis
Fix some branch analysis issues for x86
Add new simpler r_reg api r_reg_getv()
Store library offset in dyldcache xtract info
Accessible via rabin2 -A or r2 <file>
Looks like dyldcache is too slow and buggy for latest caches
Fix indentation in branch comments
2013-06-20 02:49:39 +02:00
pancake
ef180f1e1b Dummy load when no program loads in elf 2013-06-20 01:38:31 +02:00
pancake
caded0de14 Honor load program headers when no sections found in ELF 2013-06-20 01:25:40 +02:00
pancake
ef781cbadd New flag rasm2 -c CPU. pointer hints, fix analysis of x86-16 jmps
Add ahp (pointer hints)
Add rasm2 -c flag to select cpu (wip for arm)
rasm2 -e toggles instead of setting
Fix analysis of absolute jumps in x86-16
Push and pops are now magenta \o/
2013-06-17 03:26:48 +02:00
Anton Kochkov
b7f7054dcc More supported bios firmware images in r_bin_bios 2013-06-10 03:08:26 +04:00
Anton Kochkov
c53ae2712a Fixed wrong entrypoint offset in check() function for r_bin_bios 2013-06-10 02:33:33 +04:00
Anton Kochkov
dd8d2c9df3 Fixes in BIOS image checking
Fixed entrypoint address
Added checks for valid entrypoint opcodes (jmp opcode)
2013-06-10 01:30:40 +04:00
pancake
cdea34616d Fix some warnings 2013-06-09 02:55:03 +02:00
pancake
4d32b6b8e4 Initial import of r_bin_bios plugin 2013-06-09 02:11:17 +02:00
pancake
3f1d3ba146 Better r_str_hash(), Fixes in CCa, Added ?h, Better rbin for BEOS bins
Identify Haiku binaries as 'beos' with noodle()
Fix CCa for non numeric offsets
Use sdb's r_str_hash() instead of old one (much less collisions)
Added ?h command to hash strings
CCa now appends instead of replacing comments
Do not mark as static if bin links to libs
2013-06-07 10:26:37 +02:00
pancake
26a7854dd6 Rewrite DEX parser 2013-04-25 03:42:17 +02:00
pancake
b77cdf33d7 Fix loading of MACH0 object files and fix build 2013-04-22 01:34:25 +02:00
pancake
426873d911 Better support for macros and fix dex checksum hint
- .(fix-dex) macro defined when loading a dex
2013-04-12 01:15:00 +02:00
pancake
032860782d Add checksum correction hints for DEX 2013-04-11 01:25:25 +02:00
pancake
efb02c8a95 Fix optimization that was invalidating all C* commands 2013-04-05 12:37:28 +02:00
pancake
542de1b426 Avoid dup load of DEX, reduce calls to r_meta_cleanup
- Nicer output for command 'fd'
- Cache methods to avoi dup loading
- Fix delimiter in internal grep (allow '/')
- Faster r_meta processing (reduce calls to meta_cleanup
2013-04-05 02:55:47 +02:00
pancake
dd301cd6a7 Add adler32 checksum, fixes in dex, add 'ws' command
- Handle ^C in searches
- Safer progerssbar for small terminals
- Add 'ws' command to write pascal/dalvik/java strings
- Fix visual refresh on terminal resize
- Partially fix dex negative section issue
2013-04-05 01:53:21 +02:00
pancake
128097572a Optimize DEX header parsing. Fix 'psp' command
Added r_buf_get_at() method to avoid copies
2013-04-04 23:19:19 +02:00
Anton Kochkov
e62e837b7a TE: 16 bit for _TEXT_RE and fixes for virtual addresses calculations 2013-03-29 04:33:45 +04:00
pancake
6fbbb3dea0 Add arch/bits fields in RBinSection (breaks abi) 2013-03-26 23:37:19 +01:00
pancake
83259dbd1e Fix load ELF64 and remove debug printf in binr/blob 2013-03-12 14:31:24 +01:00
pancake
8f4d23a5ce Initial implementation of io.map plugin 2013-03-12 01:50:55 +01:00
pancake
4f7df37ce1 Fix string terminator in method names for DEX 2013-03-08 16:10:44 +01:00
pancake
6806c11792 Better ARM analysis, Fix blockread in V[0-9] 2013-03-08 12:58:03 +01:00
pancake
ba3ad8112a ELF parser more permissive, add 'fsr' and other fixes
Make ELF loader more permissive
Add 'fsr' to rename flagspaces
Fix parsing issue in 'yy'
Fix crash in r_num
2013-03-07 23:47:41 +01:00
Anton Kochkov
a68605910b Fixed x86 bits config for TE format plugin 2013-03-03 14:01:49 +04:00
Anton Kochkov
ca7296c848 TE format plugin cleanups - removed unused code 2013-03-03 13:34:46 +04:00
Anton Kochkov
8fd68f1429 Build fixes for TE plugin 2013-03-03 03:33:05 +04:00
Anton Kochkov
67a99780fa Added check function for TE format plugin 2013-03-03 02:45:40 +04:00
Anton Kochkov
d580e72a70 Initial TE format support 2013-03-03 02:17:51 +04:00
pancake
4c244a818c Add 'Ch', handle c++ lang in rbin and obey cursor in V: 2013-03-01 09:57:30 +01:00
pancake
f37df0d2c6 Fix fatmach0 extract when unknown files are inside
Fix segfault in java class header parser
Fix help message of 'wt' command
2013-01-29 19:39:41 +01:00
Tim Strazzere
3fcc031083 Accept newer dex magic bytes and attempt to parse future versions.
Currently if a ICS+ extended opcode file was passed to radare2 it
would fail to parse it properly. This checks for the two conditions
'dex\n035\0' and 'dex\n036\0' - and will also just attempt to parse
it if the magic bytes 'dex\n' are available. This should suffice since
the last four bytes are the versioning bytes.
2013-01-22 17:35:34 -08:00
pancake
4ffa7952a2 Fix segfault in DEX parser, remove more r_print refs 2013-01-23 01:53:32 +01:00
pancake
da837ad4ce Fix static build. Generate single libr.a 2013-01-04 14:38:07 +01:00
pancake
48f710abe8 Share RBinJavaObj to RAsmJava plugin, better java and fixes in config
Some more work to get java support back (analysis, disasm, bin share)
Honor ordinal field in java r_bin methods
Fix segfault in 'af*' on FreeBSD (thanks idwer for reporting!)
Fix some valgrind warnings
Better io.maxblk handling
Fix div by zero when blocksize is 0
Fix disasm lines when no function and extra code comments
2012-12-20 11:31:38 +01:00
pancake
58371d6e2f Add rabin2 -N flag to set minimum string length
By default is 2, but PE which is 4
Sort rabin2 -h flags alphabetically
Add r_bin plugin-specific minimum string length
New r_list_newf() constructor which replaces the hacky R_LIST_NEW macro
2012-12-09 01:39:27 +01:00
pancake
7a0da18725 Add r_bin.rar plugin, per-section arch/bits, fix in S=
Add Sa to set/get per-section arch and bits configuration
Cache io->section and core->io->section to speed up the Sa
Update r_sys_arch*
Add dummy plugin in asm/rar
Fix lines of S=
2012-11-30 01:06:30 +01:00
pancake
8f6459977d Refactor of {bin|asm}/java into shlr/java 2012-11-16 02:29:30 +01:00
pancake
6956fe003a Add PIE (ASLR) field in RBinInfo for ELF, MACH0 and PE 2012-11-07 18:18:52 +01:00
pancake
ea8dc25221 Initial objc support, visual 'i' with cursor and 'wow'
Some more fortunes
Initial support for Objective-C
New command 'wow' to fill block with cyclic hex value
Visual 'i' when cursor enabled uses 'wow'
2012-11-07 04:25:42 +01:00
pancake
07929b169d Add Quiet and JSON in RCoreBin, more awk, fix rafind2
Use rabin2 -j flag to get JSON output
You can also get those jsons using the i?j command
Better awk bindings and added some examples
rabin2 -v (without any other arg) shows version
Fix some segfaults in rafind2 and use RList
Add quite output mode for rabin2 (activated with -q)
2012-11-02 03:35:50 +01:00
pancake
52d4eff43f Fix DEX method offsets and help message for @@? 2012-10-29 00:47:20 +01:00
pancake
38628b4e17 Fix ELF loader and segfault in disasm->hexdump 2012-10-17 12:13:23 +02:00
pancake
757d692e19 Implement support for mach0-x86-32/64 main finder
Fix segfault when loading a plain file after io'd one
2012-09-23 21:42:10 +02:00
pancake
51c4610090 Fix segfault in zip:// and dex (thanks @pof for reporting) 2012-09-23 13:30:28 +02:00
pancake
3861772e6d Initial implementation of r_io.zip plugin
Allows to: r2 zip://foo.apk//classes.dex
Honor LDFLAGS in r_bin
Fix filename issue in r_io_redirect
Add testing on-activate event in r2w2
2012-09-07 03:26:38 +02:00
pancake
062deb4b69 Fix build. enhace mips anal, add recursive disasm
Fix UCALL opcode analysis in mips
Initial implementation of 'pdr' recursive disassembler
Workaround for code wrong basic block size in pdr
2012-08-29 14:46:19 +02:00
pancake
84c032a40e Fix strange ELF loading and mips code analysis 2012-08-29 00:45:44 +02:00
pancake
e9829c5c9f Fix build 2012-08-26 11:07:09 +02:00
pancake
e46efa8a1d Initial implementation of r_bin_size (rabin2 -Z)
Changes in the disasm loop to support continuous fun
Fixes disasm after opcode payload
Added RConstr code in r_util (not yet used)
RBinSize implemented for elf, mach0 and plan9
Fix build
2012-08-23 12:46:55 +02:00
pancake
f75817ee6c Initial work on supporting payloaded opcodes
Basic classes support for dalvik (rabin2 -C, ic*)
2012-08-22 18:02:23 +02:00
pancake
52beedb22a Fix build 2012-08-15 01:32:02 +02:00
pancake
e6e1490fe6 Add support for Java debug line information
Workaround Java CLASS parser bug
Still work-in-progress for full debug line support
$ rabin2 -dr foo.class
2012-08-14 18:22:24 +02:00
pancake
3df277d84b Initial import of TOP make variable 2012-08-14 13:14:54 +02:00
pancake
3fb3f58fcd Add missing dalvik opcode, rename invoke-direct-empty
rabin2 -h works even with other flags passed
random syntax fixups and use R_NEW0 where possible
initial dummy implementation of r_bin_size()
2012-08-07 10:28:03 +02:00
pancake
90b1936910 Fix make purge and uninitialized memory in RBin 2012-08-06 17:34:01 +02:00
pancake
9362041562 Huge RBin refactoring and fix mach0 section perms 2012-08-04 23:48:06 +02:00
pancake
3e7c4ad992 Add new opcodes for x86.nz assembler
- Fix search counter
2012-08-03 02:05:50 +02:00
pancake
a260da522c Various build issues have been fixed
Fix build of libr/anal/cparse
r_list.h was not including r_types.h
check null pointer in r_asm
Fix 't' help message
Obey q! in scripts
2012-07-20 17:14:28 +02:00
pancake
690445700a * Add ^ and $ in cons grep expressions
* Minor work on source CL commands, needs review
2012-06-21 10:12:02 +02:00
pancake
fee1dfda07 * Fix some bugs reported by clang-analyzer 2012-05-31 02:41:45 +02:00
pancake
637e8c92e5 * Fix MZ check() (fixes PE64+ id in r_bin)
* Add io->bits into RIO class
* OSX r_io debug now honors io->bits
  $ r2 -b 32 ls  # debug 32bit ls
  $ r2 -b 64 ls  # debug 64bit ls
2012-05-30 01:35:41 +02:00
pancake
9bc3812ae8 * Add r_bin/mz plugin (old EXE binaries)
* Fix parsing of cs:ip values in r_num_calc
2012-03-07 01:34:57 +01:00
pancake
6bb894de1c * Fix segfault in xtr_fatmach0 on small files
* Add r_cons_set_interactive and _last_interactive() methods
* Drop interactive mode when '>' is used
2012-02-05 01:25:40 +01:00
pancake
5deffac04f * Fix nullpointer checks in p/bin p9, pe and pe64 when
using virtual files like malloc:// (thanks @vext01 for reporting)
* Add search.in=block
* Fix search ranges in search.in=file (fixes r2-regressions test)
2012-02-01 22:42:38 +01:00
pancake
29166cc940 * Initial import of the hud input method for the visual mode
* Use '_' key in visual mode to enter in hud mode
* Support mach0 files with multiple sections with same name
* Fix parsing of commands with nested quotes
* rename ?z to ?l
* added new command ?y to get and set yank buffer contents to stdout
* ?i stores the input into the yank buffer now
* ?I accepts a file name as argument which is loaded as hud
* ?k used as key=value temporal storage
* Add calc.c .. plans are:
  - support proper parenthesis in math.c
  - support floating point arithmetics
2012-01-31 02:45:17 +01:00
pancake
840550aa3a * Add asm.tabs for bearuty for free (enable by default?)
* Apply @l0gic patch for ELF parsing segfault
* Improve a lot the startup time by using r_file_mmap
* Fix build on osx
2012-01-26 03:18:45 +01:00
pancake
d779162f07 * Apply @w_levin patch fixing memory leaks
- Use r_list in RBin (deprecate list.h) Thanks!
2011-12-13 14:00:22 +01:00
pancake
f566e70578 * Many ugly hacks to enhace w32 console
* Use io.va=1 on PE
2011-12-02 14:32:04 +01:00
pancake
bc8f1e617b * Fix for .ko and .o elf parsing 2011-12-01 09:32:16 +01:00
pancake
6de942e05d * Add RBinInfo->has_va
- Used to autoforce io.va after loading the bin
  - Fixes loading kernel modules and object files
* Fix loading strings on a object file without io.va
* Add install-rev.sh script
2011-11-29 15:29:50 +01:00
pancake
ee665da38e * Fix load of object elf files (kernel modules too)
- thanks Sebastian Reichel for reporting!
* Use O_BINARY in open() on windows
  - Will this fix the disassembler problems on w32?
2011-11-29 04:25:18 +01:00
pancake
dadb224889 * Fix iphone build 2011-11-27 14:02:39 +01:00
pancake
d7f2c850be * Add initial native support for fat binaries in r2
- Select arch/bits with r2 -a and -b (old -b is now -B)
  - Kinda hacky, but works for osx-x86/32/64
  - Export offset information of fat bins
* Show flags in search output
* Disable interactive console in rabin2
* Do not comment int3 opcodes
2011-11-22 00:59:20 +01:00
pancake
c620b0dd3f * Fix search when io.va=true
- Add search.in = file, section, raw
* Set io.va=false rbin cant identify file type
* Show progress info in search
2011-11-19 02:49:11 +01:00
pancake
c16d61b370 * Add missing fs/types.h
* Fix many memory leaks in r_anal_{op,cond}
* Fix signature of r_fs_name()
2011-11-14 00:21:25 +01:00
earada
73546d6b96 * Add automount support to RFS
- m / <- Autodetect filesystem in current offset and mount it
* Add 'm' description to '?' command
2011-11-13 22:47:08 +01:00
pancake
158962d606 * make purge is now less harmful
* add initial support for creating p9 binaries
* Make r_anal_get_fcns() an accessor macro
2011-11-12 05:20:54 +01:00
pancake
75290251da * Add initial support for plan9 binaries
- supports x86, arm, ppc, sparc, mips
* Use r_cons in r_core_bin
* Fix link of rabin2
  - Use r_cons_flush()
  - Refix ehdr issue
* r_io_size() now ignores va
* Add R_SYS_BASE
* Move r_anal_get_fcn_get into fcn.c
* Some more fixes
2011-11-12 04:51:45 +01:00
earada
2fadc048e7 * RBin suport new section_end flags
* Add some filesystem automount support
2011-11-11 17:56:21 +01:00
pancake
85f5829be6 * Make oxfoo1m3 crackme load correctly
- Do not find strings in binaries with no data sections
  - Add program header section underlaying the rest of sections
* Do not newline when gotoxy'ng
  - visual mode is now smarter
* New ? commands
  - ?p = show physical address
  - ?S = show section name for given address
* Initial refactoring in r_io to make section overlaps happy
  - Those changes are experimental and can lead to problems
  - Do not iterate prev
  - Do not sort by offset
2011-10-25 20:30:05 +02:00
pancake
89968a18b9 * Added linux-x86-32 support for elf-init/fini syms
- Yeah, this is a call for contribs
2011-10-20 19:52:19 +02:00
pancake
17dfe1bcf8 * Fix some possible-use-of-uninitialized-variables 2011-10-20 16:36:00 +02:00
pancake
989fdb3dc8 * Implement raw get_main analysis for MACH0 binaries (x86-32/64)
* Remove main() from libr/magic .. was using non-portable strlcpy/strlcat
2011-10-10 16:55:39 +02:00
pancake
098b1ba127 * Implement input and output filters for rasm2
- Experimental.. not yet ready for release
  - Add rasm2 -F flag to specify input and output filters
   $ rasm2 -F att2intel
* Add new att2intel r_parse plugin
  - make mrproper required
* Initial implementation of RBinClass
  - Only experimental and Java-specific atm
  - Add rabin2 -C to display classes
* Optimize some r_str functions
2011-10-05 02:38:37 +02:00
pancake
2a0b57d51d * Implement 'ax' command.
- Add r_anal_fcn_xref_{add|del} methods
* Some fixes for r_bin_dex file format
  - Properly name all fields and methods
  - Add entry support in java too
* Add default sections for dex and java class files
  - constant pool, code, data, extra
* Beautify 'S=' command
2011-09-28 02:48:03 +02:00
pancake
4e3358a522 * Fix farm 2011-09-26 02:10:25 +02:00
pancake
9884ce9db0 * Initial support for Android NDK build (fix build)
- Not yet runnable, but compiles against bionic
2011-09-25 06:57:13 +02:00
pancake
677a499440 * Add get_main() for mach0 (32,64)
* Proper use of arch/bits. debugger works fine now for osx-32/64
2011-09-22 09:52:00 +02:00
pancake
0a14411bc1 * Added README documentation for libr/egg programming language
* Add -O flag to ragg2 as an alias for -o a.out or -o <file> (without extension)
* Add rabin2 -M (get main) for Java Class files
* Add emit_trace (code tracer) for r_egg. useful to debug
  - ragg2 -a trace hello.r
  - Add emit->jmp() function pointer and emit->retvar
  - many fixes in function calls and definitions
  - Added support for 'break;' 'break();' and 'goto();'
  - Added .ret variable as an alias for eax, rax or r0
2011-09-19 02:39:33 +02:00
pancake
403aa4b36d * Fix ~40 off-by-one strncpy's 2011-09-18 20:41:36 +02:00
pancake
838e6b7466 * Fix java class parser for javac -g files
- Show debug information in sdb format
  - Fix null pointer segfault
  - Still work-in-progress for proper debug info
* Some work on r_egg
  - Fix windows and osx default syscall tables
* Export version number in vapi R2_VERSION
* Hide ccache error if not found in sys/install
2011-09-18 18:56:11 +02:00
pancake
37fecf7c0c * Implement RBinCreate.elf-arm
* Fix uninitialized shstrtab segfault in r_bin_elf
* Do not create new objects unnecesarily in r_core_magic
* Handle length argument in pb command
* Fix ps command
* @@ now prefixes each line with the offset (useful for search)
  - can be problematic when used with macros
  > / lib
  > ps @@ lib*
* Huge refactoring in r_magic, now using the r2 coding standards
  - Use r_magic_new() and _free() instead of open/close
  - Reduced -1KLOC
2011-09-12 01:47:28 +02:00
pancake
3fc44b6e6a * Fix build of r_magic on !BSD (strlcpy)
* Initial import of sys/ui
2011-09-10 20:08:25 +02:00
pancake
4d6c585672 * Add support for mach0-arm and mach0-x86_64 in r_bin_create
- x86_64 has been tested and works fine, but needs some love
  - the arm mach0 (iPhone) is not yet tested, but the bin looks ok
* Install syscall sdb files into versioned directory in lib/radare2
2011-09-09 01:09:36 +02:00
pancake
55a29f976b * Add dummy darwin-x86-64 syscall information
- OS is 'darwin', not 'macos' (r_bin)
* Fix r_syscall vapi
* Honor DESTDIR (thanks l0gic)
2011-09-04 20:25:32 +02:00
Nibble
653dbea643 * Minor fixups in create() for elf64 2011-09-04 15:19:59 +02:00
Nibble
480edd8203 * Add support for ELF64 to r_bin_create 2011-09-04 13:21:02 +02:00
Nibble
ffa32be19e * Add r_bin_plugin "any"
- Used for unknown formats, firmwares, etc.
* Add "bin.any" to plugins.def.cfg
2011-09-02 16:45:39 +02:00
pancake
0ae2050448 * Fix segfault in r_bin/pe -- thanks l0gic
- sections are not properly read in cdak binaries
2011-09-02 03:09:26 +02:00
pancake
259d14940e * Implement R_SEARCH_DELTAKEY
- Accessible with /d search command
* Code cleanup in TinyPE
* Implement rasc2 -o
2011-07-26 09:34:10 +02:00
pancake
dd8e7430dc * Initial implementation of the PE creation support for rabin2 -c
- Creates a Tiny PE executable for w32 (100 bytes)
2011-07-26 01:13:51 +02:00
pancake
a173eedcaf * Added support for ELF32-linux-x86 binaries for rabin2 -c
- Allow to create tiny elf binaries (only text section)
  $ rabin2 -a x86_32 -c elf:31c040bb2a000000cd80 a.out
* Added api for 16 and 64 uint write in RBuffer
2011-07-25 23:20:49 +02:00
pancake
8d06dd2f02 * Initial implementation of rabin2 -c
- Allow to create tiny binaries with r_bin
  - ATM only MACH0 format for x86-32 is supported
  $ ./rabin2 -a x86_32 -c mach0:31c040682a00000081ec04000000cd80 a.out
* Rename r_bin_set_arch{idx} to r_bin_select{idx}
  - New API r_bin_create and r_bin_use_arch()
2011-07-25 21:10:25 +02:00
pancake
edbcb1cfce * Add 'rwx' permissions information in MACH0 sections
- Lot of syntax indentation fixes
* Use r_name_filter in r_flags
  - Fix dangerous flagnames issue
2011-07-19 18:03:31 +02:00
pancake
0d4faf652e * Set library version number for plugins
- Registers for which version of core was compiled
* Use tar --format=posix when GNU tar
  - Fixes the dependency on BSD systems
* Fix in doc/fortunes
* Fix this class pointer in asm_java
* Re-Fix uglily the bin_elf strtab issue (needs more work)
* Fix Vala regression in r_asm.vapi
2011-07-19 00:12:36 +02:00
earada
413cfec724 * Fix virtual address in elf without setcions 2011-07-15 14:17:36 +02:00
pancake
edc7da8f7c * More strcpy/sprintf/strcat exterminations 2011-07-06 09:40:23 +02:00
earada
a38c2ece6d * Initial parse of dex files
- Load strings and methods
* Fix command 'r' parser
* Fix visual 'g' command without sections defined
2011-07-04 18:54:41 +02:00
earada
21a9405a81 * Handle strings meta info in dalvik disassemble 2011-06-26 22:42:34 +02:00
pancake
868acc4059 * Added RBinBind type and logic
- Refactoring required to allow RAsm retrieve info from RBin
  - Will be used by dalvik and java disassemblers
2011-06-26 20:29:24 +02:00
pancake
bf95651e69 * Fix DEX parsing segfault
* Fix possible segfault on newer glibc
* Fix some indentations and Visual hints
2011-05-24 15:25:52 +02:00
earada
95e51548b6 * mg now support files and dirs
* Fix bin_fs build
2011-05-12 15:01:29 +02:00
pancake
09577a9246 * Initial import of the r_bin_fs plugin
- Autodetects underlying filesystem
  - Auomatically mounts a /root partition
  - Only support for 'HFS+' filesystem (as a test)
* Added 'oo' command to reopen current file
  - In debugger mode re-forks the process
2011-05-12 09:52:40 +02:00
pancake
020dd97a8b * Fix many segfaults discovered in OpenBSD
* Fix segfaults caused by read buffer overflow in x86im
  - use a 16 byte delta buffer in function and basic block analysis
* Fix r_list_delete segfault caused by an use-after-free bug
  - Thanks Edd Barrett for notifying :)
* Clean up many warnings reported by OpenBSD's gcc
* Reduce analysis depth to 50
* Fix OpenBSD syscall definitions and fix generator python script
2011-04-03 02:43:15 +02:00
earada
708e10e413 * Change some files license from GPL3 to LGPL
* Fix build
2011-04-28 02:09:43 +02:00
earada
ee7fefb41f * Initial dex-files format support 2011-04-28 01:54:54 +02:00
pancake
d953cd9adf * Initial implementation of the java name mangling
- Added as comments before the method names
* Some fixes in r_bin_java
* Added r_buf(append/prepend)
* Show flags always in new lines
2011-02-27 20:30:41 +01:00
pancake
e557d9a385 * Drop 'r_cons.h' from r_fs
* Fix visual glitch in Vej and Vt
* Handle demangled names as comments
  - in rabin2 and core->bin_load
  - Needs to be a RAnalCall at some point
  - bin_java calls the dummy r_bin_demangle_java
  - Add R_BIN_NM_ANY enum
* Add asm.lbytes config to align disasm bytes to left
* Fix visual glitch in function boundaries
* Import upgraded versions of the idc2rdb scripts in doc/
2011-02-25 04:19:30 +01:00
pancake
1c2526c1da * Add 'p=' command 2011-02-23 13:25:41 +01:00
earada
4c72f5f082 * Zoom out in cursor mode
* Fix dalvik goto opcodes
* Initial import of the dalvik anal plugin
* Fix 'ms' mount a non-exist root
2011-02-23 03:01:26 +01:00
Nibble
0906e809fe * Remove all dummy plugins (speed up build) 2011-02-04 14:20:30 +01:00
pancake
c6b37c3e26 * Fix r_bin_elf for ppc, avr and 68k binaries 2011-01-23 18:32:58 +01:00
pancake
5e2fd3197e * Added dummy r_bin_demangle 2010-12-03 14:53:06 +01:00
pancake
eb3de0a3f4 * Use memmove where needed (thanks @earada for the patch)
- Fixes probably segfaults in latest GLIBC
2010-11-18 12:17:55 +01:00
pancake
421208a0c7 * Replace main for binsym in r_bin
* Added dummy commands for r_debug_fork/clone
2010-11-18 11:41:17 +01:00
Nibble
add2efee74 * Fix reloc offset resolution in r_bin_elf 2010-10-13 04:00:32 +02:00
Nibble
a83355f0b1 * De-warn dyldcache in 32bits
* Add dyldcache.mk to libr/bin/p/Makefile
* Update reloc.vala
2010-10-04 23:05:30 +02:00
Nibble
b1cdfcc889 * Fix build 2010-10-04 12:46:27 +02:00