Documentation ¶
Index ¶
- func CaveSliceParser(filePath string, caveSlice []caveStruct)
- func CreateHiddenData(patternArrayToMatch []byte, message []byte) []byte
- func DecodeMessage(fileLocation string, maximumCodeCaveSize int, byteLengthToHash int, ...)
- func EncodeMessage(inputFile string, outputFile string, inputMessage string, byteLengthToHash int, ...)
- func ExtractBytesFromFile(filePath string, bytesToRead int, startByte int) []byte
- func FindCaves(filePath string, minCaveSize int) []caveStruct
- func FindMatchingPattern(filePath string, matchingBytePattern []byte, readFromByte int) (int, int, int)
- func GunzipData(inputData []byte) (uncompressedData []byte, err error)
- func GzipData(inputData []byte) (compressedData []byte, err error)
- func InsertCode(filePath string, hiddenMessage []byte, startByte int) []byte
- func Md5HashBytesReturnXBytes(inputByteArray []byte, returnBytes int) []byte
- func Md5HashBytesToString(inputByteArray []byte) string
- func ReadBytesFromFile(filePath string, byteLengthToHash int) []byte
- func ReverseBytes(inputArray []byte) []byte
- func WriteFile(filePath string, fileArray []byte)
- type MessageStruct
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CaveSliceParser ¶ added in v0.1.1
func CaveSliceParser(filePath string, caveSlice []caveStruct)
Print and return all found codecaves as CSV file in format: filename,size,start,end
func CreateHiddenData ¶
func DecodeMessage ¶
func EncodeMessage ¶
func ExtractBytesFromFile ¶
Read x amount of bytes starting from byte y and return bytearray
func FindMatchingPattern ¶
func FindMatchingPattern(filePath string, matchingBytePattern []byte, readFromByte int) (int, int, int)
findMatchingPattern scans a file for a matching pattern
It returns bytes where matching pattern starts and ends Once pattern start and end is found it stops.
To find a second matching pattern the function is run again but starts reading at the byte number of the end of the last matching pattern. Returns the index of where the pattern starts and ends and how many bytes were read
func GunzipData ¶
Unzip an incoming byte array
func InsertCode ¶
Open file, load data to an array, at cave.start insert data
func Md5HashBytesToString ¶
func ReadBytesFromFile ¶
Read defined amount (length) of bytes from file
func ReverseBytes ¶
Reads a bytearray and returns a reversed version of it
Types ¶
type MessageStruct ¶
type MessageStruct struct {
// contains filtered or unexported fields
}
func FindAllMatchingPatterns ¶
func FindAllMatchingPatterns(filePath string, matchingBytePattern []byte, maxCaveSize int) MessageStruct
findAllMatchingPatterns looks for the matching byte pattern in the file It scans for the first instance of the matching pattern, notes where it starts and ends Then continues scanning until it finds the second matching pattern and notes where that starts and ends
It then returns the bytearray inbetween the matching patterns.