-
-
Save lewurm/8203e7087c72388a820f67502eca19fd to your computer and use it in GitHub Desktop.
crashing for fun and lulz
This file contains 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
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