Before we move on to calling DLLs, let's first see what the essential steps to follow are in order to get the best out of Railgun:
- Identify the function(s) you wish to call.
- Locate the function on https://msdn.microsoft.com/en-us/library/aa383749(v=vs.85).aspx.
- Check the library (DLL) in which the function is located (for example, kernel32.dll). The selected library function can be called client.railgun.dll_name. function_name(arg1, arg2, ...).
- The Windows MSDN library can be used to identify useful DLLs and functions to call on the target machine.
- Let's use the client.sys.config.sysinfo API call to gather information on the target:
>> client.sys.config.sysinfo=> {"Computer"=>"VAGRANT-2008R2", "OS"=>"Windows 2008 R2 (Build ...