ACTF Dice Game Writeup

ACTF也算是结束了,浙大的那帮人脑洞也是够大的 π__π 这题目也是坑得可以。。。像我这样的渣渣只能是挑所有题目中最简单的来了。

这次的ctf好坑啊,竟然所有逆向破解题都是apk,我完全不会啊(>﹏<),只能弄到ppc了。

Dice Game 题目直接把python的源码贴了出来。源码如下:

#!/usr/bin/env python
# coding: utf-8
"""
Yet another problem for ACTF2015.
By H4sIAOzUQ1UCAwtIzUuvLFVwzkjNU9AoAHMccjKTiksSi4oy0yr1ivM1uQCpNCsJJAAAAA==
COPYLEFT, ALL WRONGS RESERVED.
"""

import random
import time
import sys
assert sys.version_info >= (3, 2)


NUM_ROUNDS = 1000
SCORE_INITIAL = 100
SCORE_ROUND = 10
SCORE_BONUS = 2


class WeBreakup(Exception):
    """Hmmm.. :("""
    pass


def play_round(scores):
    """Plays a single round. Returns round status and new scores."""
    print('..and your guess is?')
    guess = input()
    point = random.randint(1, 6)
    mapping = {x: 'small' if x <= 3 else 'big' for x in range(1, 7)}
    if guess == mapping[point]:
        print('Correct. :(')
        guessing_correct = True
        # You know I'm the boss, right?
        score_delta = SCORE_ROUND - SCORE_BONUS
        scores = (scores[0] - score_delta, scores[1] + score_delta)
    else:
        print('Incorrect! :)')
        guessing_correct = False
        # You know I'm the boss, right?
        score_delta = SCORE_ROUND + SCORE_BONUS
        scores = (scores[0] + score_delta, scores[1] - score_delta)
    return (guessing_correct, scores)


def play_game():
    """Plays a game."""
    print('Hey hey, you you, I wanna play a game! :)')
    reply = input()
    if reply not 
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值