Initial commit

This commit is contained in:
2026-09-19 16:10:04 +03:00 Unverified
commit 0e525f691b
4 changed files with 408 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Text;
namespace IPClab2;
internal class Program
{
static void Main(string[] args)
{
var secretBytes = Encoding.UTF8.GetBytes("Super secret data\0");
GCHandle handle = GCHandle.Alloc(secretBytes, GCHandleType.Pinned);
try
{
IntPtr memAddress = handle.AddrOfPinnedObject();
int currentPid = Process.GetCurrentProcess().Id;
Console.WriteLine("oh yep hi");
Console.WriteLine(currentPid);
Console.WriteLine($"0x{memAddress.ToInt64():X}");
Console.ReadLine();
Console.WriteLine(Encoding.UTF8.GetString(secretBytes));
Console.ReadLine();
}
finally
{
handle.Free();
}
}
}