159 Commits

Author SHA1 Message Date
JesusFreke@JesusFreke.com
3f7739cd09 Add support for specifying a base dir for the BOOTCLASSPATH files
git-svn-id: https://smali.googlecode.com/svn/trunk@629 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-15 02:00:58 +00:00
JesusFreke@JesusFreke.com
2e2a187734 Don't output register information on switch/array data structures
git-svn-id: https://smali.googlecode.com/svn/trunk@628 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-14 21:57:48 +00:00
JesusFreke@JesusFreke.com
1c56c7e750 Add finer grained control of what register information is printed out
git-svn-id: https://smali.googlecode.com/svn/trunk@625 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-14 20:04:59 +00:00
JesusFreke@JesusFreke.com
da69b22d6f Use a double instead of an int as the sort value for method items
git-svn-id: https://smali.googlecode.com/svn/trunk@624 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-14 20:04:39 +00:00
JesusFreke@JesusFreke.com
db385ec3fd Don't load the instructions in a code item when loading the BOOTCLASSPATH dex files
git-svn-id: https://smali.googlecode.com/svn/trunk@623 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-14 20:04:20 +00:00
JesusFreke@JesusFreke.com
c9be5e1303 Tons of fixes related to getting "verbose register info"/type analysis to work
git-svn-id: https://smali.googlecode.com/svn/trunk@621 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-11 00:58:02 +00:00
JesusFreke@JesusFreke.com
7e24a9f010 Preliminary implementation of "verbose register info" functionality
git-svn-id: https://smali.googlecode.com/svn/trunk@620 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-02-08 02:28:37 +00:00
JesusFreke@JesusFreke.com
fffb29fd9d Implement ClassPath class, refactor analysis code to use new ClassPath functionality, start adding verification for individual opcodes
git-svn-id: https://smali.googlecode.com/svn/trunk@574 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-24 00:55:17 +00:00
JesusFreke@JesusFreke.com
7eef1e37e7 Add addition "FirstInstrucitonTest" method to the deodex_test1 baksmali test
git-svn-id: https://smali.googlecode.com/svn/trunk@563 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:10:37 +00:00
JesusFreke@JesusFreke.com
b2e1e2067d deodex refactoring part 1
Significantly simplified how instructions are handled in baksmali. Normal
disassembly seems to be working, deodexing definitely not.

git-svn-id: https://smali.googlecode.com/svn/trunk@561 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:10:23 +00:00
JesusFreke@JesusFreke.com
575bd4ce54 Remove unused 'fixed' field from DeodexUtil.insn
git-svn-id: https://smali.googlecode.com/svn/trunk@560 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:09:51 +00:00
JesusFreke@JesusFreke.com
563bc66041 whitespace change
git-svn-id: https://smali.googlecode.com/svn/trunk@559 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:09:43 +00:00
JesusFreke@JesusFreke.com
42e4ef4892 Refactor the opcode enum to have a flags field, to store the odexOnly and canThrow flags
And get rid of the instructionThrowTable in DeodexUtil

git-svn-id: https://smali.googlecode.com/svn/trunk@558 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:09:35 +00:00
JesusFreke@JesusFreke.com
1f478c3228 Added comment for Deodexerant class
git-svn-id: https://smali.googlecode.com/svn/trunk@557 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:09:26 +00:00
JesusFreke@JesusFreke.com
f568b80d16 Moved DeodexUtil and Deodexerant classes to baksmali
git-svn-id: https://smali.googlecode.com/svn/trunk@556 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 08:09:19 +00:00
JesusFreke@JesusFreke.com
16a911620c General cleanup/refactoring/maintentance
- Added some additional context information for exceptions in various locations
- Refactored all code offsets so that they use 2-byte code block address, instead of a byte offset.
- Additionally changed all "offset" terminology refering to code offsets to "address" instead
- Changed the way the getItemByIndex and getOffsettedItemByOffset work, so that they throw an
exception if the index/offset is -1/0.
- Added additional getOptionalItemByIndex and getOptionalOffsettedItemByOffset methods, to be used
in the cases where an index/offset of -1/0 is valid, to indicate the absence of an item
- Other misc cleanup/maintentance

git-svn-id: https://smali.googlecode.com/svn/trunk@552 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-12 07:56:16 +00:00
JesusFreke@JesusFreke.com
be2472d6d7 Add support for the upcoming execute-inline/range odexed instruction
git-svn-id: https://smali.googlecode.com/svn/trunk@544 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-01 22:35:54 +00:00
JesusFreke@JesusFreke.com
c9c2ec3d48 Add "support" for odexed instructions using Format3rms
Also, change the name of the invoke-*-range-quick opcodes to invoke-*-quick/range,
to be consistent with the naming scheme of non-odexed opcodes

git-svn-id: https://smali.googlecode.com/svn/trunk@542 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-01 22:35:35 +00:00
JesusFreke@JesusFreke.com
f322260c22 Add "support" for odexed instructions using Format22cs
git-svn-id: https://smali.googlecode.com/svn/trunk@541 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2010-01-01 22:35:21 +00:00
JesusFreke@JesusFreke.com
22296e7f83 Added assertion+comment, to clarify a misleading null check
git-svn-id: https://smali.googlecode.com/svn/trunk@536 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-31 01:25:32 +00:00
JesusFreke@JesusFreke.com
7d9b1b10f0 use createTemplate and createReference instead of makeTemplate and makeReference
git-svn-id: https://smali.googlecode.com/svn/trunk@534 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-31 01:25:19 +00:00
JesusFreke@JesusFreke.com
81ab1aa726 Add warning about disassembling an odex file without deodexing it
git-svn-id: https://smali.googlecode.com/svn/trunk@533 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-31 01:24:56 +00:00
JesusFreke@JesusFreke.com
7f9cfb3a68 rename "indexed labels" stuff to "sequential labels"
git-svn-id: https://smali.googlecode.com/svn/trunk@530 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-26 00:10:05 +00:00
JesusFreke@JesusFreke.com
630f5dc2dc Add support for the -b option for baksmali, to suppress the output of debug info
git-svn-id: https://smali.googlecode.com/svn/trunk@522 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-25 23:05:20 +00:00
JesusFreke@JesusFreke.com
311ee79fab Complete and fix-up the implementation of autofixing instructions
git-svn-id: https://smali.googlecode.com/svn/trunk@511 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:28:21 +00:00
JesusFreke@JesusFreke.com
fda2e631ac Refactor instructions to store individual pieces of data instead of just using an offset into a buffer
Also included is a partial implementation of the logic needed to automatically fix various types of issues

git-svn-id: https://smali.googlecode.com/svn/trunk@502 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:26:59 +00:00
JesusFreke@JesusFreke.com
5867263eb5 line ending and trailing whitespace cleanup
git-svn-id: https://smali.googlecode.com/svn/trunk@500 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:25:59 +00:00
JesusFreke@JesusFreke.com
eb78b7fa64 Minor cleanup
git-svn-id: https://smali.googlecode.com/svn/trunk@499 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:24:58 +00:00
JesusFreke@JesusFreke.com
d1dc954863 Remove unused comment parameter for instruction method items
git-svn-id: https://smali.googlecode.com/svn/trunk@498 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:24:50 +00:00
JesusFreke@JesusFreke.com
e24e70f9ad Handle unresolvable instructions in a more intellegent manner
Don't replace an unresolvable instruction with replacement instruction(s) that
are larger, to avoid inserting extra bytes, and possibly moving jump type
instructions too far from their targets.

git-svn-id: https://smali.googlecode.com/svn/trunk@497 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-23 05:24:27 +00:00
JesusFreke@JesusFreke.com
e2684fa219 - refactored/simplified the label code
- changed the handler_ label prefix to catch_ and catchall_
- added support for the new -i/--indexed-labels option, which numbers the labels incrementally for each method by type, rather than using the bytecode offset

