using System.Text; namespace Flypaper.Core.Strategies; public static class LureContent { public const string PagePath = "/"; public const string IconPath = "/favicon.ico"; public static readonly IReadOnlyDictionary Headers = new Dictionary { ["X-Powered-By"] = "PHP/8.1.27", ["Link"] = "; rel=\"https://api.w.org/\"" }; public static bool Handles(string? path) => string.Equals(path, PagePath, StringComparison.Ordinal) || string.Equals(path, IconPath, StringComparison.OrdinalIgnoreCase); public static byte[] Page() => Encoding.UTF8.GetBytes(""" Intranet – Just another WordPress site

Intranet

Just another WordPress site

Hello world!

Welcome to WordPress. This is your first post. Edit or delete it, then start writing!

"""); public static byte[] Icon() { const int size = 16; using var stream = new MemoryStream(); using var writer = new BinaryWriter(stream); writer.Write((ushort)0); writer.Write((ushort)1); writer.Write((ushort)1); writer.Write((byte)size); writer.Write((byte)size); writer.Write((byte)0); writer.Write((byte)0); writer.Write((ushort)1); writer.Write((ushort)32); var imageSize = 40 + size * size * 4 + size * 4; writer.Write(imageSize); writer.Write(22); writer.Write(40); writer.Write(size); writer.Write(size * 2); writer.Write((ushort)1); writer.Write((ushort)32); writer.Write(0); writer.Write(size * size * 4); writer.Write(0); writer.Write(0); writer.Write(0); writer.Write(0); for (var y = 0; y < size; y++) { for (var x = 0; x < size; x++) { var dx = x - 7.5; var dy = y - 7.5; var inside = dx * dx + dy * dy <= 56; writer.Write(inside ? 0xFF8A5A21u : 0u); } } writer.Write(new byte[size * 4]); return stream.ToArray(); } }