This file contains hidden or 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
| <html> | |
| <head> | |
| <title>Invaders!</title> | |
| <style type="text/css"> | |
| .invader { visibility: hidden } | |
| </style> | |
| </head> | |
| <body> | |
| <div class="invader">#990000</div> | |
| <div class="invader">#009900</div> |
This file contains hidden or 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 PixIt = { | |
| load : function () { | |
| var j = { | |
| "pixelsWide": 13, | |
| "pixelsHigh": 10, | |
| "pixelSize": 8, | |
| "payload": | |
| [ | |
| { | |
| "color": '#000000', |
This file contains hidden or 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
| private static void WriteResponse( | |
| HttpResponse response, | |
| byte[] buffer) | |
| { | |
| response.ContentType = "plain/text"; | |
| response.Write(Convert.ToBase64String(buffer)); | |
| response.Flush(); | |
| } |
This file contains hidden or 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
| public class Voles | |
| { | |
| private static int _daysBeforeFirst = 25; | |
| private static int _daysBetween = 20; | |
| private static Dictionary<int, long> _cache = | |
| new Dictionary<int, long>(); | |
| public static long F(int days) { | |
| if (!_cache.ContainsKey(days)) { |
This file contains hidden or 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
| public class ViewableAttribute: Attribute {} |
This file contains hidden or 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
| public class NotificationTamperer : ITamperer | |
| { | |
| private readonly string _assemblyOutputFileName; | |
| public NotificationTamperer() : this("default_tampered.dll") {} | |
| public NotificationTamperer(string assemblyOutputFileName) | |
| { | |
| _assemblyOutputFileName = assemblyOutputFileName; | |
| } |
This file contains hidden or 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
| public bool MaybeTamperWith() | |
| { | |
| return _typeDef.IsClass | |
| && HasPropertiesToTamperWith() | |
| && ReallyTamperWith(); | |
| } | |
| private bool HasPropertiesToTamperWith() | |
| { | |
| FindPropertiesToTamperWith(); |
This file contains hidden or 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
| private bool ReallyTamperWith() | |
| { | |
| EnsureTypeImplementsInterface(); | |
| TamperWithPropertySetters(); | |
| return true; | |
| } | |
| private void EnsureTypeImplementsInterface() | |
| { | |
| if (!TypeAlreadyImplementsInterface()) |
This file contains hidden or 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
| public class TypeResolver | |
| { | |
| private readonly TypeDefinition _typeDef; | |
| private readonly IDictionary<Type, TypeReference> _typeRefs = | |
| new Dictionary<Type, TypeReference>(); | |
| private readonly TypeSystem _ts; | |
| private readonly ModuleDefinition _systemModule; | |
| private readonly ModuleDefinition _mscorlibModule; | |
| public TypeResolver(TypeDefinition typeDef) |
This file contains hidden or 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
| private void InjectEventHandler() | |
| { | |
| InjectPropertyChangedField(); | |
| InjectEventDeclaration(); | |
| } | |
| private void InjectPropertyChangedField() | |
| { | |
| //.field private class [System]System.ComponentModel.PropertyChangedEventHandler PropertyChanged | |
| var field = new FieldDefinition(PropertyChangedFieldName, |