BUUCTF 安卓逆向入门三连

Posted on 2021-11-15  29 Views


helloworld

安卓逆向入门题
使用Android killer打开,java反编译

发现flag

findit

下载附件,扔进jadx打开

发现加密后的flag字符串
编写解密脚本

public class Main {
      public static void main(String[] args) {
          final char[] a = {'T', 'h', 'i', 's', 'I', 's', 'T', 'h', 'e', 'F', 'l', 'a', 'g', 'H', 'o', 'm', 'e'};
        final char[] b = {'p', 'v', 'k', 'q', '{', 'm', '1', '6', '4', '6', '7', '5', '2', '6', '2', '0', '3', '3', 'l', '4', 'm', '4', '9', 'l', 'n', 'p', '7', 'p', '9', 'm', 'n', 'k', '2', '8', 'k', '7', '5', '}'};
        char[] x = new char[17];
        char[] y = new char[38];
        for (int i2 = 0; i2 < 38; i2++) {
            if ((b[i2] < 'A' || b[i2] > 'Z') && (b[i2] < 'a' || b[i2] > 'z')) {
                y[i2] = b[i2];
            } else {
                y[i2] = (char) (b[i2] + 16);
                if ((y[i2] > 'Z' && y[i2] < 'a') || y[i2] >= 'z') {
                    y[i2] = (char) (y[i2] - 26);
                }
            }
        }
        System.out.println(y);

    }
}

运行得到flag

简单注册机

使用jadx打开

发现加密函数,直接copy下来就可以得到flag

public class Main {
    public static void main(String args[]) {
        char[] x = "dd2940c04462b4dd7c450528835cca15".toCharArray();
        x[2] = (char) ((x[2] + x[3]) - 50);
        x[4] = (char) ((x[2] + x[5]) - 48);
        x[30] = (char) ((x[31] + x[9]) - 48);
        x[14] = (char) ((x[27] + x[28]) - 97);
        for (int i = 0; i < 16; i++) {
            char a = x[31 - i];
            x[31 - i] = x[i];
            x[i] = a;
        }
        System.out.println(x);
    }
}

欢迎来到parafish的个人博客,这里是一个正在努力的ctfer

路虽远,行则必至