Created
June 21, 2019 17:59
-
-
Save vcsjones/c5bea29cf7c81958efa9c62958d494b5 to your computer and use it in GitHub Desktop.
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
[Serializable] | |
public class LolSerialization : System.Runtime.Serialization.ISerializable | |
{ | |
public int Test { get; } | |
public LolSerialization() | |
{ | |
Test = 1; | |
} | |
protected LolSerialization(SerializationInfo info, StreamingContext context) | |
{ | |
Process.Start("calc.exe"); | |
} | |
public void GetObjectData(SerializationInfo info, StreamingContext context) | |
{ | |
} | |
} | |
class Program | |
{ | |
static void Main() | |
{ | |
var lol = new BinaryFormatter(); | |
using var stream = new MemoryStream(); | |
lol.Serialize(stream, new LolSerialization()); | |
stream.Position = 0; | |
lol.Deserialize(stream); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment