Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import 'package:flutter/material.dart';
- // Author: @odinshell
- void main() {
- runApp(MyApp());
- }
- class MyApp extends StatelessWidget {
- // This widget is the root of your application.
- @override
- Widget build(BuildContext context) {
- return MaterialApp(
- title: 'RevIt',
- theme: ThemeData(
- primarySwatch: Colors.red,
- visualDensity: VisualDensity.adaptivePlatformDensity,
- ),
- home: MyHomePage(title: 'NullbreakerCTF 2020'),
- );
- }
- }
- class MyHomePage extends StatefulWidget {
- MyHomePage({Key key, this.title}) : super(key: key);
- final String title;
- @override
- _MyHomePageState createState() => _MyHomePageState();
- }
- class _MyHomePageState extends State<MyHomePage> {
- int _counter = 0;
- int i = 0;
- String _flag = "";
- String _status = "Sup?";
- int ord;
- void _incrementCounter() {
- setState(() {
- _counter++;
- if(_counter > 400){
- _status = "Nice, Keep going";
- if(_counter > 700){
- _status = "You're almost there!";
- }
- }
- if(_counter > 850){
- var secret = ['\xa7', '\xab', '\xca', '\xbd', '\xcf', '\x92', ']', '\xa7', '\xcd', '\x9b', 'Y', '\xa0', '\xcd', '\xb6', '\xaf', 'X', '\x9c', '^', '^', 'Z', '\x9b', '\xb6', '\x9b', 'Z', '\x9f', 'Z', '\x9b', '\xba', 'X', '\xa7', '\xce', '\x94'];
- if(_flag == ""){
- for(i = 0; i < secret.length; i++){
- ord = (secret[i].codeUnits[0] + 1200) ^ 1337;
- _flag = _flag + new String.fromCharCode(ord);
- }
- }
- } else {
- _flag = "";
- }
- });
- }
- @override
- Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: Text(widget.title),
- ),
- body: Center(
- child: Column(
- mainAxisAlignment: MainAxisAlignment.center,
- children: <Widget>[
- Text(
- '$_status',
- style: Theme.of(context).textTheme.headline4,
- ),
- Text(
- '$_counter',
- style: Theme.of(context).textTheme.headline5,
- ),
- Text(
- '$_flag',
- ),
- ],
- ),
- ),
- floatingActionButton: FloatingActionButton(
- onPressed: _incrementCounter,
- tooltip: 'Increment',
- child: Icon(Icons.add),
- ),
- );
- }
- }
Add Comment
Please, Sign In to add comment