buuctf findit

核心代码:

    protected void onCreate(Bundle arg8) {
        super.onCreate(arg8);
        this.setContentView(0x7F030018);
        this.findViewById(0x7F05003D).setOnClickListener(new View$OnClickListener(new char[]{'T', 'h', 'i', 's', 'I', 's', 'T', 'h', 'e', 'F', 'l', 'a', 'g', 'H', 'o', 'm', 'e'}, this.findViewById(0x7F05003E), new char[]{'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', '}'}, this.findViewById(0x7F05003F)) {
            public void onClick(View arg13) {
                int v11 = 17;
                int v10 = 0x7A;
                int v9 = 90;
                int v8 = 65;
                int v7 = 97;
                char[] v3 = new char[v11];
                char[] v4 = new char[38];
                int v0;
                for(v0 = 0; v0 < v11; ++v0) {
                    if(this.val$a[v0] >= 73 || this.val$a[v0] < v8) {
                        if(this.val$a[v0] < 105 && this.val$a[v0] >= v7) {
                        label_39:
                            v3[v0] = ((char)(this.val$a[v0] + 18));
                            goto label_44;
                        }

                        if(this.val$a[v0] >= v8 && this.val$a[v0] <= v9 || this.val$a[v0] >= v7 && this.val$a[v0] <= v10) {
                            v3[v0] = ((char)(this.val$a[v0] - 8));
                            goto label_44;
                        }

                        v3[v0] = this.val$a[v0];
                    }
                    else {
                        goto label_39;
                    }

                label_44:
                }

                if(String.valueOf(v3).equals(this.val$edit.getText().toString())) {
                    v0 = 0;
                    goto label_18;
                }
                else {
                    this.val$text.setText("答案错了肿么办。。。不给你又不好意思。。。哎呀好纠结啊~~~");
                    return;
                label_18:
                    while(v0 < 38) {
                        if(this.val$b[v0] < v8 || this.val$b[v0] > v9) {
                            if(this.val$b[v0] >= v7 && this.val$b[v0] <= v10) {
                            label_80:
                                v4[v0] = ((char)(this.val$b[v0] + 16));
                                if((v4[v0] <= v9 || v4[v0] >= v7) && v4[v0] < v10) {
                                    goto label_95;
                                }

                                v4[v0] = ((char)(v4[v0] - 26));
                                goto label_95;
                            }

                            v4[v0] = this.val$b[v0];
                        }
                        else {
                            goto label_80;
                        }
                    label_95:
                        ++v0;
                    }
                    this.val$text.setText(String.valueOf(v4));
                }
            }
        });
    }

其中程序有2层验证逻辑,但第1层可以忽略,直接复制代码,输出v4。v4为flag
编写java代码如下:

```java
import java.util.Arrays
class HelloWorld1{
        public static void main(String[] args){
                char[] val$b =new char[]{'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[] v4 = new char[38];
                int v0 = 0;               
                while(v0 < 38) {
                        if(val$b[v0] < 65 || val$b[v0] > 90) {
                            v4[v0] = val$b[v0];

                            if(val$b[v0] >= 97 && val$b[v0] <= 122) {
                                v4[v0] = ((char)(val$b[v0] + 16));
                                if((v4[v0] <= 90 || v4[v0] >= 97) && v4[v0] < 122) {
                                }
                                else
                                {
                                    v4[v0] = ((char)(v4[v0] - 26));
                                }                                
                            }                            
                        }                        
                        ++v0;                              
                    }  System.out.print(v4);                   
        }   
    }
```

输出flag:flag{c164675262033b4c49bdf7f9cda28a75}

发布了4 篇原创文章 · 获赞 0 · 访问量 126

猜你喜欢

转载自blog.csdn.net/pondzhang/article/details/104979129
今日推荐