Commit Graph

265 Commits

Author SHA1 Message Date
pancake
dd131e15d0 Fix stack exhaustion bug in Java class parser 2014-11-05 01:31:33 +01:00
pancake
e93b0727c2 Fix crash in Java CLASS parser 2014-11-05 01:21:05 +01:00
pancake
514b120a94 Fix a read-out-of-bounds bug in the java class parser 2014-10-09 14:05:31 +02:00
pancake
8a3b127fb4 Fix crash in Java class parser (thanks Joxean) 2014-10-09 13:56:27 +02:00
deeso
55fe0a9e9a Added command that 'bruteforces' the parsing of a class file in a blob of data 2014-09-20 19:46:21 +02:00
jvoisin
86c3d0e70f Fix some trivial coverity issues 2014-09-20 15:56:34 +02:00
pancake
4c4173769b Revert "Fixing the issue where file size exceeds size of an integer":
3adb00621b
e2afa84443
0761955fdb
17cc18fad0
135c62fb5d
2014-09-20 15:33:59 +02:00
Adam Pridgen
135c62fb5d Fixing *most* warnings related to the change in r_file_slurp 2014-09-17 22:37:54 -05:00
deeso
f3ff9caa14 Java unmangling lacked a 'short' type. fixed 2014-09-13 18:19:34 -05:00
pancake
b73ad255e8 Do not use stdint 2014-09-13 17:47:56 +02:00
deeso
083394175c Adding JSON output for the java prototypes
- Created a simple JSON string builder lib so its
  easier to build the JSON strings.
