Jarvis OJ 61 dctf androideasy write up

直接用JEB进行反编译,发现是一个简单的加密算法,flag长度要和源码中给定数组的长度相同,然后再对给定数组中的每一个数异或23就可以了。

public MainActivity() {
        super();
        this.s = new byte[]{113, 123, 118, 112,108, 94, 99, 72, 38, 68, 72, 87, 89, 72, 36, 118, 100, 78, 72, 87, 121, 83,101, 39, 62, 94, 62, 38, 107, 115, 106};
    }

public boolean check() {
        boolean v2 = false;
        byte[] v0 =this.editText.getText().toString().getBytes();
        if(v0.length == this.s.length) {
            int v1 = 0;
            while(v1 < this.s.length) {
                if(v1 >= v0.length) {
                    break;
                }
                if(this.s[v1] == (v0[v1] ^ 23)){
                    ++v1;
                    continue;
                } else {
                    return v2;
                }
            }
            v2 = true;
        }
        return v2;
    }


求解flag代码:

#include  <iostream>
#include  <cstdio>
#include  <cstring>
using namespacestd;
int s[] = {113,123, 118, 112, 108, 94, 99, 72, 38, 68, 72, 87, 89, 72, 36, 118, 100, 78, 72,87, 121, 83, 101, 39, 62, 94, 62, 38, 107, 115, 106};
int main() {
    int len = 31;
    for(int i = 0; i < len; i++) {
          printf("%c", s[i]^23);
    }
    return 0;
}



猜你喜欢

转载自blog.csdn.net/wannafly1995/article/details/80849239