Documentation
¶
Overview ¶
Package engine is the package that implements the gscript Virtual Machine (VM).
VM Functions implemented:
Library core ¶
Functions in core:
Asset(assetName) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.Asset DeobfuscateString(str) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.DeobfuscateString Halt() - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.Halt MD5(data) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.MD5 ObfuscateString(str) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ObfuscateString RandomInt(min, max) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.RandomInt RandomMixedCaseString(strlen) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.RandomMixedCaseString RandomString(strlen) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.RandomString StripSpaces(str) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.StripSpaces Timestamp() - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.Timestamp XorBytes(aByteArray, bByteArray) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.XorBytes
Library exec ¶
Functions in exec:
ExecuteCommand(baseCmd, cmdArgs) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ExecuteCommand ForkExecuteCommand(baseCmd, cmdArgs) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ForkExecuteCommand
Library file ¶
Functions in file:
AppendFileBytes(path, fileData) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AppendFileBytes AppendFileString(path, addString) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AppendFileString CopyFile(srcPath, dstPath, perms) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.CopyFile CreateDir(path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.CreateDir DeleteFile(path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.DeleteFile FileExists(path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.FileExists ReadFile(path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ReadFile ReplaceFileString(file, match, replacement) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ReplaceFileString WriteFile(path, fileData, perms) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.WriteFile
Library os ¶
Functions in os:
Chmod(path, perms) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.Chmod EnvVars() - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.EnvVars FindProcByName(procName) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.FindProcByName GetEnvVar(vars) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.GetEnvVar GetProcName(pid) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.GetProcName InstallSystemService(path, name, displayName, description) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.InstallSystemService ModTime(path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ModTime ModifyTimestamp(path, accessTime, modifyTime) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.ModifyTimestamp RemoveServiceByName(name) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.RemoveServiceByName RunningProcs() - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.RunningProcs SelfPath() - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.SelfPath Signal(signal, pid) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.Signal StartServiceByName(name) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.StartServiceByName StopServiceByName(name) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.StopServiceByName
Library registry ¶
Functions in registry:
AddRegKeyBinary(registryString, path, name, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AddRegKeyBinary AddRegKeyDWORD(registryString, path, name, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AddRegKeyDWORD AddRegKeyExpandedString(registryString, path, name, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AddRegKeyExpandedString AddRegKeyQWORD(registryString, path, name, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AddRegKeyQWORD AddRegKeyString(registryString, path, name, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AddRegKeyString AddRegKeyStrings(registryString, path, name, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.AddRegKeyStrings DelRegKey(registryString, path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.DelRegKey DelRegKeyValue(registryString, path, value) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.DelRegKeyValue QueryRegKey(registryString, path) - https://godoc.org/github.com/gen0cide/gscript/engine/#Engine.QueryRegKey
Index ¶
- Variables
- func InjectIntoProc(shellcode string, proccessID int64) error
- type Engine
- func (e *Engine) AddImport(name string, data func() []byte)
- func (e *Engine) AddRegKeyBinary(registryString string, path string, name string, value []byte) error
- func (e *Engine) AddRegKeyDWORD(registryString string, path string, name string, value uint32) error
- func (e *Engine) AddRegKeyExpandedString(registryString string, path string, name string, value string) error
- func (e *Engine) AddRegKeyQWORD(registryString string, path string, name string, value uint64) error
- func (e *Engine) AddRegKeyString(registryString string, path string, name string, value string) error
- func (e *Engine) AddRegKeyStrings(registryString string, path string, name string, value []string) error
- func (e *Engine) AppendFileBytes(path string, fileData []byte) error
- func (e *Engine) AppendFileString(path, addString string) error
- func (e *Engine) Asset(filename string) ([]byte, error)
- func (e *Engine) Chmod(path string, perms int64) error
- func (e *Engine) CopyFile(srcPath, destPath string, perms int64) error
- func (e *Engine) CreateDir(path string) error
- func (e *Engine) CreateVM()
- func (e *Engine) DelRegKey(registryString string, path string) error
- func (e *Engine) DelRegKeyValue(registryString string, path string, valueName string) error
- func (e *Engine) DeleteFile(path string) error
- func (e *Engine) DeobfuscateString(Data string) string
- func (e *Engine) EnvVars() map[string]string
- func (e *Engine) ExecuteCommand(c string, args []string) VMExecResponse
- func (e *Engine) ExecutePlan() error
- func (e *Engine) FileExists(path string) (bool, error)
- func (e *Engine) FindProcByName(procName string) (int, error)
- func (e *Engine) ForkExecuteCommand(c string, args []string) (int, error)
- func (e *Engine) GetEnvVar(eVar string) string
- func (e *Engine) GetProcName(pid int) (string, error)
- func (e *Engine) Halt() bool
- func (e *Engine) InstallSystemService(path, name, displayName, description string) error
- func (e *Engine) LoadScript(filename string, source []byte) error
- func (e *Engine) MD5(data []byte) string
- func (e *Engine) ModTime(path string) (int64, error)
- func (e *Engine) ModifyTimestamp(path string, accessTime, modifyTime int64) error
- func (e *Engine) ObfuscateString(Data string) string
- func (e *Engine) QueryRegKey(registryString string, path string) (RegistryRetValue, error)
- func (e *Engine) RandomInt(min, max int64) int
- func (e *Engine) RandomMixedCaseString(n int64) string
- func (e *Engine) RandomString(strlen int64) string
- func (e *Engine) ReadFile(path string) ([]byte, error)
- func (e *Engine) RemoveServiceByName(name string) error
- func (e *Engine) ReplaceFileString(file, match, replacement string) (int, error)
- func (e *Engine) RunWithTimeout(command string) (otto.Value, error)
- func (e *Engine) RunningProcs() ([]int, error)
- func (e *Engine) SelfPath() (string, error)
- func (e *Engine) SetLogger(logger *logrus.Logger)
- func (e *Engine) SetName(name string)
- func (e *Engine) SetTimeout(timeout int)
- func (e *Engine) Signal(proc int, sig int) error
- func (e *Engine) StartServiceByName(name string) error
- func (e *Engine) StopServiceByName(name string) error
- func (e *Engine) StripSpaces(str string) string
- func (e *Engine) Timestamp() int64
- func (e *Engine) ValueToByteSlice(v otto.Value) []byte
- func (e *Engine) WriteFile(path string, fileData []byte, perms int64) (int, error)
- func (e *Engine) XorBytes(a []byte, b []byte) []byte
- type RegistryRetValue
- type VMExecResponse
- type VMResponse
Constants ¶
This section is empty.
Variables ¶
var (
Debugger = true
)
Functions ¶
func InjectIntoProc ¶
Types ¶
type Engine ¶
type Engine struct { VM *otto.Otto Logger *logrus.Logger Imports map[string]func() []byte Name string DebuggerEnabled bool Timeout int Halted bool Paused bool }
func (*Engine) AddRegKeyBinary ¶ added in v0.1.0
func (e *Engine) AddRegKeyBinary(registryString string, path string, name string, value []byte) error
AddRegKeyBinary - Add a binary registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
AddRegKeyBinary(registryString, path, name, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- name (string)
- value ([]byte)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AddRegKeyBinary(registryString, path, name, value); // obj.runtimeError
func (*Engine) AddRegKeyDWORD ¶ added in v0.1.0
func (e *Engine) AddRegKeyDWORD(registryString string, path string, name string, value uint32) error
AddRegKeyDWORD - Add a DWORD registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
AddRegKeyDWORD(registryString, path, name, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- name (string)
- value (uint32)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AddRegKeyDWORD(registryString, path, name, value); // obj.runtimeError
func (*Engine) AddRegKeyExpandedString ¶ added in v0.1.0
func (e *Engine) AddRegKeyExpandedString(registryString string, path string, name string, value string) error
AddRegKeyExpandedString - Add an expanded string registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
AddRegKeyExpandedString(registryString, path, name, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- name (string)
- value (string)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AddRegKeyExpandedString(registryString, path, name, value); // obj.runtimeError
func (*Engine) AddRegKeyQWORD ¶ added in v0.1.0
func (e *Engine) AddRegKeyQWORD(registryString string, path string, name string, value uint64) error
AddRegKeyQWORD - Add a QWORD registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
AddRegKeyQWORD(registryString, path, name, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- name (string)
- value (uint64)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AddRegKeyQWORD(registryString, path, name, value); // obj.runtimeError
func (*Engine) AddRegKeyString ¶ added in v0.1.0
func (e *Engine) AddRegKeyString(registryString string, path string, name string, value string) error
AddRegKeyString - Add a string registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
AddRegKeyString(registryString, path, name, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- name (string)
- value (string)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AddRegKeyString(registryString, path, name, value); // obj.runtimeError
func (*Engine) AddRegKeyStrings ¶ added in v0.1.0
func (e *Engine) AddRegKeyStrings(registryString string, path string, name string, value []string) error
AddRegKeyStrings - Add a registry key of type string(s)
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
AddRegKeyStrings(registryString, path, name, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- name (string)
- value ([]string)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AddRegKeyStrings(registryString, path, name, value); // obj.runtimeError
func (*Engine) AppendFileBytes ¶ added in v0.1.0
AppendFileBytes - Addes a given byte array to the end of a file
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
AppendFileBytes(path, fileData)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
- fileData ([]byte)
Returns ¶
Here is a list of fields in the return object:
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AppendFileBytes(path, fileData); // obj.fileError
func (*Engine) AppendFileString ¶ added in v0.1.0
AppendFileString - Addes a given string to the end of a file
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
AppendFileString(path, addString)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
- addString (string)
Returns ¶
Here is a list of fields in the return object:
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = AppendFileString(path, addString); // obj.fileError
func (*Engine) Asset ¶ added in v0.1.0
Asset - Retrieves a packed asset from the VM embedded file store.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
Asset(assetName)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- assetName (string)
Returns ¶
Here is a list of fields in the return object:
- obj.fileData ([]byte)
- obj.err (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = Asset(assetName); // obj.fileData // obj.err
func (*Engine) Chmod ¶ added in v0.1.0
Chmod - Change the permissions on a path.
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
Chmod(path, perms)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
- perms (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.osError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = Chmod(path, perms); // obj.osError
func (*Engine) CopyFile ¶ added in v0.1.0
CopyFile - Reads the contents of one file and copies it to another with the given permissions.
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
CopyFile(srcPath, dstPath, perms)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- srcPath (string)
- dstPath (string)
- perms (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = CopyFile(srcPath, dstPath, perms); // obj.fileError
func (*Engine) CreateDir ¶ added in v0.1.0
CreateDir - Creates a directory at a given path or return an error
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
CreateDir(path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = CreateDir(path); // obj.fileError
func (*Engine) DelRegKey ¶ added in v0.1.0
DelRegKey - Delete a registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
DelRegKey(registryString, path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = DelRegKey(registryString, path); // obj.runtimeError
func (*Engine) DelRegKeyValue ¶ added in v0.1.0
DelRegKeyValue - Delete a registry key value
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
DelRegKeyValue(registryString, path, value)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
- value (string)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = DelRegKeyValue(registryString, path, value); // obj.runtimeError
func (*Engine) DeleteFile ¶ added in v0.1.0
DeleteFile - Deletes a file at a given path or returns an error
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
DeleteFile(path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = DeleteFile(path); // obj.fileError
func (*Engine) DeobfuscateString ¶ added in v0.1.0
DeobfuscateString - Basic string deobfuscator function.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
DeobfuscateString(str)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- str (string)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = DeobfuscateString(str); // obj.value
func (*Engine) EnvVars ¶ added in v0.1.0
EnvVars - Returns a map of enviornment variable names to their corrisponding values.
Package ¶
os
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
EnvVars()
Arguments ¶
Here is a list of the arguments for the Javascript function:
Returns ¶
Here is a list of fields in the return object:
- obj.vars (map[string]string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = EnvVars(); // obj.vars
func (*Engine) ExecuteCommand ¶ added in v0.1.0
func (e *Engine) ExecuteCommand(c string, args []string) VMExecResponse
ExecuteCommand - Executes system commands.
Package ¶
exec
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
ExecuteCommand(baseCmd, cmdArgs)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- baseCmd (string)
- cmdArgs ([]string)
Returns ¶
Here is a list of fields in the return object:
- obj.retObject (VMExecResponse)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ExecuteCommand(baseCmd, cmdArgs); // obj.retObject
func (*Engine) ExecutePlan ¶
func (*Engine) FileExists ¶ added in v0.1.0
FileExists - Checks if a file exists and returns a bool
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
FileExists(path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.fileExists (bool)
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = FileExists(path); // obj.fileExists // obj.fileError
func (*Engine) FindProcByName ¶ added in v0.1.0
FindProcByName - Returns the Pid of a given proccess, if the proccess can not be found, an error is returned
Package ¶
os
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
FindProcByName(procName)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- procName (string)
Returns ¶
Here is a list of fields in the return object:
- obj.pid (int)
- obj.procError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = FindProcByName(procName); // obj.pid // obj.procError
func (*Engine) ForkExecuteCommand ¶ added in v0.1.0
ForkExecuteCommand - Executes system commands via a forked call.
Package ¶
exec
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
ForkExecuteCommand(baseCmd, cmdArgs)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- baseCmd (string)
- cmdArgs ([]string)
Returns ¶
Here is a list of fields in the return object:
- obj.pid (int)
- obj.execError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ForkExecuteCommand(baseCmd, cmdArgs); // obj.pid // obj.execError
func (*Engine) GetEnvVar ¶ added in v0.1.0
GetEnvVar - Returns the value of a given enviornment variable
Package ¶
os
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
GetEnvVar(vars)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- vars (string)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = GetEnvVar(vars); // obj.value
func (*Engine) GetProcName ¶ added in v0.1.0
GetProcName - Returns the name of a target proccess
Package ¶
os
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
GetProcName(pid)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- pid (int)
Returns ¶
Here is a list of fields in the return object:
- obj.procName (string)
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = GetProcName(pid); // obj.procName // obj.runtimeError
func (*Engine) Halt ¶ added in v0.1.0
Halt - Stop the current VM from continuing execution.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
Halt()
Arguments ¶
Here is a list of the arguments for the Javascript function:
Returns ¶
Here is a list of fields in the return object:
- obj.value (bool)
Example ¶
Here is an example of how to use this function in gscript:
var obj = Halt(); // obj.value
func (*Engine) InstallSystemService ¶ added in v0.0.10
InstallSystemService - Installs a target binary as a system service
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
InstallSystemService(path, name, displayName, description)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
- name (string)
- displayName (string)
- description (string)
Returns ¶
Here is a list of fields in the return object:
- obj.installError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = InstallSystemService(path, name, displayName, description); // obj.installError
func (*Engine) MD5 ¶ added in v0.1.0
MD5 - Perform an MD5() hash on data.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
MD5(data)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- data ([]byte)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = MD5(data); // obj.value
func (*Engine) ModTime ¶ added in v0.1.0
ModTime - Retrieves the last modified time of a path.
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
ModTime(path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.modTime (int64)
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ModTime(path); // obj.modTime // obj.fileError
func (*Engine) ModifyTimestamp ¶ added in v0.1.0
ModifyTimestamp - Change the access and modified time of a file.
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
ModifyTimestamp(path, accessTime, modifyTime)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
- accessTime (int64)
- modifyTime (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ModifyTimestamp(path, accessTime, modifyTime); // obj.fileError
func (*Engine) ObfuscateString ¶ added in v0.1.0
ObfuscateString - Basic string obfuscator function.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
ObfuscateString(str)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- str (string)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ObfuscateString(str); // obj.value
func (*Engine) QueryRegKey ¶ added in v0.1.0
func (e *Engine) QueryRegKey(registryString string, path string) (RegistryRetValue, error)
QueryRegKey - Retrive a registry key
Package ¶
registry
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
QueryRegKey(registryString, path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- registryString (string)
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.keyObj (RegistryRetValue)
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = QueryRegKey(registryString, path); // obj.keyObj // obj.runtimeError
func (*Engine) RandomInt ¶ added in v0.1.0
RandomInt - Generates a random number between min and max.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
RandomInt(min, max)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- min (int64)
- max (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.value (int)
Example ¶
Here is an example of how to use this function in gscript:
var obj = RandomInt(min, max); // obj.value
func (*Engine) RandomMixedCaseString ¶ added in v0.1.0
RandomMixedCaseString - Generates a random mixed case alpha numeric string of a specified length.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
RandomMixedCaseString(strlen)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- strlen (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = RandomMixedCaseString(strlen); // obj.value
func (*Engine) RandomString ¶ added in v0.1.0
RandomString - Generates a random alpha numeric string of a specified length.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
RandomString(strlen)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- strlen (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = RandomString(strlen); // obj.value
func (*Engine) ReadFile ¶ added in v0.1.0
ReadFile - Reads a file path and returns a byte array
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
ReadFile(path)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
Returns ¶
Here is a list of fields in the return object:
- obj.fileBytes ([]byte)
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ReadFile(path); // obj.fileBytes // obj.fileError
func (*Engine) RemoveServiceByName ¶ added in v0.0.10
RemoveServiceByName - Uninstalls a system service
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
RemoveServiceByName(name)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- name (string)
Returns ¶
Here is a list of fields in the return object:
- obj.removalError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = RemoveServiceByName(name); // obj.removalError
func (*Engine) ReplaceFileString ¶ added in v0.1.0
ReplaceFileString - Searches a file for a string and replaces each instance found of that string. Returns the amount of strings replaced
Package ¶
file
Author ¶
- ahhh (https://github.com/ahhh)
Javascript ¶
Here is the Javascript method signature:
ReplaceFileString(file, match, replacement)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- file (string)
- match (string)
- replacement (string)
Returns ¶
Here is a list of fields in the return object:
- obj.stringsReplaced (int)
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = ReplaceFileString(file, match, replacement); // obj.stringsReplaced // obj.fileError
func (*Engine) RunWithTimeout ¶ added in v0.0.10
func (*Engine) RunningProcs ¶ added in v0.1.0
RunningProcs - Returns an array of int's representing active PIDs currently running
Package ¶
os
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
RunningProcs()
Arguments ¶
Here is a list of the arguments for the Javascript function:
Returns ¶
Here is a list of fields in the return object:
- obj.pids ([]int)
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = RunningProcs(); // obj.pids // obj.runtimeError
func (*Engine) SelfPath ¶ added in v0.1.0
SelfPath - Retrieves the path to the currently running executable.
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
SelfPath()
Arguments ¶
Here is a list of the arguments for the Javascript function:
Returns ¶
Here is a list of fields in the return object:
- obj.path (string)
- obj.osError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = SelfPath(); // obj.path // obj.osError
func (*Engine) SetTimeout ¶ added in v0.0.10
func (*Engine) Signal ¶ added in v0.1.0
Signal - Sends a signal to a target proccess
Package ¶
os
Author ¶
- Vyrus (https://github.com/vyrus001)
Javascript ¶
Here is the Javascript method signature:
Signal(signal, pid)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- signal (int)
- pid (int)
Returns ¶
Here is a list of fields in the return object:
- obj.runtimeError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = Signal(signal, pid); // obj.runtimeError
func (*Engine) StartServiceByName ¶ added in v0.0.10
StartServiceByName - Starts a system service
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
StartServiceByName(name)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- name (string)
Returns ¶
Here is a list of fields in the return object:
- obj.startError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = StartServiceByName(name); // obj.startError
func (*Engine) StopServiceByName ¶ added in v0.0.10
StopServiceByName - Stops a system service
Package ¶
os
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
StopServiceByName(name)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- name (string)
Returns ¶
Here is a list of fields in the return object:
- obj.installError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = StopServiceByName(name); // obj.installError
func (*Engine) StripSpaces ¶ added in v0.1.0
StripSpaces - Strip any unicode characters out of a string.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
StripSpaces(str)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- str (string)
Returns ¶
Here is a list of fields in the return object:
- obj.value (string)
Example ¶
Here is an example of how to use this function in gscript:
var obj = StripSpaces(str); // obj.value
func (*Engine) Timestamp ¶ added in v0.1.0
Timestamp - Get the system's current timestamp in epoch format.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
Timestamp()
Arguments ¶
Here is a list of the arguments for the Javascript function:
Returns ¶
Here is a list of fields in the return object:
- obj.value (int64)
Example ¶
Here is an example of how to use this function in gscript:
var obj = Timestamp(); // obj.value
func (*Engine) WriteFile ¶ added in v0.1.0
WriteFile - Writes data from a byte array to a file with the given permissions.
Package ¶
file
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
WriteFile(path, fileData, perms)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- path (string)
- fileData ([]byte)
- perms (int64)
Returns ¶
Here is a list of fields in the return object:
- obj.bytesWritten (int)
- obj.fileError (error)
Example ¶
Here is an example of how to use this function in gscript:
var obj = WriteFile(path, fileData, perms); // obj.bytesWritten // obj.fileError
func (*Engine) XorBytes ¶ added in v0.1.0
XorBytes - XOR two byte arrays together.
Package ¶
core
Author ¶
- gen0cide (https://github.com/gen0cide)
Javascript ¶
Here is the Javascript method signature:
XorBytes(aByteArray, bByteArray)
Arguments ¶
Here is a list of the arguments for the Javascript function:
- aByteArray ([]byte)
- bByteArray ([]byte)
Returns ¶
Here is a list of fields in the return object:
- obj.value ([]byte)
Example ¶
Here is an example of how to use this function in gscript:
var obj = XorBytes(aByteArray, bByteArray); // obj.value
type RegistryRetValue ¶ added in v0.1.0
type VMExecResponse ¶
type VMResponse ¶ added in v0.1.0
type VMResponse map[string]interface{}