Android smali question

I am currently researching smali / "obfuscator for code", and now I'm trying to get acquainted with decompiled source codes. To do this, I created a simple application and decompiled it smali.

I am trying to understand decompiled source code to improve and compare security (versus decompilation) after using obfuscator code later. Although most smali sources are not that complicated, I still have problems converting digit formats.

Can you explain to me, for example. next line. I guess it should have a value of five, but I'm not sure what binary format it is. How to calculate it 0x4014 = 5 ???

const-wide/high16 v0, 0x4014       // 100000000010100        (5 = 101)

The complete java codes and smali codes for this test function are included:

Java source:

 boolean test(int a, double d) {
        if (a < 5 && d < 5)
            return true;
        else 
            return false;
    }

Source Smali:

.method test(ID)Z
    .locals 2
    .parameter "a"
    .parameter "d"

    .prologue
    .line 28
    const/4 v0, 0x5

    if-ge p1, v0, :cond_0

    const-wide/high16 v0, 0x4014

    cmpg-double v0, p2, v0

    if-gez v0, :cond_0

    .line 29
    const/4 v0, 0x1

    .line 31
    :goto_0
    return v0

    :cond_0
    const/4 v0, 0x0

    goto :goto_0
.end method
+5
3

, - dalvik (short/integer/long/etc.) (float/double). , baksmali , ​​ , integer.

, , . dalvik-bytecode dalvik:

" (-- 64 ) .".

, 0x4014000000000000 v0 v1. 64- IEEE-754. ( ) , 11 ( 2), 52 .

0100000000010100000000000000000000000000000000000000000000000000
SEEEEEEEEEEEMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM

0 1 .

11 ( 1025) 1023 2.

"1" , 2 ^ 0, 2 ^ -1, 2 ^ -2 .. , 1.01, 1 * 2 ^ 0 + 1 * 2 ^ -2, 1.25.

, ,

-1 ^ (2 + S) * M * 2 ^ E

S, M E - , .

-1 ^ (2 + 0) * 1,25 * 2 ^ 2 = 1 * 1,25 * 4 = 5

, -, . http://babbage.cs.qc.edu/IEEE-754/64bit.html .

+12

, , , :

100000000010100
smmmmmmmmmmmmee

s= sign, m= mantissa, e= . , 1 , 5, :

+5 x 2 ^ 0 = 5

. . -, 15 , , 2- , - . . , .

+1

-, "5" , .

0

All Articles