Last active
December 31, 2015 14:49
-
-
Save piroor/8002725 to your computer and use it in GitHub Desktop.
Crash firefox by js-ctypes (run in the scratch pad or the browser console)
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
(function(){ | |
Components.utils.import('resource://gre/modules/ctypes.jsm'); | |
var library = ctypes.open(ctypes.libraryName('nss3')); | |
var PR_Free = library.declare( | |
'PR_Free', | |
ctypes.default_abi, | |
ctypes.void_t, | |
ctypes.voidptr_t | |
); | |
var ptr = new ctypes.voidptr_t(0123); | |
PR_Free(ptr); | |
})(); |
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
(function() { | |
Components.utils.import('resource://gre/modules/ctypes.jsm'); | |
var lib = ctypes.open(ctypes.libraryName('msvcr100')); | |
var free = lib.declare( | |
'free', | |
ctypes.default_abi, | |
ctypes.void_t, | |
ctypes.voidptr_t // ptr | |
); | |
free(new (new ctypes.PointerType(ctypes.int))(123456789)); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment