Guest User

TapTap source code: NullBreaker CTF

a guest
May 26th, 2020
294
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Dart 2.39 KB | None | 0 0
  1. import 'package:flutter/material.dart';
  2.  
  3. // Author: @odinshell
  4.  
  5. void main() {
  6.   runApp(MyApp());
  7. }
  8.  
  9. class MyApp extends StatelessWidget {
  10.   // This widget is the root of your application.
  11.   @override
  12.   Widget build(BuildContext context) {
  13.     return MaterialApp(
  14.       title: 'RevIt',
  15.       theme: ThemeData(
  16.         primarySwatch: Colors.red,
  17.         visualDensity: VisualDensity.adaptivePlatformDensity,
  18.       ),
  19.       home: MyHomePage(title: 'NullbreakerCTF 2020'),
  20.     );
  21.   }
  22. }
  23.  
  24. class MyHomePage extends StatefulWidget {
  25.   MyHomePage({Key key, this.title}) : super(key: key);
  26.  
  27.   final String title;
  28.  
  29.   @override
  30.   _MyHomePageState createState() => _MyHomePageState();
  31. }
  32.  
  33. class _MyHomePageState extends State<MyHomePage> {
  34.   int _counter = 0;
  35.   int i = 0;
  36.   String _flag = "";
  37.   String _status = "Sup?";
  38.   int ord;
  39.  
  40.   void _incrementCounter() {
  41.     setState(() {
  42.       _counter++;
  43.       if(_counter > 400){
  44.         _status = "Nice, Keep going";
  45.         if(_counter > 700){
  46.           _status = "You're almost there!";
  47.         }
  48.       }
  49.       if(_counter > 850){
  50.         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'];
  51.         if(_flag == ""){
  52.           for(i = 0; i < secret.length; i++){
  53.             ord = (secret[i].codeUnits[0] + 1200) ^ 1337;
  54.             _flag = _flag + new String.fromCharCode(ord);
  55.           }
  56.         }
  57.       } else {
  58.         _flag = "";
  59.       }
  60.     });
  61.   }
  62.  
  63.   @override
  64.   Widget build(BuildContext context) {
  65.     return Scaffold(
  66.       appBar: AppBar(
  67.         title: Text(widget.title),
  68.       ),
  69.       body: Center(
  70.         child: Column(
  71.           mainAxisAlignment: MainAxisAlignment.center,
  72.           children: <Widget>[
  73.             Text(
  74.               '$_status',
  75.               style: Theme.of(context).textTheme.headline4,
  76.             ),
  77.             Text(
  78.               '$_counter',
  79.               style: Theme.of(context).textTheme.headline5,
  80.             ),
  81.             Text(
  82.               '$_flag',
  83.             ),
  84.           ],
  85.         ),
  86.       ),
  87.       floatingActionButton: FloatingActionButton(
  88.         onPressed: _incrementCounter,
  89.         tooltip: 'Increment',
  90.         child: Icon(Icons.add),
  91.       ),
  92.     );
  93.   }
  94. }
Add Comment
Please, Sign In to add comment