Guess-the-Number


14最佳Writeup由 kyzok 提供

收藏

反馈

难度:2

方向:Reverse

题解数:12

解出人数:1948

题目来源: CTF

题目描述:

猜个数字然后找到flag.

1.using jadx-gui

adworld-Guess-the-Number_开发语言

2.using eclipse

import java.math.BigInteger;

/* renamed from: guess  reason: default package */
public class guess {
    static String XOR(String _str_one, String _str_two) {
        return new BigInteger(_str_one, 16).xor(new BigInteger(_str_two, 16)).toString(16);
    }

    public static void main(String[] args) {
        if (args.length > 0) {
            try {
                if (309137378 == Integer.parseInt(args[0])) {
                    int my_num = 349763335 + 345736730;
                    System.out.println("your flag is: " + XOR("4b64ca12ace755516c178f72d05d7061", "ecd44646cfe5994ebeb35bf922e25dba"));
                    return;
                }
                System.err.println("wrong guess!");
                System.exit(1);
            } catch (NumberFormatException e) {
                System.err.println("please enter an integer \nexample: java -jar guess 12");
                System.exit(1);
            }
        } else {
            System.err.println("wrong guess!");
            int num = 1000000 + 1;
            System.exit(1);
        }
    }
}

//a7b08c546302cc1fd2a4d48bf2bf2ddb

edit

import java.math.BigInteger;

/* renamed from: guess  reason: default package */
public class guess {
    static String XOR(String _str_one, String _str_two) {
        return new BigInteger(_str_one, 16).xor(new BigInteger(_str_two, 16)).toString(16);
    }

    public static void main(String[] args) {
    	
        if (args.length > 0) {
            try {
                if (309137378 == Integer.parseInt(args[0])) {
                    int my_num = 349763335 + 345736730;
                    System.out.println("your flag is: " + XOR("4b64ca12ace755516c178f72d05d7061", "ecd44646cfe5994ebeb35bf922e25dba"));
                    return;
                }
                System.err.println("wrong guess!");
                System.exit(1);
            } catch (NumberFormatException e) {
                System.err.println("please enter an integer \nexample: java -jar guess 12");
                System.exit(1);
            }
        } else {
            System.err.println("wrong guess!");
            int my_num = 349763335 + 345736730;
            System.out.println("your flag is: " + XOR("4b64ca12ace755516c178f72d05d7061", "ecd44646cfe5994ebeb35bf922e25dba"));
            //return;
            int num = 1000000 + 1;
            System.exit(1);
        }
    }
}

wrong guess!

your flag is: a7b08c546302cc1fd2a4d48bf2bf2ddb