Skip to content

Instantly share code, notes, and snippets.

@YDKK YDKK/reiwa.cs Secret
Created Apr 30, 2019

Embed
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("zerois-o-reiwa.seccon.jp", 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();
Console.WriteLine(result);
sw.WriteLine(result);
sw.Flush();
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.