i have been getting a lot of questions about string decryption lately, so let's talk.
let's say you have an app and notice encrypted strings. strings are an easy way to get a basic idea of what code is doing so naturally you want to decrypt them. but how? there are many different ways to encrypt strings and then decrypt at runtime but in practices there are some assumptions we can make in decreasing order of likelihood.
1. the encryption must be reversible. the strings must be decrypted at run time somehow. this is good but we can assume even more.
2. the process is automated. when Alice wants to release her app she puts the source code through an automated modification process which iterates over every string literal, encrypts it and replaces it with a call to a decryption method with the encrypted string as a parameter.
3. decryption is the same or nearly the same for each string. there is only one decryption method.
4. the type signature of the method is:
while these assumptions hold, it is not very difficult to create a general technique by which we can decrypt all of the strings of an app in place. the real question is do you want to do it at the java or smali level? if you primarily look at decompiled code you can work at the java level. and you're in luck, such a tool already exists in dex2jar: http://code.google.com/p/dex2jar/
there is a wiki article about it here: http://code.google.com/p/dex2jar/wiki/DecryptStrings but it is unfinished. you can at least get a visual for what the decompiled code will look like before and after. if you're a good person, you will update the wiki. i leave that as a task for some good reader.
the tool is currently incorrectly spelled as d2j-decrpyt-string.(sh|bat). it takes at least two parameters and sometimes needs three. they are:
doing this at the smali level requires access to a dalvik vm, so in that regard it is trickier, but there are many emulators and you can even use your phone. here's how the process can work:
let's say you have an app and notice encrypted strings. strings are an easy way to get a basic idea of what code is doing so naturally you want to decrypt them. but how? there are many different ways to encrypt strings and then decrypt at runtime but in practices there are some assumptions we can make in decreasing order of likelihood.
1. the encryption must be reversible. the strings must be decrypted at run time somehow. this is good but we can assume even more.
2. the process is automated. when Alice wants to release her app she puts the source code through an automated modification process which iterates over every string literal, encrypts it and replaces it with a call to a decryption method with the encrypted string as a parameter.
3. decryption is the same or nearly the same for each string. there is only one decryption method.
4. the type signature of the method is:
static String decryptMethod(String)
while these assumptions hold, it is not very difficult to create a general technique by which we can decrypt all of the strings of an app in place. the real question is do you want to do it at the java or smali level? if you primarily look at decompiled code you can work at the java level. and you're in luck, such a tool already exists in dex2jar: http://code.google.com/p/dex2jar/
there is a wiki article about it here: http://code.google.com/p/dex2jar/wiki/DecryptStrings but it is unfinished. you can at least get a visual for what the decompiled code will look like before and after. if you're a good person, you will update the wiki. i leave that as a task for some good reader.
the tool is currently incorrectly spelled as d2j-decrpyt-string.(sh|bat). it takes at least two parameters and sometimes needs three. they are:
- method name, -mn : in our case, decryptMethod
- method owner, -mo : let's say com.alice.utils
- class path, -cp : if decryptMethod makes use of any framework api, you will need to give the path to a framework.jar from the android.sdk
d2j-decrpyt-string -mn decryptMethod -mo com.alice.utils -cp ~/android/sdk/platforms/android-4/framework.jar
doing this at the smali level requires access to a dalvik vm, so in that regard it is trickier, but there are many emulators and you can even use your phone. here's how the process can work:
- pull out all of the strings and put into a file
- write some java code, unless you're comfortable with smali, to open the file and iterate over each line and call the decryption method on each string.
- compile java bytecode and convert to dalvik executable with dx from the android sdk
- run the code on a dalvik vm
Nice to see a new post :D really interesting, sometimes to decrypt encrypted-strings files I reverse the algorithm and convert it to Java!
ReplyDeleteNihilus
well that's certainly the pro way of doing it Nihilus. and i'm still around just busy learning. :D
DeleteI'm busy too, these weeks I have 3 University exams. Hope I'll have more time to spend in reversing! Keep up the good work! If you have pro guides or something interesting to share you know the mail! :P
DeleteNihilus
Nihilus i need to talk for the dexgaurd brother,
Deletehere is the email jaspreetsinghplayer@gmail
Hi,
ReplyDeleteI have bought some app for my kid with amazon app-shop. after buying it I uninstalled Amazon-shop app (don't want to be logged in on kids tablet). So now this app don't want work without amazon-app and log in info. Have tried to decompile this app with apk-tool, but even if I do nothing change and rekompile the app it won't work anymore.
do you know how to crack amazon checker.
Plz make a tut to crack subway surf to unlimited coins
ReplyDeleteArticles that are nice and very interesting. I like to read the articles you make...
ReplyDeleteNice Article. Thank you for sharing the informative article with us. Morpheus tv apk is the best online Streaming App.Click the below link to know more about
ReplyDeleteMorpheus tv apk
morpheus tv
morpheus tv apk
morpheus app
morpheus tv ios
morpheus tv on your windows
ReplyDeletevidmate
Thank you for taking the time to provide us with your valuable information. We strive to provide our candidates with excellent care
ReplyDeletehttp://chennaitraining.in/creo-training-in-chennai/
http://chennaitraining.in/building-estimation-and-costing-training-in-chennai/
http://chennaitraining.in/machine-learning-training-in-chennai/
http://chennaitraining.in/data-science-training-in-chennai/
http://chennaitraining.in/rpa-training-in-chennai/
http://chennaitraining.in/blueprism-training-in-chennai/
Read Latest 2020 Hindi, Punjabi Song Lyrics:
ReplyDeleteSocial Disdancing Lyrics in Hindi - Manj Musik, Manak-E
वक़्त Waqt Lyrics in Hindi - Oye Kunaal
डियर मामा Dear Mama Lyrics in Hindi - Sidhu Moose Wala
विहा नई करौना Viah Nai Karauna Lyrics in Hindi - Asees Kaur
भीगी भीगी Bheegi Bheegi Lyrics in Hindi – Neha Kakkar, Tony Kakkar
भूला ना तेरी बातें Bhula Na Teri Baatein Lyrics in Hindi - Stebin Ben
मंज़िल Manzil Lyrics in Hindi - Jatt Prabhjot | lyricswhispering
**SELLING SSN+DOB FULLZ**
ReplyDeleteCONTACT
Telegram > @leadsupplier
ICQ > 752822040
Email > leads.sellers1212@gmail.com
>>1$ each without DL/ID number
>>2$ each with DL
>>5$ each for premium (also included relative info)
*Will reduce price if buying in bulk
*Hope for a long term business
FORMAT OF LEADS/FULLZ/PROS
->FULL NAME
->SSN
->DATE OF BIRTH
->DRIVING LICENSE NUMBER WITH EXPIRY DATE
->COMPLETE ADDRESS
->PHONE NUMBER, EMAIL, I.P ADDRESS
->EMPLOYMENT DETAILS
->REALTIONSHIP DETAILS
->MORTGAGE INFO
->BANK ACCOUNT DETAILS
>Fresh Leads for tax returns & w-2 form filling
>Payment mode BTC, ETH, LTC, PayPal, USDT & PERFECT MONEY
''OTHER GADGETS PROVIDING''
>SSN+DOB Fullz
>CC with CVV
>Photo ID's
>Dead Fullz
>Spamming Tutorials
>Carding Tutorials
>Hacking Tutorials
>SMTP Linux Root
>DUMPS with pins track 1 and 2
>Sock Tools
>Server I.P's
>HQ Emails with passwords
Email > leads.sellers1212@gmail.com
Telegram > @leadsupplier
ICQ > 752822040
THANK YOU
Hey! Looking for an commercial ice maker ? Then this site will help you out finding the best one for you.="https://icemakerszone.com/best-commercial-ice-maker/"
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteThis comment has been removed by the author.
ReplyDeleteFreezer compartment
ReplyDeleteThe best Camping ice maker is here.
ReplyDelete
ReplyDeleteTutorguideinindia.com is the best platform where you can find your dream Best clat coaching in delhi.The website lists 10 best clat coaching institutes in Delhi NCR with their fees, reviews, and faculty details. If you're trying to find an institute to prepare for the clat test, this article will help you.