本文为看雪论坛优秀文章
看雪论坛作者ID:以和爲貴
1.java层反调试so层反调试
2.静态动态分析so层
3.frida来hook java层和so层
4.Android的文件格式
package com.example.application;
import android.app.Activity;
import android.content.IntentFilter;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
public class MainActivity extends Activity {
public MainActivity() {
super();
}
public void onCreate(Bundle arg6) {
super.onCreate(arg6);
TextView v2 = new TextView(this.getApplicationContext());
v2.setText("Select the activity you wish to interact with.To-Do: Add buttons to select activity, for now use Send_to_Activity");
// 输出再屏幕上的文字
this.setContentView(((View)v2));
IntentFilter v0 = new IntentFilter();
v0.addAction("com.ctf.INCOMING_INTENT");
this.registerReceiver(new Send_to_Activity(), v0, "ctf.permission._MSG", null);
// 注册一个广播
}
}
package com.example.application;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.widget.Toast;
public class Send_to_Activity extends BroadcastReceiver {
public Send_to_Activity() {
super();
}
public void onReceive(Context arg5, Intent arg6) {
String get_message = arg6.getStringExtra("msg");
if(get_message.equalsIgnoreCase("ThisIsTheRealOne")) {
// 接收不同的信息,跳向不同的分支
arg5.startActivity(new Intent(arg5, ThisIsTheRealOne.class));
}
else if(get_message.equalsIgnoreCase("IsThisTheRealOne")) {
arg5.startActivity(new Intent(arg5, IsThisTheRealOne.class));
}
else if(get_message.equalsIgnoreCase("DefinitelyNotThisOne")) {
arg5.startActivity(new Intent(arg5, DefinitelyNotThisOne.class));
}
else {
Toast.makeText(arg5, "Which Activity do you wish to interact with?", 1).show();
}
}
ublic class DefinitelyNotThisOne extends Activity {
static {
System.loadLibrary("hello-jni");
}
perhapsThis_args:[1] TRytfrgooq|F{i-JovFBungFk\[email protected]^
[2] ZGFkNGIwYzIWYjEzMTUWNjVjNTVlNjZhOGJkNhYtODIyOGEaMTMWNmQaOTVjZjkhMzRjYmUzZGE?
[3] MzQxZTZmZjAxMmIiMWUzNjUxMmRiYjIxNDUwYTUxMWItZGQzNWUtMzkyOWYyMmQeYjZmMzEaNDQ?
perhapsThis_result: Congratulation!YouFoundTheRightActivityHereYouGo-CTF{IDontHaveABadjokeSorry}
#include<bits/stdc++.h>
using namespace std;
void destr();
void tea_decode1(uint32_t *origin, uint32_t *key) {
uint32_t v0 = origin[0], v1 = origin[1], i;
uint32_t delta = 0x61C88647;
uint32_t sum = 0xC6EF3720;
uint32_t k0 = key[0], k1 = key[1], k2 = key[2], k3 = key[3];
for (i = 0; i < 32; i++) {
v1 -= ((v0 << 4) + k2) ^ (v0 + sum) ^ ((v0 >> 5) + k3);
v0 -= ((v1 << 4) + k0) ^ (v1 + sum) ^ ((v1 >> 5) + k1);
sum += delta;
}
origin[0] = v0;
origin[1] = v1;
}
int main() {
destr();
uint32_t v27[8];
v27[0] = 0x26BB4EA4;
v27[1] = 0x69BBDC43;
v27[2] = 0xDB3F2F5C;
v27[3] = 0x7BBD2F9F;
v27[4] = 0x65CDFE31;
v27[5] = 0x3E91AEC4;
v27[6] = 0xE703AF94;
v27[7] = 0xC7D1E1F4;
uint32_t key[4];
key[0] = 0x67616C66;
key[1] = 0x6948747B;
key[2] = 0x24215F53;
key[3] = 0x37256E5F;
for (int i = 0; i < 8; i += 2) {
tea_decode1(&v27[i], key);
}
cout << (char *) v27 << std::endl;
return 0;
}
void destr() {
uint32_t v26[10], v25[10];
v26[0] = 0x821A9220;
v26[1] = 0x96CD43F3;
v26[2] = 0x36D481BA;
v26[3] = 0xCB2C076D;
v26[4] = 0xDC65768;
v26[5] = 0xBAB4DE5D;
v26[6] = 0x7571980F;
v26[7] = 0xE382ECC7;
v26[8] = 0xC733E8E0;
v26[9] = 0x74812F26;
v25[0] = 0x1DA05DA0;
v25[1] = 0xB07E328;
v25[2] = 0xB572D778;
v25[3] = 0xC3EE27BB;
v25[4] = 0xD200541B;
v25[5] = 0xA595C8E0;
v25[6] = 0x44B3A5C8;
v25[7] = 0x21F11604;
v25[8] = 0xDD1EBA82;
v25[9] = 0xD4CBF19C;
uint32_t key[4];
key[0] = 0x67616C66;
key[1] = 0x6948747B;
key[2] = 0x24215F53;
key[3] = 0x37256E5F;
for (int i = 0; i < 10; i += 2) {
tea_decode1(&v25[i], key);
}
cout << (char *) v25 << std::endl;
for (int i = 0; i < 10; i += 2) {
tea_decode1(&v26[i], key);
}
cout << (char *) v26 << std::endl;
}
看雪ID:以和爲貴
https://bbs.pediy.com/user-home-939330.htm
# 往期推荐
球分享
球点赞
球在看
点击“阅读原文”,了解更多!