metasploit-framework
https://github.com/rapid7/metasploit-framework
Ruby
Metasploit Framework
Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Library#add_function
Define a function for this library.
Every function argument is described by a tuple (type,name,direction)
Example:
add_function("MessageBoxW", # name
"DWORD", # return value
[ # params
["DWORD","hWnd","in"],
["PWCHAR","lpText","in"],
["PWCHAR","lpCaption","in"],
["DWORD","uType","in"],
])
Use +remote_name+ when the actual library name is different from the
ruby variable. You might need to do this for example when the actual
func name is myFunc@4 or when you want to create an alternative version
of an existing function.
When the new function is called it will return a list containing the
return value and all inout params. See #call_function.Edit
git clone [email protected]:rapid7/metasploit-framework.git
cd metasploit-framework
open lib/rex/post/meterpreter/extensions/stdapi/railgun/library.rb
Contribute
# Make a new branchgit checkout -b -your-name--update-docs-Rex--Post--Meterpreter--Extensions--Stdapi--Railgun--Library-add_function-for-pr
# Commit to gitgit add lib/rex/post/meterpreter/extensions/stdapi/railgun/library.rbgit commit -m "better docs for Rex::Post::Meterpreter::Extensions::Stdapi::Railgun::Library#add_function"
# Open pull requestgem install hub # on a mac you can `brew install hub`
hub fork
git push <your name> -your-name--update-docs-Rex--Post--Meterpreter--Extensions--Stdapi--Railgun--Library-add_function-for-pr
hub pull-request
# Celebrate!