-
-
Save i-blis/1986668 to your computer and use it in GitHub Desktop.
Inject F-Script into any app on 10.7 Lion
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
#!/usr/bin/env ruby | |
FSCRIPT_PATH = "/Library/Frameworks/FScript.framework" | |
if ARGV.empty? | |
puts "Usage: #{$0} process_name" | |
exit | |
end | |
GDB = IO.popen("gdb", 'w') | |
def gdb(cmd) | |
GDB.puts cmd | |
GDB.flush | |
end | |
gdb "attach #{ARGV[0]}" | |
gdb "p (char)[[NSBundle bundleWithPath:@\"#{FSCRIPT_PATH}\"] load]" | |
gdb "p (void)[FScriptMenuItem insertInMainMenu]" | |
gdb "detach" | |
gdb "quit" | |
GDB.close |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment