0

i have an apk.
i used apktool.jar to get smali sources.
but generated smali file is weird as it contains all the instructions targeted to v0.

sample instructions:

mul-int v0, p0, p0  
rsub-int v0, v0, 0x201  
move/from16 v0, v1 

and each method has .array-data at the end.
any help in understanding this would be really helpful?

MacHiry
  • 13
  • 3
  • I don't see anything weird about the instructions that you mention. What do you find weird about them? – JesusFreke Sep 21 '12 at 23:50
  • as all of the instructions are destined to v0. here the effect of first 2 instructions is nullified by third instruction. why would some one need such instructions? – MacHiry Sep 22 '12 at 18:03
  • Ah, ok. I didn't realize those were actual sequential instructions. Your comment made it sound like they were just a random sampling of instructions. Are you saying that *all* instructions use a destination of v0? In that particular case, it's possible it's just a programming error (e.g. int a=0x201-b*b; a=d;) – JesusFreke Sep 22 '12 at 19:42
  • i guess it could be programming error. i tried installing and running the APK. installing went fine but running the MainActivity resulted in SIGSEV. – MacHiry Sep 22 '12 at 21:04
  • That's really strange. I guess it's just an invalid apk.. – JesusFreke Sep 23 '12 at 00:29
  • can you please post more code – Imposter Dec 19 '12 at 09:28

1 Answers1

0

In regards to the .array-data thing specifically, this is a set of data that gets used to initialize an array, using the fill-array-data instruction.

For more information, take a look at the fill-array-data-payload structure and the fill-array-data instruction, on http://s.android.com/tech/dalvik/dalvik-bytecode.html

JesusFreke
  • 19,784
  • 5
  • 65
  • 68
  • i understand that, but doubt i have is that: for all the instructions destination operand is v0 and no instructions is using v0 as its source operand. what is the use of computation when nothing is being used of it. – MacHiry Sep 22 '12 at 18:37