git-svn-id: https://smali.googlecode.com/svn/trunk@493 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-01 08:14:21 +00:00
JesusFreke@JesusFreke.com
8555ce95d5 converted the labels in the deodex tests to the new label format
git-svn-id: https://smali.googlecode.com/svn/trunk@492 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-12-01 08:13:57 +00:00
JesusFreke@JesusFreke.com
a5fb30849d minor verbage change for the -l/--use-locals option
git-svn-id: https://smali.googlecode.com/svn/trunk@491 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-23 07:27:19 +00:00
JesusFreke@JesusFreke.com
ff80035f43 add support for the .locals directive and the --use-locals/-l option for baksmali
git-svn-id: https://smali.googlecode.com/svn/trunk@489 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-11-23 06:47:33 +00:00
JesusFreke@JesusFreke.com
090e553f34 check if a static final field is set within the static constructor, and if so, add a comment stating such if it makes sense to do so (for primitive types, or reference/array types that have a non-null initializer)
git-svn-id: https://smali.googlecode.com/svn/trunk@481 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 04:48:50 +00:00
JesusFreke@JesusFreke.com
05c9404ecd set the SparseArrays even if classDataItem is null
git-svn-id: https://smali.googlecode.com/svn/trunk@480 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 04:47:17 +00:00
JesusFreke@JesusFreke.com
29f49465ca Use a SparseArray instead of a HashMap, and add get*Count methods to AnnotationDirectoryItem so we can initialize the SparseArrays with the correct capacity
git-svn-id: https://smali.googlecode.com/svn/trunk@478 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-19 03:18:35 +00:00
JesusFreke@JesusFreke.com
3d632a6234 Fixed the template for commented out labels
git-svn-id: https://smali.googlecode.com/svn/trunk@471 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 22:06:09 +00:00
JesusFreke@JesusFreke.com
4a0d9d3fa1 Change the sytax for labels from label: to :label
git-svn-id: https://smali.googlecode.com/svn/trunk@467 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-13 02:50:42 +00:00
JesusFreke@JesusFreke.com
04473936a1 remove test println
git-svn-id: https://smali.googlecode.com/svn/trunk@458 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:45:15 +00:00
JesusFreke@JesusFreke.com
8e9ceda4f9 expand the test case to test out more stuff
git-svn-id: https://smali.googlecode.com/svn/trunk@457 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:43:44 +00:00
JesusFreke@JesusFreke.com
a171922cbd add TODO
git-svn-id: https://smali.googlecode.com/svn/trunk@456 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:43:15 +00:00
JesusFreke@JesusFreke.com
c65a8d8b5f Added better support for the case when an optimized instruction can't be resolved due to the object register always being null. It should comment out any dead code following the unresolved instruction (to prevent verification issues, due to the changed method call)
git-svn-id: https://smali.googlecode.com/svn/trunk@455 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 06:40:58 +00:00
JesusFreke@JesusFreke.com
cf4e7ce360 added another deodex test case
git-svn-id: https://smali.googlecode.com/svn/trunk@453 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-10 01:22:25 +00:00
JesusFreke@JesusFreke.com
c3deed2751 Added a tricky test case for the deodexer
git-svn-id: https://smali.googlecode.com/svn/trunk@450 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-09 05:15:40 +00:00
JesusFreke@JesusFreke.com
f0e3677538 fix the "null" fixed instructions.. again
git-svn-id: https://smali.googlecode.com/svn/trunk@442 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 20:34:19 +00:00
JesusFreke@JesusFreke.com
285dfd013a Fix the registers in the dummy method calls used to replace null pointer method invokes/field accesses
git-svn-id: https://smali.googlecode.com/svn/trunk@438 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 08:27:52 +00:00
JesusFreke@JesusFreke.com
631326836e Add opcode parameter
git-svn-id: https://smali.googlecode.com/svn/trunk@437 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 07:28:06 +00:00
JesusFreke@JesusFreke.com
5b89857df3 Initial commit of deodex functionality in dexlib and baksmali
git-svn-id: https://smali.googlecode.com/svn/trunk@435 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-09-08 06:27:32 +00:00
JesusFreke@JesusFreke.com
5f98a29260 Add support for the odex only opcodes
git-svn-id: https://smali.googlecode.com/svn/trunk@432 55b6fa8a-2a1e-11de-a435-ffa8d773f76a
2009-08-30 04:28:11 +00:00