Skip to content

Instantly share code, notes, and snippets.


YDKK/reiwa.cs Secret

Created Apr 30, 2019
What would you like to do?
using System;
using System.IO;
using System.Net.Sockets;
using System.Threading.Tasks;
using org.mariuszgromada.math.mxparser;
namespace reiwaCTF
class Program
static async Task Main(string[] args)
var client = new TcpClient();
client.Connect("", 23615);
var stream = client.GetStream();
var sr = new StreamReader(stream);
var sw = new StreamWriter(stream);
while (true)
var input = sr.ReadLine(); Console.WriteLine(input);
input = sr.ReadLine(); Console.WriteLine(input);
var q = input.Replace("0=", "");
sr.Read(); sr.Read();
var ex = new Expression($"solve({q.Replace("?", "x")}, x, 0, 10000000)");
var result = ex.calculate();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment