Add files via upload
Made little endian for hex as default for fuzzPatternSearch
This commit is contained in:
Binary file not shown.
@@ -5,6 +5,7 @@ import (
|
|||||||
"gopkg.in/alecthomas/kingpin.v2"
|
"gopkg.in/alecthomas/kingpin.v2"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"strings"
|
"strings"
|
||||||
|
"bytes"
|
||||||
"os"
|
"os"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -32,8 +33,10 @@ func main() {
|
|||||||
|
|
||||||
if (*patternPointer)[:2] == "0x" {
|
if (*patternPointer)[:2] == "0x" {
|
||||||
fmt.Println("Hex detected")
|
fmt.Println("Hex detected")
|
||||||
|
fmt.Println("Assumed litle endian")
|
||||||
fullBytes, _ := hex.DecodeString((*patternPointer)[2:])
|
fullBytes, _ := hex.DecodeString((*patternPointer)[2:])
|
||||||
fullPattern = string(fullBytes)
|
fullPattern = string(fullBytes)
|
||||||
|
fullPattern = strReverse(fullPattern)
|
||||||
} else {
|
} else {
|
||||||
fullPattern = *patternPointer
|
fullPattern = *patternPointer
|
||||||
}
|
}
|
||||||
@@ -101,3 +104,11 @@ func findPos(combiArr []int, startPos int) int {
|
|||||||
|
|
||||||
return answerLength
|
return answerLength
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func strReverse(before string) string {
|
||||||
|
var newBuff bytes.Buffer
|
||||||
|
for i,_ := range before {
|
||||||
|
newBuff.WriteByte(before[len(before)-i-1])
|
||||||
|
}
|
||||||
|
return newBuff.String()
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user