Closed GoogleCodeExporter closed 9 years ago
I'm confused. What does jasper have to do with the output of baksmali?
And yes, the syntax of the parameter info changed in 2.*. This is documented at
https://code.google.com/p/smali/wiki/SmaliBaksmali20
Original comment by jesusfreke@jesusfreke.com
on 11 Feb 2014 at 6:49
Sorry for that. Jasper is my name.
I put it there as a tag to distinguish words between the question and my
answer, then when I want wo find something, just ctrl+f to find jasper.
otherwise I have to scroll the mouse wheel to find something.
now I'm learning Reverse Engineering on Android. and want to know how to use
disassembler tools.
then I find that my outputs lose the syntax of the parameter info, the other
one's have the syntax.
I check what we do are different. it is the baksmali version.
mine is 2.0.3, his is 1.4.0.
The java code Hello.java is simple :
public class Hello
{
public int foo (int a, int b)
{
return (a + b) * (a - b);
}
public static void main(String [] argc)
{
Hello hello = new Hello();
System.out.println(hello.foo(5, 3));
}
}
Generate dex file Hello.dex by java and dx utility. then disassemble Hello.dex
to Hello.smali. I focus on the translation of method foo. the generation of
baksmali2.0.3 is below, which lose the syntax of the parameter info
# virtual methods
.method public foo(II)I
.registers 5
.prologue
.line 5
add-int v0, p1, p2
sub-int v1, p1, p2
mul-int/2addr v0, v1
return v0
.end method
and the baksmali1.4.0 is below, which has the syntax of the parameter info.
# virtual methods
.method public foo(II)I
.registers 5
.parameter
.parameter
.prologue
.line 5
add-int v0, p1, p2
sub-int v1, p1, p2
mul-int/2addr v0, v1
return v0
.end method
I don't know why they are different, so post the issue.
Original comment by lixingh...@gmail.com
on 12 Feb 2014 at 2:25
Ah, ok. Jasper is also the name of a java (not dalvik) bytecode disassembler,
so I thought that's what you were referring to.
(http://www.angelfire.com/tx4/cus/jasper/)
And yes, the .parameter directives that 1.4.0 output in that case conveyed no
meaning. In 2.* I tightened up the logic for when a .param directive is
generated, so that they don't get generated in cases like these, where they
contain no information.
In general, the .param directive is used to specify a parameter name and/or any
annotations associated with the parameter. If there is no name or annotations
for a parameter in the dex file, then baksmali 2.* won't output a .param
directive.
Original comment by jesusfreke@jesusfreke.com
on 12 Feb 2014 at 2:47
[deleted comment]
Yeah, I know it.
Thank you very much.
:)
Original comment by lixingh...@gmail.com
on 12 Feb 2014 at 9:21
Original issue reported on code.google.com by
lixingh...@gmail.com
on 11 Feb 2014 at 10:00Attachments: