This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dotnet tool install --global TrojanSourceDetector --version 1.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var nonRenderingCategories = new UnicodeCategory[] { UnicodeCategory.Control, | |
UnicodeCategory.OtherNotAssigned, | |
UnicodeCategory.Format, | |
UnicodeCategory.Surrogate }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Console.WriteLine("You are an admin."); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"user" ≠ "user // check if admin" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string access_level = "user"; | |
if (access_level != "user") //Check if admin | |
{ | |
Console.WriteLine("You are an admin."); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ Prop1.Prop2: pattern } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ Prop1: { Prop2: pattern } } |