Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use https URLs where we can #793

Merged
merged 1 commit into from
Jan 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)|
Expand Down Expand Up @@ -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`)|
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/assemble.md
Original file line number Diff line number Diff line change
@@ -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.

Expand Down
2 changes: 1 addition & 1 deletion docs/commands/checksec.md
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion docs/commands/heap-analysis-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion docs/commands/heap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

```
Expand Down
4 changes: 2 additions & 2 deletions docs/commands/stub.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
6 changes: 4 additions & 2 deletions docs/commands/syscall-args.md
Original file line number Diff line number Diff line change
@@ -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
```
Expand Down
6 changes: 3 additions & 3 deletions docs/commands/trace-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ gef> trace-run <address_of_last_instruction_to_trace>

![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)

2 changes: 1 addition & 1 deletion docs/commands/vmmap.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
2 changes: 1 addition & 1 deletion docs/commands/xfiles.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
28 changes: 16 additions & 12 deletions docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -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? ##
Expand All @@ -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,
Expand All @@ -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:
Expand Down
28 changes: 14 additions & 14 deletions gef.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand All @@ -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, ""
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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 = {
Expand All @@ -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)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -7570,7 +7570,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]"
Expand Down Expand Up @@ -7832,7 +7832,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",
Expand Down