smali

Q: Does this smali class decrypt data? what encryption is it using?

烂漫一生 提交于 2020-05-31 04:47:06
问题 Q: Does this smali class decrypt data? what encryption is it using? I need help finding out what this code uses to decrypt the file text it receives? the encrypted text prints out as expected in a jumbled mess, is there a way to manually decrypt the text using the information I need help understanding? thank you > < package utils; import android.util.Log; import com.crashlytics.android.Crashlytics; import java.io.BufferedOutputStream; import java.io.File; import java.io.FileOutputStream;

What's the best way to learn Smali (and how/when to use Dalvik VM opcodes)?

╄→尐↘猪︶ㄣ 提交于 2020-01-10 06:13:25
问题 I know Java, and learned C but never used it. I do not know any form of assembly, either for a virtual machine or a real one. What's the best way to learn how to hack Smali? 回答1: UPDATE: As I promised yesterday, I added some more links to the list. Ufff. Not much documentation around! Best advice? Decompile, and read, and tweak, and see how it did, and start the cycle again and again. But you did not ask for that advice, right? ;) Now, there are a few places out there that wil lhelp a little

copy else statement to if statement

倾然丶 夕夏残阳落幕 提交于 2020-01-07 03:24:09
问题 I am trying to copy the code of else state to the if statement. In here I see if-eqz as the if condition but I don't know where the else condition is here. Can someone help me find else condition so that I can copy it to become the if code also. I also want to know where is the start and the end of the else statement body if-eqz v1, :cond_1 .line 103 :goto_1 return-object v0 .line 82 :cond_0 invoke-static {}, Landroid/os/Environment;->getExternalStorageDirectory()Ljava/io/File; move-result

Smali syntax for DalvikVM opcodes

馋奶兔 提交于 2020-01-06 04:38:12
问题 Prologue I am trying to learn about DalvikVM instructions using the Smali/Baksmali assembler/disassembler for dex files. Problem From this java file package gd; class Hello { public static void main(String[] args) { System.out.println("Hello!"); } } I have generated the following smali assembly file: .class Lgd/Hello; .super Ljava/lang/Object; .source "Hello.java" # direct methods .method constructor <init>()V .registers 1 .prologue .line 3 invoke-direct {p0}, Ljava/lang/Object;-><init>()V

Smali: Increase number of registers

给你一囗甜甜゛ 提交于 2020-01-02 23:08:47
问题 I need an additional register to store a string in a smali method. I am aware of the register logic in smali code (see https://github.com/JesusFreke/smali/wiki/Registers), but i am still wondering how to archive an increase in registers. Assuming i have a method with .locals n . Now i want to have .locals n+1 . First i thought to iterate over the method and add 1 to each v register (v0 -> v1, v1 -> v2). Then v0 would be my new register and i would not clobber any existing data. Furthermore i

Direct .java to .smali conversion. Possible?

别说谁变了你拦得住时间么 提交于 2019-12-29 05:30:23
问题 I'm working with baksmali/smali tools. But sometimes I need to compile .java class to .smali file. So I've to first compile it with Eclipse and second disassemble the .APK to a set of .smali files. Is it possible to directly compile .java into .smali with one single tool? I couldn't find a solution myself... 回答1: "javac" or similar program can be used to convert the source code to .class. Android's "dx" is used to convert .class to Dalvik .dex. The result of that can be processed with the

Extracting all API calls from .smali files in android apk

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-23 22:19:57
问题 I want to extract all API calls from an Android application's apk. I have used apktool to get the smali code files from the apk. Manually I can spot some API calls, but I need an automated method. For example, I can see the getNetworkInfo call in this line of code: invoke-virtual {p0, v0}, Landroid/net/ConnectivityManager;->getNetworkInfo(I)Landroid/net/NetworkInfo; I have no experience with smali code and very little with Android application analysis; I only spotted the above API call

安卓逆向入门教程

…衆ロ難τιáo~ 提交于 2019-12-20 23:13:52
一、环境配置 1.常用工具: JDK/SDK/NDK eclpise集成开发环境/Android Studio AndroidKiller/jeb/jadx / GDA/Androidk逆向助手 IDA/GDB apkhelper/getsign/APK上上签 模拟器(雷电、海马玩等) MT管理器/RE文件管理器 2.工具安装注意事项: 1.jdk安装路径中不能有中文 2.ndk的配置路径中不能有中文和空格,可以把它放在根目录 3.安装包文件不全,运行会出错 3.APK文件: APK是Android Package的缩写,即Android安装包。APK是类似Symbian Sis或Sisx的文件格式。通过将APK文件直接传到Android模拟器或Android手机中执行即可安装。 4.APK文件目录: assets 不经过 aapt 编译的资源文件 lib .so文件 META-INF 文件摘要,摘要加密和签名证书文件目录 CERT.RSA 公钥和加密算法描述 CERT.SF 加密文件,它是使用私钥对摘要明文加密后得到的 密文信息,只有使用私钥配对的公钥才能解密该文 件 MANIFEST.MF 程序清单文件,它包含包中所有文件的摘要明文 res 资源文件目录,二进制格式 drawable 图片 layout 布局 menu 菜单 resources.arsc 经过 aapt

modifying .smali files

房东的猫 提交于 2019-12-18 10:24:37
问题 I reverse engineered some android apks to add some instrumentation for functional testing. I want to know given an smali as following how can I add something like Log.e(TAG, "some descritpion", e); to each method in the .smali files. .class public Ld; .super Landroid/view/View; .source "SourceFile" # instance fields .field a:Z .field b:Lcom/rovio/ka3d/App; # direct methods .method public constructor <init>(Lcom/rovio/ka3d/App;)V .locals 2 .parameter .prologue const/4 v1, 0x1 .line 317 invoke