What's Changed
- Redress can show 3rd party dependencies found in the project's
go.mod file. The output also includes the hash that is stored in the go.sum file:
$ redress gomod ./redress
Type Name Version Replaced by Hash
---- ---- ------- ----------- ----
main github.com/goretk/redress (devel)
dep github.com/TcM1911/r2g2 v0.3.2 h1:v+MaRN0sAGZsVP3+CC8WlL1psWZfAQwL5oTzSeF0K0s=
dep github.com/cheynewallace/tabby v1.1.1 h1:JvUR8waht4Y0S3JF17G6Vhyt+FRhnqVCkk8l4YrOU54=
dep github.com/goretk/gore v0.11.0 h1:yW5uzyZd3J0MVXm1xA7KLZLKvhgiR7IJv4at893/1LM=
dep github.com/spf13/cobra v1.2.1 h1:+KmjbUw1hriSNMF55oPrkZcb27aECyrj8V2ytv7kWDw=
dep github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA=
dep golang.org/x/arch v0.0.0-20220412001346-fc48f9fe4c15 h1:GVfVkciLYxn5mY5EncwAe0SXUn9Rm81rRkZ0TTmn/cU=
dep golang.org/x/mod v0.5.1 h1:OJxoQ/rynoF0dcCdI7cLPktw/hR2cueqYfjm43oqK38=
- Show some of the fields in the
moduledata structure. According to the source code, the moduledata "records information about the layout of the executable image."
$ redress moduledata ./redress
Section Address Size
------- ------- ----
text 0x401000 0x24db8e
types 0x64f000 0xebc54
itablinks 0x73d3e0 0x154
pclntab 0x80ea40 0x85638
functab 0x80ea40 0x16df
noptrdata 0x895640 0x1b14c
data 0x8b07a0 0xd248
bss 0x8bda00 0x2f5c0
noptrbss 0x8ecfc0 0x3b90
- It's also possible to dump the sections too:
$ redress moduledata dump text ./redress | hexdump -C | head
00000000 f3 0f 1e fa 41 54 49 89 fc 53 48 81 ec d8 00 00 |....ATI..SH.....|
00000010 00 48 89 74 24 28 48 89 54 24 30 48 89 4c 24 38 |.H.t$(H.T$0H.L$8|
00000020 4c 89 44 24 40 4c 89 4c 24 48 84 c0 74 37 0f 29 |L.D$@L.L$H..t7.)|
00000030 44 24 50 0f 29 4c 24 60 0f 29 54 24 70 0f 29 9c |D$P.)L$`.)T$p.).|
00000040 24 80 00 00 00 0f 29 a4 24 90 00 00 00 0f 29 ac |$.....).$.....).|
00000050 24 a0 00 00 00 0f 29 b4 24 b0 00 00 00 0f 29 bc |$.....).$.....).|
00000060 24 c0 00 00 00 48 8b 1d b4 45 49 00 ba 0d 00 00 |$....H...EI.....|
00000070 00 be 01 00 00 00 48 8d 3d b4 d2 32 00 48 8b 0b |......H.=..2.H..|
00000080 e8 2b db 24 00 48 8b 3b 48 8d 4c 24 08 4c 89 e2 |.+.$.H.;H.L$.L..|
00000090 48 8d 84 24 f0 00 00 00 be 01 00 00 00 c7 44 24 |H..$..........D$|
- The
info command now also include build environment information such as if the code is stored in a version control system.
$ redress info ./redress
OS EM_X86_64
Arch amd64
Compiler 1.20.3 (2023-04-04)
Build ID A3auvTnKX8Y3JEoppXxS/5AIMQssVyu_q3FWsk9NZ/Y74pwF1FgOxdKCkGlMBN/gOIuM14Mcu14U7OLxNjU
Main root github.com/goretk/redress
# main 1
# std 76
# vendor 7
-buildmode exe
-compiler gc
-trimpath true
CGO_ENABLED 1
GOARCH amd64
GOOS linux
GOAMD64 v1
vcs git
vcs.revision 7575309b240615e26ef75ae4d9ee660ee60e3083
vcs.time 2023-04-15T08:54:55Z
vcs.modified false
- Print the definition for a type at a specific address:
$ ./redress types offset -h
Print type at the given address.
Usage:
redress types offset address path/to/file [flags]
Flags:
-h, --help help for offset
--version string Fallback compiler version.