# Packages
No description provided by the author
# README
My Endpoint Helper (MEH)

Meh...this is just a module that provides some helper functions that I have used often when writing custom Prelude Detect tests. Ho hum. Just import it and use the functions.
See sample.go for an example that imports the module and uses some of its functions.
Some of the functions include:
CleanFiles
- delete files written to disk as part of the testCheckQuarantine
- check if a file was quarantine and, based on expectation, stop the test appropriatelyCopyFile
- copy a file from source to destinationDownload
- download a file from a specified URL, optionally check the MD5 hash and whether it was blocked by a proxyEggHunt
- look for a specific sequence of bytes, e.g., within a file, and return the offset(s) where it was foundPatch
- use egghunt to find a sequence of bytes, then replace it wherever foundRun
- executes a command, but unlike Prelude'sEndpoint.Shell
, this will run the command in the background, and returns a process handle (rather than the command output) - NOTE: you should kill the process when it's done, see sample.go for an exampleStartHTTPFileServer
- start an HTTP file server on localhostStartTCPListener
- start a TCP listener on localhost to receive callbacksStartWithCustomTimeout
- is exactly the same as Prelude's Endpoint.Start, but allows you to pass a custom timeout so that you're not stuck with the 30 second timeoutStop
- calls Endpoint.Stop, but locks a mutex first to prevent race conditions where multiple threads call Endpoint.StopMinimizeWindow
- minimize any window in Windows (if the test opens any)RegDelete
- delete a registry key (and all subkeys) in WindowsTaskKillName
- kill a process in Windows by nameTaskKillPID
- kill a process in Windows by PID
Credit
Shout out to mjwhitta for all of the help and contributions (mainly allowing me to steal some of his code).