public bool Protect(ProtectorState state, string output_filename, Stream stream) { if (state == ProtectorState.During) { StripDOSHeader(stream); return(true); } return(false); }
static void PerformProtections(ProtectorState state, string output_filename, Stream stream) { foreach (var protection in protections) { if (protection.enabled) { if (protection.Protect(state, output_filename, stream)) { Console.WriteLine(protection.init_message); } stream.Position = 0; } } }
public bool Protect(ProtectorState state, string output_filename, Stream stream) { if (state == ProtectorState.During) { InjectAntiTamper(stream); return(true); } if (state == ProtectorState.Post) { InjectHash(output_filename); return(true); } return(false); }