Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
;;; javad.el --- Java decompiler
(defun javad-buffer ()
"run jad on contents of buffer"
(lexical-let* ((f-name (buffer-file-name))
(new-f-name (concat temporary-file-directory "jad/" (file-name-base f-name) ".jad"))
(old-buf (buffer-name))
(done (lambda (&rest args)
(kill-buffer (current-buffer))
(kill-buffer old-buf)))))
(call-process "jad" nil nil nil "-o" "-d" (file-name-directory new-f-name) f-name)
(find-file new-f-name)
(revert-buffer t t)
(kill-whole-line 3)
(setq buffer-read-only 't)
(local-set-key [(q)] done)))
(define-derived-mode javad-mode java-mode "Java dissasembled"
"Major mode for Javad")
(provide 'javad)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.