Skip to content

Instantly share code, notes, and snippets.

@lewurm
Created November 16, 2016 20:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lewurm/8203e7087c72388a820f67502eca19fd to your computer and use it in GitHub Desktop.
Save lewurm/8203e7087c72388a820f67502eca19fd to your computer and use it in GitHub Desktop.
crashing for fun and lulz
using Android.App;
using Android.Widget;
using Android.OS;
namespace lulzcrash {
[Activity (Label = "lulzcrash" ,MainLauncher = true ,Icon = "@mipmap/icon")]
public class MainActivity : Activity {
int count = 1;
[System.Runtime.InteropServices.DllImport ("libc")]
private static extern long strcpy (long dst ,long src);
protected override void OnCreate (Bundle savedInstanceState) {
base.OnCreate (savedInstanceState);
SetContentView (Resource.Layout.Main);
Button button = FindViewById<Button> (Resource.Id.myButton);
button.Click += delegate {
button.Text = string.Format ("{0} clicks!" ,count++);
strcpy (0 ,0);
};
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment