Skip to content

Instantly share code, notes, and snippets.

View lgolubyev's full-sized avatar

Leo Golubyev lgolubyev

  • @dotnetsafer
  • Spain
View GitHub Profile
@article{boucher_trojansource_2021,
title = {Trojan {Source}: {Invisible} {Vulnerabilities}},
author = {Nicholas Boucher and Ross Anderson},
year = {2021},
journal = {Preprint},
eprint = {2111.00169},
archivePrefix = {arXiv},
primaryClass = {cs.CR},
url = {https://arxiv.org/abs/2111.00169}
}
dotnet tool install --global TrojanSourceDetector --version 1.0.1
var nonRenderingCategories = new UnicodeCategory[] {
UnicodeCategory.Control,
UnicodeCategory.OtherNotAssigned,
UnicodeCategory.Format,
UnicodeCategory.Surrogate };
using StreamReader sr = new StreamReader(dotnetFile);
while (sr.Peek() >= 0)
{
var c = (char)sr.Read();
var category = Char.GetUnicodeCategory(c);
var nonRenderingCategories = new UnicodeCategory[] { UnicodeCategory.Control,
UnicodeCategory.OtherNotAssigned,
UnicodeCategory.Format,
UnicodeCategory.Surrogate };
Console.WriteLine("You are an admin.");
"user" ≠ "user // check if admin"
string access_level = "user";
if (access_level != "user"⁦) //Check if admin
{
Console.WriteLine("You are an admin.");
}
List<Status> statuses = new()
{
new(Category.Normal, new(20, false, 20)),
new(Category.Warning, new(20, false, 60)),
new(Category.Danger, new(20, true, 60)),
new(Category.Danger, new(100, false, 20))
};
foreach (Status status in statuses)
{
string message = status switch
{ Prop1.Prop2: pattern }
{ Prop1: { Prop2: pattern } }