From d162004e27143548a2fc82f91b244c1ac8e84246 Mon Sep 17 00:00:00 2001 From: Grazfather Date: Tue, 18 Jan 2022 12:20:38 -0500 Subject: [PATCH] Use https URLs where we can (#793) --- docs/commands.md | 4 ++-- docs/commands/assemble.md | 2 +- docs/commands/checksec.md | 2 +- docs/commands/heap-analysis-helper.md | 2 +- docs/commands/heap.md | 2 +- docs/commands/stub.md | 4 ++-- docs/commands/syscall-args.md | 6 ++++-- docs/commands/trace-run.md | 6 +++--- docs/commands/vmmap.md | 2 +- docs/commands/xfiles.md | 2 +- docs/faq.md | 28 +++++++++++++++------------ gef.py | 28 +++++++++++++-------------- 12 files changed, 47 insertions(+), 41 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index 24d865b0f..df23c2918 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -14,7 +14,7 @@ improve it. |`aslr` | View/modify GDB ASLR behavior.| |`assemble` | Inline code assemble. Architecture can be set in GEF runtime config (default is x86). (alias: `asm`) | |`capstone-disassemble` | Use capstone disassembly framework to disassemble code. (alias: `cs-dis`) | -|`checksec` | Checksec.sh(http://www.trapkit.de/tools/checksec.html) port. | +|`checksec` | Checksec.sh(https://www.trapkit.de/tools/checksec.html) port. | |`context` | Display execution context. (alias: `ctx`)| |`dereference` | Dereference recursively an address and display information (alias: telescope, dps)| |`edit-flags` | Edit flags in a human friendly way (alias: `flags`)| @@ -43,7 +43,7 @@ improve it. |`process-status` | Extends the info given by GDB `info proc`, by giving an exhaustive description of the process status.| |`registers` | Display full details on one, many or all registers value from current architecture.| |`reset-cache` | Reset cache of all stored data.| -|`ropper` | Ropper (http://scoding.de/ropper) plugin for GEF| +|`ropper` | Ropper (https://scoding.de/ropper) plugin for GEF| |`scan` | Search for addresses that are located in a memory mapping (haystack) that belonging to another (needle). (alias: `lookup`)| |`search-pattern` | SearchPatternCommand: search a pattern in memory. (alias: `grep`)| |`set-permission` | Change a page permission. By default, it will change it to RWX. (alias: `mprotect`)| diff --git a/docs/commands/assemble.md b/docs/commands/assemble.md index b9e7f1d62..f52de86a9 100644 --- a/docs/commands/assemble.md +++ b/docs/commands/assemble.md @@ -1,6 +1,6 @@ ## Command assemble ## -If you have installed [`keystone`](http://www.keystone-engine.org/), then `gef` +If you have installed [`keystone`](https://www.keystone-engine.org/), then `gef` will provide a convenient command to assemble native instructions directly to opcodes of the architecture you are currently debugging. diff --git a/docs/commands/checksec.md b/docs/commands/checksec.md index f9409ac82..37008c89b 100644 --- a/docs/commands/checksec.md +++ b/docs/commands/checksec.md @@ -1,7 +1,7 @@ ## Command checksec ## The `checksec` command is inspired from -[`checksec.sh`](http://www.trapkit.de/tools/checksec.html). It provides a +[`checksec.sh`](https://www.trapkit.de/tools/checksec.html). It provides a convenient way to determine which security protections are enabled in a binary. You can use the command on the currently debugged process: diff --git a/docs/commands/heap-analysis-helper.md b/docs/commands/heap-analysis-helper.md index 19790b014..a5bf7a7cf 100644 --- a/docs/commands/heap-analysis-helper.md +++ b/docs/commands/heap-analysis-helper.md @@ -72,4 +72,4 @@ subcommand: gef➤ heap-analysis-helper show ``` -![heap-analysis-helper-show](http://i.imgur.com/0I4jBWJ.png) +![heap-analysis-helper-show](https://i.imgur.com/0I4jBWJ.png) diff --git a/docs/commands/heap.md b/docs/commands/heap.md index 70d7a0a89..a773e9c05 100644 --- a/docs/commands/heap.md +++ b/docs/commands/heap.md @@ -2,7 +2,7 @@ The `heap` command provides information on the heap chunk specified as argument. For the moment, it only supports GlibC heap format (see -[this link](http://code.woboq.org/userspace/glibc/malloc/malloc.c.html#malloc_chunk) +[this link](https://code.woboq.org/userspace/glibc/malloc/malloc.c.html#malloc_chunk) for `malloc` structure information). Syntax to the subcommands is straight forward: ``` diff --git a/docs/commands/stub.md b/docs/commands/stub.md index fba2bdd5c..92eb1ea6a 100644 --- a/docs/commands/stub.md +++ b/docs/commands/stub.md @@ -26,8 +26,8 @@ Patching `fork()` calls: * Without stub: -![fork execution](http://i.imgur.com/TjnTDot.png) +![fork execution](https://i.imgur.com/TjnTDot.png) * With stub: -![stubbed fork](http://i.imgur.com/CllTnRH.png) +![stubbed fork](https://i.imgur.com/CllTnRH.png) diff --git a/docs/commands/syscall-args.md b/docs/commands/syscall-args.md index 336a529d9..9e670a2ce 100644 --- a/docs/commands/syscall-args.md +++ b/docs/commands/syscall-args.md @@ -1,7 +1,9 @@ ## Command syscall-args ## -Often it is troublesome to have to refer to syscall tables every time we encounter a system call instruction. -`gef` can be used to determine the system call being invoked and the arguments being passed to it. Requires [gef-extras](http://github.com/hugsy/gef-extras). +Often it is troublesome to have to refer to syscall tables every time we +encounter a system call instruction. `gef` can be used to determine the system +call being invoked and the arguments being passed to it. Requires +[gef-extras](https://github.com/hugsy/gef-extras). To use it, simply run ``` diff --git a/docs/commands/trace-run.md b/docs/commands/trace-run.md index e07706789..80aff8bb7 100644 --- a/docs/commands/trace-run.md +++ b/docs/commands/trace-run.md @@ -14,8 +14,8 @@ gef> trace-run ![trace-run-1](https://i.imgur.com/yaOGste.png) -By using the script `ida_color_gdb_trace.py` on the text file generated, it will -color the path taken: +By using the script `ida_color_gdb_trace.py` on the text file generated, it +will color the path taken: -![trace-run-2](http://i.imgur.com/oAGoSMQ.png) +![trace-run-2](https://i.imgur.com/oAGoSMQ.png) diff --git a/docs/commands/vmmap.md b/docs/commands/vmmap.md index 463d620cf..caa972f6c 100644 --- a/docs/commands/vmmap.md +++ b/docs/commands/vmmap.md @@ -13,6 +13,6 @@ sections set as Read/Write/Execute. `vmmap` accepts one argument, either a pattern to match again mapping names, or an address to determine which section it belongs to. -![vmmap-grep](http://i.imgur.com/ZFF4QVf.png) +![vmmap-grep](https://i.imgur.com/ZFF4QVf.png) ![vmmap-address](https://i.imgur.com/hfcs1jH.png) diff --git a/docs/commands/xfiles.md b/docs/commands/xfiles.md index 10367624d..ab5b92fa3 100644 --- a/docs/commands/xfiles.md +++ b/docs/commands/xfiles.md @@ -4,4 +4,4 @@ files` allowing you to filter by pattern given in argument. For example, if you only want to show the code sections (i.e. `.text`): -![xfiles-example](http://i.imgur.com/lelnJ5B.png) +![xfiles-example](https://i.imgur.com/lelnJ5B.png) diff --git a/docs/faq.md b/docs/faq.md index 3d1fda222..7477da48c 100644 --- a/docs/faq.md +++ b/docs/faq.md @@ -113,9 +113,14 @@ to run smoothly. ## I want to contribute, where should I head first? ## -I would suggest thoroughly reading this documentation, just having a look to the [CONTRIBUTE](https://github.com/hugsy/gef/blob/master/.github/CONTRIBUTING.md) file of the project to give you pointers. +I would suggest thoroughly reading this documentation, just having a look to +the +[CONTRIBUTE](https://github.com/hugsy/gef/blob/master/.github/CONTRIBUTING.md) +file of the project to give you pointers. -Also a good thing would be to join our [Discord channel](https://discord.gg/HCS8Hg7) to get in touch with the people involved/using it. +Also a good thing would be to join our [Discord +channel](https://discord.gg/HCS8Hg7) to get in touch with the people +involved/using it. ## I think I've found a bug, how can I help fixing it? ## @@ -127,13 +132,13 @@ In most locations, Python exceptions will be properly intercepted. If not, `gef` wraps all commands with a generic exception handler, to disturb as little as possible your debugging session. If it happens, you'll only get to see a message like this: -![gef-exception](http://i.imgur.com/J7dUnXV.png) +![gef-exception](https://i.imgur.com/J7dUnXV.png) By switching to debug mode, `gef` will give much more information: ``` gef➤ gef config gef.debug 1 ``` -![gef-debug](http://i.imgur.com/SGe8oFF.png) +![gef-debug](https://i.imgur.com/SGe8oFF.png) If you think fixing it is in your skills, then send a [Pull Request](https://github.com/hugsy/gef/pulls) with your patched version, @@ -146,14 +151,13 @@ will greatly help for solving the issue. ## I get weird issues/characters using GDB + Python3, what's up? ## -Chances are you are not using UTF-8. Python3 -is [highly relying on UTF-8](http://www.diveintopython3.net/strings.html) to -display correctly characters of any alphabet -and -[also some cool emojis](http://unicode.org/emoji/charts/full-emoji-list.html). When -GDB is compiled with Python3, GEF will assume that your current charset is UTF-8 -(for instance, `en_US.UTF-8`). Use your `$LANG` environment variable to tweak -this setting. +Chances are you are not using UTF-8. Python3 is [highly relying on +UTF-8](https://www.diveintopython3.net/strings.html) to display correctly +characters of any alphabet and [also some cool +emojis](https://unicode.org/emoji/charts/full-emoji-list.html). When GDB is +compiled with Python3, GEF will assume that your current charset is UTF-8 (for +instance, `en_US.UTF-8`). Use your `$LANG` environment variable to tweak this +setting. In addition, some unexpected results were observed when your local is not set to English. If you aren't sure, simply run `gdb` like this: diff --git a/gef.py b/gef.py index 280d9dd7c..14d52153d 100644 --- a/gef.py +++ b/gef.py @@ -727,8 +727,8 @@ class Elf: """Basic ELF parsing. Ref: - http://www.skyfree.org/linux/references/ELF_Format.pdf - - http://refspecs.linuxfoundation.org/elf/elfspec_ppc.pdf - - http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html + - https://refspecs.linuxfoundation.org/elf/elfspec_ppc.pdf + - https://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html """ ELF_32_BITS = 0x01 ELF_64_BITS = 0x02 @@ -2321,7 +2321,7 @@ class ARM(Architecture): "$r7", "$r8", "$r9", "$r10", "$r11", "$r12", "$sp", "$lr", "$pc", "$cpsr",] - # http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0041c/Caccegih.html + # https://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0041c/Caccegih.html nop_insn = b"\x01\x10\xa0\xe1" # mov r1, r1 return_register = "$r0" flag_register = "$cpsr" @@ -2381,7 +2381,7 @@ def is_ret(self, insn) -> Optional[bool]: return def flag_register_to_human(self, val: Optional[int] = None) -> str: - # http://www.botskool.com/user-pages/tutorials/electronics/arm-7-tutorial-part-1 + # https://www.botskool.com/user-pages/tutorials/electronics/arm-7-tutorial-part-1 if val is None: reg = self.flag_register val = gef.arch.register(reg) @@ -2393,7 +2393,7 @@ def is_conditional_branch(self, insn) -> bool: def is_branch_taken(self, insn) -> Tuple[bool, str]: mnemo = insn.mnemonic - # ref: http://www.davespace.co.uk/arm/introduction-to-arm/conditional.html + # ref: https://www.davespace.co.uk/arm/introduction-to-arm/conditional.html flags = dict((self.flags_table[k], k) for k in self.flags_table) val = gef.arch.register(self.flag_register) taken, reason = False, "" @@ -2490,7 +2490,7 @@ def is_call(self, insn) -> bool: return mnemo in call_mnemos def flag_register_to_human(self, val: Optional[int] = None) -> str: - # http://events.linuxfoundation.org/sites/events/files/slides/KoreaLinuxForum-2014.pdf + # https://events.linuxfoundation.org/sites/events/files/slides/KoreaLinuxForum-2014.pdf reg = self.flag_register if not val: val = gef.arch.register(reg) @@ -2750,7 +2750,7 @@ class PowerPC(Architecture): "$r24", "$r25", "$r26", "$r27", "$r28", "$r29", "$r30", "$r31", "$pc", "$msr", "$cr", "$lr", "$ctr", "$xer", "$trap",] instruction_length = 4 - nop_insn = b"\x60\x00\x00\x00" # http://www.ibm.com/developerworks/library/l-ppc/index.html + nop_insn = b"\x60\x00\x00\x00" # https://developer.ibm.com/articles/l-ppc/ return_register = "$r0" flag_register = "$cr" flags_table = { @@ -2769,7 +2769,7 @@ class PowerPC(Architecture): syscall_instructions = ["sc"] def flag_register_to_human(self, val: Optional[int] = None) -> str: - # http://www.cebix.net/downloads/bebox/pem32b.pdf (% 2.1.3) + # https://www.cebix.net/downloads/bebox/pem32b.pdf (% 2.1.3) if not val: reg = self.flag_register val = gef.arch.register(reg) @@ -2809,7 +2809,7 @@ def get_ra(self, insn, frame) -> Optional[int]: @classmethod def mprotect_asm(cls, addr: int, size: int, perm) -> str: - # Ref: http://www.ibm.com/developerworks/library/l-ppc/index.html + # Ref: https://developer.ibm.com/articles/l-ppc/ _NR_mprotect = 125 insns = [ "addi 1, 1, -16", # 1 = r1 = sp @@ -2843,7 +2843,7 @@ class PowerPC64(PowerPC): @register_architecture class SPARC(Architecture): """ Refs: - - http://www.cse.scu.edu/~atkinson/teaching/sp05/259/sparc.pdf + - https://www.cse.scu.edu/~atkinson/teaching/sp05/259/sparc.pdf """ aliases = ("SPARC", Elf.SPARC) arch = "SPARC" @@ -2872,7 +2872,7 @@ class SPARC(Architecture): syscall_instructions = ["t 0x10"] def flag_register_to_human(self, val: Optional[int] = None) -> str: - # http://www.gaisler.com/doc/sparcv8.pdf + # https://www.gaisler.com/doc/sparcv8.pdf reg = self.flag_register if not val: val = gef.arch.register(reg) @@ -2998,7 +2998,7 @@ class MIPS(Architecture): arch = "MIPS" mode = "MIPS32" - # http://vhouten.home.xs4all.nl/mipsel/r3000-isa.html + # https://vhouten.home.xs4all.nl/mipsel/r3000-isa.html all_registers = [ "$zero", "$at", "$v0", "$v1", "$a0", "$a1", "$a2", "$a3", "$t0", "$t1", "$t2", "$t3", "$t4", "$t5", "$t6", "$t7", @@ -7569,7 +7569,7 @@ def get_shellcode(self, sid: int) -> None: @register_command class RopperCommand(GenericCommand): - """Ropper (http://scoding.de/ropper) plugin.""" + """Ropper (https://scoding.de/ropper/) plugin.""" _cmdline_ = "ropper" _syntax_ = f"{_cmdline_} [ROPPER_OPTIONS]" @@ -7831,7 +7831,7 @@ def do_invoke(self, argv: List, *args, **kwargs) -> None: err("Unsupported") return - # http://www.sco.com/developers/gabi/latest/ch4.eheader.html + # https://www.sco.com/developers/gabi/latest/ch4.eheader.html classes = { Elf.ELF_32_BITS : "32-bit", Elf.ELF_64_BITS : "64-bit",