From 32f99a6fa78bcf1582de5b19303ece7cfdd7761b Mon Sep 17 00:00:00 2001
From: smiley <93072266+dmur1@users.noreply.github.com>
Date: Wed, 9 Apr 2025 20:04:42 +0100
Subject: [PATCH] remove the syscall command
---
README.md | 23 --------------
commands/syscall.go | 74 ---------------------------------------------
2 files changed, 97 deletions(-)
delete mode 100644 commands/syscall.go
diff --git a/README.md b/README.md
index 1d53324..3bb636e 100644
--- a/README.md
+++ b/README.md
@@ -449,29 +449,6 @@ displays the status for the current task with ret
---
-### 📞 syscall
-
-```
-$ ret syscall [(x86/32)/(x64/64)] [regex]
-```
-
-check syscalls by regex with ret
-
- uses:
- x86: /usr/include/x86_64-linux-gnu/asm/unistd_32.h
- x64: /usr/include/x86_64-linux-gnu/asm/unistd_64.h
-
- examples:
- syscall x64 " 0"
- syscall x64 write
- syscall 32 read
- syscall x86 10[0-9]
-
-
-🔗 https://github.com/rerrorctf/ret/blob/main/commands/syscall.go
-
----
-
### 📝 writeup
```
diff --git a/commands/syscall.go b/commands/syscall.go
deleted file mode 100644
index 7d22871..0000000
--- a/commands/syscall.go
+++ /dev/null
@@ -1,74 +0,0 @@
-package commands
-
-import (
- "log"
- "ret/theme"
- "ret/util"
-)
-
-func init() {
- Commands = append(Commands, Command{
- Name: "syscall",
- Emoji: "📞",
- Func: Syscall,
- Help: SyscallHelp,
- Arguments: []Argument{
- {
- Name: "(x86/32)/(x64/64)",
- Optional: true,
- List: false,
- },
- {
- Name: "regex",
- Optional: true,
- List: false,
- },
- }})
-}
-
-func SyscallHelp() string {
- return "check syscalls by regex with ret\n" +
- theme.ColorBlue + "\n uses" + theme.ColorGray + ": \n" +
- theme.ColorGreen + " x86" + theme.ColorGray + ": /usr/include/x86_64-linux-gnu/asm/unistd_32.h" + theme.ColorReset + "\n" +
- theme.ColorGreen + " x64" + theme.ColorGray + ": /usr/include/x86_64-linux-gnu/asm/unistd_64.h" + theme.ColorReset + "\n" +
- theme.ColorBlue + "\n examples" + theme.ColorGray + ": \n" +
- theme.ColorPurple + " syscall x64 \" 0\"" + theme.ColorReset + "\n" +
- theme.ColorPurple + " syscall x64 write" + theme.ColorReset + "\n" +
- theme.ColorPurple + " syscall 32 read" + theme.ColorReset + "\n" +
- theme.ColorPurple + " syscall x86 10[0-9]" + theme.ColorReset + "\n\n"
-}
-
-func Syscall(args []string) {
- arch := "x64"
- pattern := "."
-
- if len(args) > 1 {
- arch = args[0]
- pattern = args[1]
- } else if len(args) > 0 {
- arch = args[0]
- }
-
- switch arch {
- case "x86":
- {
- util.Grep("/usr/include/x86_64-linux-gnu/asm/unistd_32.h", pattern)
- }
- case "32":
- {
- util.Grep("/usr/include/x86_64-linux-gnu/asm/unistd_32.h", pattern)
- }
- case "x64":
- {
- util.Grep("/usr/include/x86_64-linux-gnu/asm/unistd_64.h", pattern)
- }
- case "64":
- {
- util.Grep("/usr/include/x86_64-linux-gnu/asm/unistd_64.h", pattern)
- }
- default:
- {
- log.Fatalf("💥 "+theme.ColorRed+"error"+theme.ColorReset+": invalid arch btw \"%v\"\n", args[0])
- }
- }
-}