- Fixed errors and missing symbols on Mac Build
2014-09-13 17:37:11 +02:00
Anton Kochkov
ab1a7e992b Fix Mingw32 building, again 2014-08-15 16:51:51 +04:00
deeso
684b459c20 Bug in the code flipped jump and case value of the switch op, remove dangling in_switch key, and add a formal "case" op-type
and changed some strings back to "static" from "R_API"
2014-08-13 03:12:23 +02:00
jvoisin
975daf00f5 Coverifix 2014-07-30 22:26:13 +02:00
jvoisin
8fdfefb080 Fix coverity issues (and some PE tests \o/) 2014-07-24 02:05:17 +02:00
jvoisin
431ba75557 Fix some coverity issues 2014-07-21 23:14:25 +02:00
Anton Kochkov
445dde9ba8 More improvements for cygwin and mingw32 building 2014-07-10 02:21:41 +04:00
Anton Kochkov
17b07d4623 Remove -fPIC for cygwin builds - stage 2 2014-06-25 21:32:03 +04:00
pancake
097cd2b04b Fix android build 2014-06-25 04:57:41 +02:00
pancake
18cc1af08c libr_java must be PIC 2014-06-25 04:50:05 +02:00
pancake
b3b5bfe8f3 Minor fix 2014-06-25 04:33:42 +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
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
Anton Kochkov
12037a14aa Fix CID 1214298 2014-05-17 03:44:05 +04: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
pancake
216c183b6e Remove tons of useless 'if (x) free (x)' 2014-05-09 17:40:28 +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
deeso
4dbc9916e8 Fix double assignment. 2014-04-29 23:38:35 -05:00
deeso
ce7f33480e fixing warnings (not the unused ones) in various files 2014-04-28 12:58:35 -05:00
deeso
f5310ee921 Fixed Java warnings relating to parameters not being void * for free functions 2014-04-25 20:34:19 -05:00
deeso
5f6f8064d9 Fixed some issues in bin/dwarf.c and Fixed 1205194, 1205193, 1205192, 1205202, 1205203, 1205204, 1205205, 1205209, 1205208, 1205207, 1205206 2014-04-25 15:14:57 -05:00
deeso
dd07844436 Fixing some Null Dereference Bugs courtesy of coverity 2014-04-22 18:39:17 -05:00
Adam Pridgen
ea94ae5c2c Fix CID: 1204243, 1204247, 1204246, 1204245, 1204244 2014-04-20 23:55:50 -05:00
deeso
e1378efd69 in shlr/java/code.c changing BYTES_CONSUMED 'volatile' to 'static volatile' 2014-04-20 17:28:02 -05:00
deeso
98e5d1af93 Fixing a bug, where the BYTES_CONSUMED in the java analysis was not updated 2014-04-19 22:45:03 -05:00
deeso
1ccd783649 Fixing: CID 1204077, CID 1204078, CID 1204079, CID 1204082, CID 1204081, CID 1204080 2014-04-19 18:11:13 -05:00
Adam Pridgen
a88218dd16 updating the way prototypes are created 2014-04-14 00:58:15 -05:00
Adam Pridgen
7cd412f6c9 Fix coverity issues and small bug in interfaces
Change the java references are presented in lcr
2014-04-13 23:49:00 -05:00
Adam Pridgen
c3048100e2 Fixing coverity defects 2014-04-09 09:51:55 -05:00
Adam Pridgen
af800c4b1b fix to wen because the size caused an incorrect allocation 2014-04-08 17:47:26 -05:00
Adam Pridgen
0853afc78e added some preliminary stuff to enable more point based hooking by appending cp object
to the end of the cp array.  added method and field offsets attributes to sections
2014-04-08 11:19:29 -05:00
Adam Pridgen
75043c88f3 added java command to print out the exception table 2014-04-05 04:12:56 -05:00
Adam Pridgen
b182b23b40 fixing the following coverity issues, which entails the issue with print and most of the java issues:
1196398, 1196403, 1196402, 1196401, 1196400, 1196413, 1196415, 1196414, 1196411
2014-04-05 00:39:17 -05:00
Adam Pridgen
aea7766d96 Fixed replace cp classname code, and added code to guard against too much fail if the java file is mangled 2014-04-05 00:10:25 -05:00
Adam Pridgen
d4657446d9 Adding code to check the end of buffer 2014-04-04 23:16:17 -05:00
Adam Pridgen
61ccb44890 Fixing more memory leaks in java/class.c 2014-04-04 22:26:58 -05:00
Adam Pridgen
35984ef8a6 Adding default values if imports cant be resolved 2014-04-04 20:29:08 -05:00
Adam Pridgen
0f1cb60b2d Fixed an off-by-one write bug, but need to fix the class replacement function 2014-04-04 09:39:04 -05:00
Adam Pridgen
1110265678 Eliminated most of the memory leaks caused by class file parsing 2014-04-03 22:16:28 -05:00
Adam Pridgen
3048a34783 Trying to fix mem-leaks, and allow updating of bin object infos 2014-04-03 14:04:07 -05:00
Adam Pridgen
94bcf930ee fixed a bug that unnecessailry deleted the constant null type 2014-04-03 02:03:20 -05:00
Adam Pridgen
9d6556cf93 References in code works 2014-04-03 00:12:32 -05:00
pancake
eb4373e325 Update sdb (add -j), fix static link builds 2014-04-03 04:04:03 +02:00
Adam Pridgen
d876dec7ee Adding java command to help identify external calls, reads, and writes 2014-04-02 17:02:23 -05:00
Adam Pridgen
3fb12cddd1 fixed a bug in the annotations parsing and interfaces parsing 2014-04-01 19:45:44 -05:00
Adam Pridgen
6bc694f873 Added colorization to pdn and added a dead code warning if all the bytes in a method are not consumed during analysis. 2014-04-01 16:22:56 -05:00
Adam Pridgen
494e329d92 fixed bug for creating utf8 summary (thanks valgrind) 2014-03-31 15:52:03 -05:00
Adam Pridgen
9f8d8b7b2e Adding a print summary for the class file, and revamping how summary dumps string content 2014-03-31 15:35:47 -05:00
Adam Pridgen
85d7d8a11d Fixing a typo, using the wrong buffer 2014-03-31 10:35:18 -05:00
Adam Pridgen
7bee007b9c Class name replacement works 2014-03-30 14:04:15 -05:00
Adam Pridgen
a7bcdcab01 Adding class replacement 2014-03-28 21:06:26 -05:00
Adam Pridgen
fe0628fd14 Fixed java attribute readding bug 2014-03-28 20:56:07 -05:00
Adam Pridgen
6a50f55834 Fixing some of the coverity issues 2014-03-28 12:17:23 -05:00
Adam Pridgen
478d642434 Adding a command to shift blocks 2014-03-26 22:41:31 -05:00
Adam Pridgen
d0b9a6c023 Refactored java code. Now bins can be reloaded from buffers (in theory) 2014-03-26 14:35:42 -05:00
Adam Pridgen
c343ac5cab tweaking java parsing to enable class file structure modifications 2014-03-25 13:10:11 -05:00
Adam Pridgen
09fa5cf10c Added extend to io support, now files can be extended, b00y4! 2014-03-24 22:57:36 -05:00
Adam Pridgen
f724b74fa7 Adding search and replace for CP Constant Values like UTF8, ints, longs, floats, and doubles: 2014-03-23 23:06:33 -05:00
Adam Pridgen
9f468a3c2d fixed the java *_info c to name and count the methods and fields 2014-03-17 21:30:39 -05:00
pancake
92c5d8513b Refix link 2014-03-18 02:21:52 +01:00
pancake
31b8c6f377 Fix shared build 2014-03-18 01:51:36 +01:00
pancake
6a835f159d Fix static link 2014-03-18 01:36:54 +01:00
pancake
b1b02fba8e Fix linkage of RCoreJava plugin 2014-03-18 00:55:26 +01:00
Adam Pridgen
11b1cab8f5 Added some commands to print summary information for methods and fields, and added a
FUNC_META symbol for Java Method attribute.  This will report meta information for a
given method.
2014-03-17 02:14:38 -05:00
Adam Pridgen
62445c5e98 Adding java command plugin and moving the functionality out of the anal/p/anal_java.c code
Added functions to print information about CP Objects and read/write access flags
2014-03-16 22:32:18 -05:00
Adam Pridgen
b464851707 reduced the Java R_API footprint and fixed some other java related stuff 2014-03-15 15:18:45 -05:00
pancake
d25cafe4d4 Check Java version in RBin's check(), cleanup (-44LOC) 2014-02-22 00:19:16 +01:00
Adam Pridgen
a99cbddeaa Fix CIDS: 1182007 1182008 1182009 1182016 1182015 1182014 2014-02-20 23:51:53 -06:00
pancake
25809a0887 Fix some warnings and indentations 2014-02-20 03:08:12 +01:00
pancake
9634cc7a44 Fix too much memory usage in analysis (thanks saelo)
- Clear some warnings
- Implement Vc. to seek to cursor instead of entry0
2014-02-20 02:11:04 +01:00
Adam Pridgen
f6ac1f8d9b Fixing the coverity issues for java 2014-02-19 15:09:16 -06:00
Adam Pridgen
0efd93c57a Added Constant Pool Retrieval to anal_java command extension 2014-02-18 23:11:07 -06:00
Adam Pridgen
8f72843498 Refactoring java constant pool resolution 2014-02-18 22:29:03 -06:00
pancake
12dc36ce23 Sync with sdb 0.8.rc1 - lot of api changes 2014-02-19 05:02:59 +01:00
Adam Pridgen
4a2363fa9d Fix uninitialized var 2014-02-18 21:34:02 -06:00
Adam Pridgen
5b731da686 Adding Java types to the anal types sdb 2014-02-18 00:36:19 -06:00
Adam Pridgen
e0b605e939 Added command in anal_java to calculate access flags values 2014-02-17 11:01:23 -06:00
Adam Pridgen
0d82276a11 turn off debugging 2014-02-15 16:19:27 -06:00
Adam Pridgen
94d49d4065 Fixed writes/reads based on improper buffer size and array length values 2014-02-15 16:17:15 -06:00
Adam Pridgen
27674ad03e Fixed Java crashes and case statements for anal and print disasm by adding
a reset_counter (added to RAnalPlugin) or reset method address at the beginning
of each print disasm or analysis.  Also fixed a bug in reflines.c/disasm.c,
s.t. lines will be respected when printing disasm.
2014-02-15 09:42:14 -06: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
Adam Pridgen
d74e10e13b Fixed the many load so that when switching priority, offset is updated to the current bin. TODO: save offset when changing priority 2014-01-26 01:29:17 -06:00
pancake
473cd8953d ax -> afr ; more cleanup, add ark 2014-01-23 02:31:51 +01:00
pancake
5ff6065335 Bump for new sdb 2014-01-23 01:56:35 +01:00
Adam Pridgen
51a27ab1cc Coverity Fixes 2014-01-22 16:58:23 -06:00
Adam Pridgen
7c8ffcd259 Fixed a bug in the ops interpretation 2014-01-21 21:20:38 -06:00
Adam Pridgen
4c2fd70e49 Corrected the double value derivation 2014-01-21 20:38:43 -06:00
Adam Pridgen
b7961ef00a coverity fixes 2014-01-18 22:53:03 -06:00
Adam Pridgen
413411258d Fixed compile error in shlr/java/main.c and added offsets of class components in the class definition listing 2014-01-14 22:20:31 -06:00
deeso
b5eb1d1ae5 Added preliminary concept for analysis plugin cmd ext, implements a basic dump of class imports, fields, and method definitions. 2014-01-14 20:34:30 -06:00
pancake
a34f3d5434 Fix #534 - segfault when loading some ELF, MACH0 and PEs 2014-01-14 03:48:38 +01:00
Adam Pridgen
c3d551c024 Adding #%d in place of WTF for more informative java disasm 2014-01-13 18:48:56 -06:00
Adam Pridgen
5c140609be Added fix to update sym flags, cp_obj load addresses, and add functions after analysis 2014-01-13 15:49:33 -06:00
Adam Pridgen
20ac1d48e3 fixed an overflow condition in java utf8 strings 2014-01-12 22:47:34 -06: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
1134b36224 coverity fixes 2014-01-10 16:42:57 -06:00
Adam Pridgen
deb58b637a Added index open of files in zip:// uri and fixed entrypoints reported to include only static methods, main, the constructors 2014-01-10 16:30:47 -06:00
pancake
03ff72079f Fix the famous shlr/java overflow. Move along, nothing to see here 2014-01-10 19:07:25 +01:00
pancake
e5ad21d731 More cast issues fixed in shlr/java and anal 2014-01-10 18:24:47 +01:00
Adam Pridgen
737664ae87 Added RBinBind to RAnal to facilitate information passing between processed bin and analysis 2014-01-10 10:20:23 -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
pancake
9bd0ec57a0 Fix overflow in cmd_write.c and issue in shlr/java 2013-11-15 02:14:53 +01:00
Adam Pridgen
7510c3d0bd renamed NULL CP Object Type from (null) to NULL 2014-01-09 11:12:23 -06:00
Adam Pridgen
6e07c6a75a Fixed most warnings (excluding unused functions and vars) in class.* and p/anal_java 2014-01-09 10:13:35 -06:00
pancake
cded178fdb Fix 80 warnings and 1 segfault in shlr/java 2014-01-09 16:18:25 +01: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
01a2b485e7 Implement 'drc' command with all the RRegCond magic
- Fix all debug register profiles
- Support for X86 and ARM
- Allow to check conditional instructions
2014-01-08 23:23:06 +01:00
Vitezslav Cizek
85dc387ee9 add missing return to shlr/java/main.c 2014-01-08 00:09:21 +01:00
Adam Pridgen
b0593f9001 rename r_anal2 to r_anal_ex to fix namespace issues 2014-01-05 23:06:00 +01:00
Adam Pridgen
bc2ee1f869 Improved plugin analysis allowing plugin developers to define custom
analysis algorithms.
Java analysis plugin is re-written to leverage this capability.
Added some new R_ANAL types, and some of the respective operations and strings.
Updated io-component files to get file size and info
2014-01-03 00:28:46 +01:00
pancake
3b3bbbb916 Add more Jamroot files and move some plugs to r2-extras 2013-12-31 15:34:27 +01:00
Adam Pridgen
9494c5b405 Fixed coverity defects 2013-12-24 19:06:00 -06:00
Adam Pridgen
1832f71268 changed from individual keys to arrays 2013-12-21 22:19:47 -06:00
pancake
84f579264f Fix build 2013-12-22 04:37:05 +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
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
Adam Pridgen
567da7a1db Fixed bug in code offet reporting 2013-12-13 12:28:24 -06:00
Adam Pridgen
c706bf9bdd add missing java op 2013-12-13 11:37:54 -06:00
Adam Pridgen
893fd98b89 fixed coverity issues that were reported 2013-12-09 17:08:40 -06:00
Adam Pridgen
12ca0b206b disabled the debugging statements 2013-12-08 23:29:23 +01:00
Adam Pridgen
5a8ee7ba3d Fixed issue with p_stack_frame being null when parsing java class method 2013-12-08 23:29:19 +01:00
Adam Pridgen
1289476120 Cleaning up functionality and fix some bugs for Java 2013-12-06 05:42:35 +01:00
Adam Pridgen
b71bf37622 Fixed issue where strings were not loaded from bin_strings, because r->bin->minstrlen is zero (set from r_config) (fixed in set_items and r_bin_io_load) 2013-12-06 02:51:08 +01:00
pancake
05d7188a9a Fix dynamic format string functions
- s/r_str_dup_printf/r_str_newf/g
- Add r_strbuf_setf()
2013-12-04 00:20:52 +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
d02df0d306 Fix some issues reported by CoverityScan service 2013-12-03 00:14:59 +01:00
Adam Pridgen
0ea6509f03 Fixed construction of r_bin_io_load s.t. buffers, and fixed JavaFields initialization in class.c 2013-12-02 04:11:05 +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
39414a7a62 Fix snprintf in java/code.c 2013-11-14 02:41:03 +01:00
pancake
d630377905 Fix java nop opcode analysis 2013-10-25 00:45:30 +02:00
pancake
892a33ef23 Fix build and some warnings 2013-10-24 00:27:07 +02: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
Adam Pridgen
14975e552e Fixed Java CP Obj references and disassembly printouts 2013-10-20 23:42:53 -05: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
ae97789986 Fix lot of warnings 2013-09-14 14:04:08 +02:00
pancake
18cc767292 More emscripten/android build fixes 2013-09-07 02:20:38 +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