Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Rvn0xsy committed Sep 13, 2021
1 parent d625c31 commit 0ae9be8
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@

# Dependency directories (remove the comment below to include it)
# vendor/
.idea/
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
# gxor
gxor程序根据输入的二进制文件进行异或运算输出

**gxor** 程序根据输入的二进制文件进行异或运算输出

```
[gxor] Xor Binary file
Usage :
Usage : gxor -input-file payload.bin -output-file out.bin -xor-key 10 -appendFlag A
```


gxor -input-file payload.bin -output-file out.bin -xor-key 10
## 使用帮助

```
Usage of ./gxor:
-append-flag string
flag for file head, 1 bytes (default "A")
-input-file string
input bin file
-output-file string
input bin file (default "output.bin")
-xor-key int
input xor key (default 8)
```

- append-flag 主要是为了防止直接异或过的shellcode代码被查杀,因此可以在文件头添加一些字符串


7 changes: 5 additions & 2 deletions gxor.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var (
inputBinaryFile = flag.String("input-file", "", "input bin file")
xorKey = flag.Int("xor-key", 8, "input xor key")
outputBinaryFile = flag.String("output-file", "output.bin", "input bin file")
appendFlag = flag.String("append-flag", "A", "flag for file head, 1 bytes")
appendFlag = flag.String("append-flag", "", "flag for file head, 1 bytes")
)

func usage() {
Expand Down Expand Up @@ -48,7 +48,10 @@ func main() {
fmt.Println(err)
return
}
newFile.Write([]byte(*appendFlag))

if len(*appendFlag) > 0 {
newFile.Write([]byte(*appendFlag))
}
newFile.Write(data)
fmt.Println("[*]Flag Size:", len(*appendFlag))
fmt.Println("[*]Output:", *outputBinaryFile)
Expand Down

0 comments on commit 0ae9be8

Please sign in to comment.