惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
Securelist
O
OpenAI News
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
T
Threat Research - Cisco Blogs
D
Darknet – Hacking Tools, Hacker News & Cyber Security
Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
N
News and Events Feed by Topic
S
Security Affairs
SecWiki News
SecWiki News
Project Zero
Project Zero
L
Lohrmann on Cybersecurity
P
Proofpoint News Feed
P
Palo Alto Networks Blog
L
LINUX DO - 最新话题
H
Hacker News: Front Page
Recent Commits to openclaw:main
Recent Commits to openclaw:main
I
Intezer
Simon Willison's Weblog
Simon Willison's Weblog
W
WeLiveSecurity
T
The Exploit Database - CXSecurity.com
K
Kaspersky official blog
The GitHub Blog
The GitHub Blog
I
InfoQ
云风的 BLOG
云风的 BLOG
雷峰网
雷峰网
B
Blog
IT之家
IT之家
AWS News Blog
AWS News Blog
Jina AI
Jina AI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Google DeepMind News
Google DeepMind News
Spread Privacy
Spread Privacy
N
News and Events Feed by Topic
Security Latest
Security Latest
美团技术团队
C
Check Point Blog
WordPress大学
WordPress大学
T
Tenable Blog
S
Security @ Cisco Blogs
Last Week in AI
Last Week in AI
博客园 - 聂微东
月光博客
月光博客
博客园 - 【当耐特】
S
Schneier on Security
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
Secure Thoughts
Schneier on Security
Schneier on Security
C
Cisco Blogs
Cyberwarzone
Cyberwarzone

博客园 - 星辰之力

网站工具 Vue项目用于Ios和Android端开发 Android assets文件夹之位置放置和作用 轻松搭建Xposed Hook cordov vue项目中调用手机原生api Android 逆向实战篇(加密数据包破解) Android JNI中C调用Java方法 Android Studio NDK JNI动态注册本地方法 JNI C反射调用java方法 JNI NDK (AndroidStudio+CMake )实现C C++调用Java代码流程 Jni 线程JNIEnv,JavaVM,JNI_OnLoad(GetEnv返回NULL?FindClass返回NULL?) Jni OnLoad()和OnUnload() Android JNI之C/C++层调用JAVA Android NDK编译之undefined reference to 'JNI_CreateJavaVM' Android 开创java世界(JNI Invocation API) Android JNI c/c++调用java 无需新建虚拟机 cmake:善用find_package()提高效率暨查找JNI支持 如何解决用CMake未定义引用`JNI_CreateJavaVM'? [Linker error] undefined reference to `_imp__JNI_CreateJavaVM@12'
Android 直接修改dex破解
星辰之力 · 2019-03-29 · via 博客园 - 星辰之力

  直接修改dex破解

一.编写一个简单的验证程序

(1)MainActivity:

 protected void onCreate(BundlesavedInstanceState) {
               super.onCreate(savedInstanceState);
               setContentView(R.layout.activity_main);
               Buttonbutton ;
               finalEditText text1,text2;
               button=(Button)findViewById(R.id.button1);
               //获取两个输入框的数据
               text1= (EditText)findViewById(R.id.editText1);
               text2=(EditText)findViewById(R.id.editText2);
               button.setOnClickListener(newOnClickListener() {
               @Override
               public void onClick(View v) {
               //TODO Auto-generated method stub
               //对输入框的书进行判断
                 if(text1.getText().toString().equals("CHINA")&&text2.getText().toString().equals("302")){
                         StringcontentToShow = "Hi,"+text1.getText().toString();
                         Toast.makeText(MainActivity.this,contentToShow,Toast.LENGTH_LONG).show();
                 }else{
                      StringcontentToShow = "NO."+text1.getText().toString()+"it isincorrect";      
                      Toast.makeText(MainActivity.this,contentToShow,Toast.LENGTH_LONG).show();
              }
       }
   });
 }

(2)activity_main.xml

<RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"

   xmlns:tools="http://schemas.android.com/tools"

   android:layout_width="match_parent"

   android:layout_height="match_parent"

   android:paddingBottom="@dimen/activity_vertical_margin"

   android:paddingLeft="@dimen/activity_horizontal_margin"

   android:paddingRight="@dimen/activity_horizontal_margin"

   android:paddingTop="@dimen/activity_vertical_margin"

   tools:context="com.example.toast.MainActivity" >



   <Button

        android:id="@+id/button1"

       android:layout_width="wrap_content"

       android:layout_height="wrap_content"

       android:layout_alignLeft="@+id/editText1"

       android:layout_alignParentTop="true"

        android:layout_marginLeft="63dp"

       android:layout_marginTop="204dp"

        android:text="点击" />



   <TextView

        android:id="@+id/textView2"

       android:layout_width="wrap_content"

       android:layout_height="wrap_content"

        android:layout_alignParentTop="true"

       android:layout_marginRight="22dp"

       android:layout_marginTop="44dp"

       android:layout_toLeftOf="@+id/editText1"

        android:text="请输入:" />

   <EditText 
        android:id="@+id/editText1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentRight="true"
        android:layout_alignTop="@+id/textView2"
        android:layout_marginRight="61dp"
        android:ems="10" />

   <TextView
        android:id="@+id/textView1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignParentLeft="true"
        android:layout_below="@+id/editText1"
        android:layout_marginTop="65dp"
        android:text="数字密码:" />

   <EditText
          android:id="@+id/editText2"
          android:layout_width="wrap_content"
          android:layout_height="wrap_content"
          android:layout_alignLeft="@+id/editText1"
          android:layout_alignTop="@+id/textView1"
          android:ems="10"
          android:inputType="numberPassword" >
        <requestFocus />
   </EditText>
</RelativeLayout>

二.利用IDAPro及Winhex进行破解

1.解压得到classesdex文件

(1)打开IDAPro,将classes.dex拖放到IDAPro的主窗口,会弹出加载新文件的对话框,IDAPro解析出了该文件属于“Android DEX File”,保持默认的选项

(2)跳转到区段

通过第三种方法来判断方法的功能,我们知道low.apk的主类为MainActivity,于是在Export选项卡输入Main,代码会自动重新定位到以Main头所在行。 

(3)找到变量

三、修改变量。

使用Winhe打开classes.dex文件

(1) 将CHINA变量改为DIJOB

(2) 将密码302改为524

四.修复classes.dex文件

用Dexfixer将classes.dex文件checksum值修复 

签名成功后得到一个singed.apk的文件 

六、adb 进行安装测试

安装命令:

七、测试

输入用户名:DIJOB

输入密码:524

成功弹出