CalebFenton / dex-oracle

A pattern based Dalvik deobfuscator which uses limited execution to improve semantic analysis
MIT License
489 stars 115 forks source link

Smali compilation failed on macOS #26

Open skeltavik opened 6 years ago

skeltavik commented 6 years ago

I got an error stating that the smali compilation procedure is failing. Any idea what can be the problem?

I'm running this on macOS 10.14 Mojave

Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got itsme-1.32.0004.apk
    at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
    at com.beust.jcommander.JCommander.parse(JCommander.java:304)
    at com.beust.jcommander.JCommander.parse(JCommander.java:287)
    at org.jf.baksmali.Main.main(Main.java:90)
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/plugin.rb:19: warning: constant ::NIL is deprecated
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/plugin.rb:19: warning: constant ::Data is deprecated
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/plugin.rb:19: warning: constant ::TRUE is deprecated
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/plugin.rb:19: warning: constant ::FALSE is deprecated
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/plugin.rb:19: warning: constant ::Fixnum is deprecated
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/plugin.rb:19: warning: constant ::Bignum is deprecated
Optimizing 0 methods over 0 Smali files.
Optimizations:
Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got /var/folders/r5/l_1fgfmd39z6gs_6whhtd_kw0000gn/T/d20180814-2606-1po2zww
    at com.beust.jcommander.JCommander.parseValues(JCommander.java:725)
    at com.beust.jcommander.JCommander.parse(JCommander.java:304)
    at com.beust.jcommander.JCommander.parse(JCommander.java:287)
    at org.jf.smali.Main.main(Main.java:87)
Traceback (most recent call last):
    5: from /usr/local/bin/dex-oracle:23:in `<main>'
    4: from /usr/local/bin/dex-oracle:23:in `load'
    3: from /usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/bin/dex-oracle:96:in `<top (required)>'
    2: from /usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/smali_input.rb:18:in `finish'
    1: from /usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/smali_input.rb:35:in `update_apk'
/usr/local/lib/ruby/gems/2.5.0/gems/dex-oracle-1.0.5/lib/dex-oracle/smali_input.rb:30:in `compile': Crap, smali compilation failed. (RuntimeError)
CalebFenton commented 6 years ago

Thanks for the report.

What version of smali / baksmali do you have on your path?

What version of dex-oracle are you using? Is it from master?

hynekdav commented 6 years ago

Hello, I got the same error. I have smali/baksmali version 2.2.4, in my path. I am using dex-oracle version 1.0.5 installed via gem install dex-oracle.

CalebFenton commented 6 years ago

@hynekdav thanks for the info. I think I just need to update the published gem from what's on master. Could you test with master as a confirmation?

I think it's the new versions of smali / baksmali require subcommands (assemble, disassemble) and maybe 1.0.5 dex-oracle doesn't know that.

hynekdav commented 6 years ago

@CalebFenton it works just fine bundled from master.

ddzobov commented 5 years ago

Have same problem.

Installed step-by-step from readme and got this error. Any updates?

CalebFenton commented 5 years ago

Try from master?

ddzobov commented 5 years ago

Built gem from master - no difference 😔

CalebFenton commented 5 years ago

What's the exact error you're getting?

On Sun, Nov 11, 2018 at 7:15 AM Daniil Zobov notifications@github.com wrote:

Built gem from master - no difference 😔

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/CalebFenton/dex-oracle/issues/26#issuecomment-437678660, or mute the thread https://github.com/notifications/unsubscribe-auth/ABSzckIz8ehyliZP7q4oDpk-3yjfKZ2Wks5uuD75gaJpZM4V8TP3 .

ddzobov commented 5 years ago

What's the exact error you're getting?

Exception in thread "main" com.beust.jcommander.MissingCommandException: Expected a command, got simple.apk

ddzobov commented 5 years ago

Solved. Ran from bin directory