> LD_DEBUG=symbols,bindings LD_PRELOAD=liba.so:libb.so ./main
- >> symbol=memcpy; lookup in file=./main [0]
- >> symbol=memcpy; lookup in file=<path>/liba.so [0]
- >> symbol=memcpy; lookup in file=<path>/libb.so [0]
- >> symbol=memcpy; lookup in file=/usr/lib/libc.so.6 [0]
- >> binding file ./main [0] to /usr/lib/libc.so.6 [0]: normal symbol `memcpy' [GLIBC_2.14]
+> LD_DEBUG=symbols,bindings LD_PRELOAD=liba.so:libb.so ./main
+ >> symbol=memcpy; lookup in file=./main [0]
+ >> symbol=memcpy; lookup in file=<path>/liba.so [0]
+ >> symbol=memcpy; lookup in file=<path>/libb.so [0]
+ >> symbol=memcpy; lookup in file=/usr/lib/libc.so.6 [0]
+ >> binding file ./main [0] to /usr/lib/libc.so.6 [0]: normal symbol `memcpy' [GLIBC_2.14]
+
+
+As shown in the LD_PRELOAD
section above, when the dynamic linker resolves
+symbol relocations, it walks the link map and until the first object provides
+the requested symbol.
+When libraries are loaded dynamically during runtime with dlopen(3)
, one can
+control the visibility of the symbols for the loaded library. The following two
+flags control this visibility.
+
+RTLD_LOCAL
the symbols of the library (and its dependencies) are not
+visible in the global symbol scope and therefore do not participate in global
+symbol resolution from other libraries (default).
+RTLD_GLOBAL
the symbols of the library are visible in the global symbol
+scope.
+
+Additionally to the visibility one can use the RTLD_DEEPBIND
flag to define
+the lookup order when resolving symbols of the loaded library. With deep
+binding, the symbols of the loaded library (and its dependencies) are searched
+first before the global scope is searched. Without deep binding, the order is
+reversed and the global space is searched first, which is the default.
+The sources in ldso/deepbind give a minimal example, which can
+be used to experiment with the different flags and investigate their behavior.
+main
+|-> explicitly link against liblink.so
+|-> dlopen(libdeep.so, RTLD_LOCAL | RTLD_DEEPBIND)
+`-> dlopen(libnodp.so, RTLD_LOCAL)
+
+The following snippets are taken from LD_DEBUG
to demonstrate the
+RLTD_LOCAL
and RTLD_DEEPBIND
flags.
+# dlopen("libdeep.so", RTLD_LOCAL | RTLD_DEEPBIND)
+# scopes visible to libdeep.so, where scope [0] is the local one.
+object=./libdeep.so [0]
+ scope 0: ./libdeep.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+ scope 1: ./main ./libprel.so ./liblink.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+
+# main: dlsym(handle:libdeep.so, "test")
+symbol=test; lookup in file=./libdeep.so [0]
+binding file ./libdeep.so [0] to ./libdeep.so [0]: normal symbol `test'
+
+# libdeep.so: dlsym(RTLD_NEXT, "next_libdeep")
+symbol=next_libdeep; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=next_libdeep; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libdeep.so: error: symbol lookup error: undefined symbol: next_libdeep (fatal)
+
+# libdeep.so: dlsym(RTLD_DEFAULT, "default_libdeep")
+# first search local scope (DEEPBIND)
+symbol=default_libdeep; lookup in file=./libdeep.so [0]
+symbol=default_libdeep; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libdeep; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+symbol=default_libdeep; lookup in file=./main [0]
+symbol=default_libdeep; lookup in file=./libprel.so [0]
+symbol=default_libdeep; lookup in file=./liblink.so [0]
+symbol=default_libdeep; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libdeep; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libdeep.so: error: symbol lookup error: undefined symbol: default_libdeep (fatal)
+
+# main: dlsym(handle:libdeep.so, "libdeep_main")
+symbol=libdeep_main; lookup in file=./libdeep.so [0]
+symbol=libdeep_main; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=libdeep_main; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libdeep.so: error: symbol lookup error: undefined symbol: libdeep_main (fatal)
+
+The following snippets are taken from LD_DEBUG
to demonstrate the
+RLTD_LOCAL
flag without the RTLD_DEEPBIND
flag.
+# dlopen("libdeep.so", RTLD_LOCAL)
+# scopes visible to libnodp.so, where scope [0] is the global one.
+object=./libnodp.so [0]
+ scope 0: ./main ./libprel.so ./liblink.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+ scope 1: ./libnodp.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+
+# main: dlsym(handle:libnodp.so, "test")
+symbol=test; lookup in file=./libnodp.so [0]
+binding file ./libnodp.so [0] to ./libnodp.so [0]: normal symbol `test'
+
+# libnodp.so: dlsym(RTLD_NEXT, "next_libnodp")
+symbol=next_libnodp; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=next_libnodp; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libnodp.so: error: symbol lookup error: undefined symbol: next_libnodp (fatal)
+
+# libnodp.so: dlsym(RTLD_DEFAULT, "default_libnodp")
+# first search global scope (no DEEPBIND)
+symbol=default_libnodp; lookup in file=./main [0]
+symbol=default_libnodp; lookup in file=./libprel.so [0]
+symbol=default_libnodp; lookup in file=./liblink.so [0]
+symbol=default_libnodp; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libnodp; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+symbol=default_libnodp; lookup in file=./libnodp.so [0]
+symbol=default_libnodp; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libnodp; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libnodp.so: error: symbol lookup error: undefined symbol: default_libnodp (fatal)
+
+# main: dlsym(handle:libnodp.so, "libnodp_main")
+symbol=libnodp_main; lookup in file=./libnodp.so [0]
+symbol=libnodp_main; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=libnodp_main; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libnodp.so: error: symbol lookup error: undefined symbol: libnodp_main (fatal)
+
+The following is a global lookup from the main application, since
+lib{deep,nodp}.so
were loaded with RTLD_LOCAL
, they are not visible in the
+global symbol scope.
+# main: dlsym(RTLD_DEFAULT, "default_main")
+symbol=default_main; lookup in file=./main [0]
+symbol=default_main; lookup in file=./libprel.so [0]
+symbol=default_main; lookup in file=./liblink.so [0]
+symbol=default_main; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_main; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./main: error: symbol lookup error: undefined symbol: default_main (fatal)
Dynamic linking basically works via one indirect jump. It uses a combination of
@@ -252,33 +359,33 @@ section).
On the first call the trampoline sets up some metadata and then jumps to the
ld.so
runtime resolve function, which in turn patches the table with the
correct function pointer.
- .plt ....... procedure linkage table, contains function trampolines, usually
- located in code segment (rx permission)
- .got.plt ... global offset table for .plt, holds the function pointer table
+.plt ....... procedure linkage table, contains function trampolines, usually
+ located in code segment (rx permission)
+.got.plt ... global offset table for .plt, holds the function pointer table
Using radare2
we can analyze this in more detail:
- [0x00401040]> pd 4 @ section..got.plt
- ;-- section..got.plt:
- ;-- .got.plt: ; [22] -rw- section size 32 named .got.plt
- ;-- _GLOBAL_OFFSET_TABLE_:
- [0] 0x00404000 .qword 0x0000000000403e10 ; section..dynamic
- [1] 0x00404008 .qword 0x0000000000000000
- ; CODE XREF from section..plt @ +0x6
- [2] 0x00404010 .qword 0x0000000000000000
- ;-- reloc.puts:
- ; CODE XREF from sym.imp.puts @ 0x401030
- [3] 0x00404018 .qword 0x0000000000401036 ; RELOC 64 puts
-
- [0x00401040]> pd 6 @ section..plt
- ;-- section..plt:
- ;-- .plt: ; [12] -r-x section size 32 named .plt
- ┌─> 0x00401020 ff35e22f0000 push qword [0x00404008]
- ╎ 0x00401026 ff25e42f0000 jmp qword [0x00404010]
- ╎ 0x0040102c 0f1f4000 nop dword [rax]
- ┌ 6: int sym.imp.puts (const char *s);
- └ ╎ 0x00401030 ff25e22f0000 jmp qword [reloc.puts]
- ╎ 0x00401036 6800000000 push 0
- └─< 0x0040103b e9e0ffffff jmp sym..plt
+[0x00401040]> pd 4 @ section..got.plt
+ ;-- section..got.plt:
+ ;-- .got.plt: ; [22] -rw- section size 32 named .got.plt
+ ;-- _GLOBAL_OFFSET_TABLE_:
+ [0] 0x00404000 .qword 0x0000000000403e10 ; section..dynamic
+ [1] 0x00404008 .qword 0x0000000000000000
+ ; CODE XREF from section..plt @ +0x6
+ [2] 0x00404010 .qword 0x0000000000000000
+ ;-- reloc.puts:
+ ; CODE XREF from sym.imp.puts @ 0x401030
+ [3] 0x00404018 .qword 0x0000000000401036 ; RELOC 64 puts
+
+[0x00401040]> pd 6 @ section..plt
+ ;-- section..plt:
+ ;-- .plt: ; [12] -r-x section size 32 named .plt
+ ┌─> 0x00401020 ff35e22f0000 push qword [0x00404008]
+ ╎ 0x00401026 ff25e42f0000 jmp qword [0x00404010]
+ ╎ 0x0040102c 0f1f4000 nop dword [rax]
+┌ 6: int sym.imp.puts (const char *s);
+└ ╎ 0x00401030 ff25e22f0000 jmp qword [reloc.puts]
+ ╎ 0x00401036 6800000000 push 0
+ └─< 0x0040103b e9e0ffffff jmp sym..plt
diff --git a/development/ldso/deepbind/.gitignore b/development/ldso/deepbind/.gitignore
new file mode 100644
index 0000000..a80e8fd
--- /dev/null
+++ b/development/ldso/deepbind/.gitignore
@@ -0,0 +1,2 @@
+*.so
+main
diff --git a/development/ldso/deepbind/Makefile b/development/ldso/deepbind/Makefile
new file mode 100644
index 0000000..6fc4eb1
--- /dev/null
+++ b/development/ldso/deepbind/Makefile
@@ -0,0 +1,19 @@
+run: build
+ LD_PRELOAD=./libprel.so ./main
+
+debug: build
+ #LD_DEBUG_OUTPUT=ldso
+ LD_DEBUG=scopes,symbols,bindings LD_PRELOAD=./libprel.so ./main
+
+build:
+ gcc -g -o libprel.so lib.c -DNAME=\"prel\" -fPIC -shared
+ gcc -g -o libdeep.so lib.c -DNAME=\"deep\" -fPIC -shared
+ gcc -g -o libnodp.so lib.c -DNAME=\"nodp\" -fPIC -shared
+ gcc -g -o liblink.so lib.c -DNAME=\"link\" -fPIC -shared
+ gcc -g -o main main.c ./liblink.so -ldl
+
+fmt:
+ clang-format -i *.c
+
+clean:
+ $(RM) *.so main
diff --git a/development/ldso/deepbind/lib.c b/development/ldso/deepbind/lib.c
new file mode 100644
index 0000000..e18a4ce
--- /dev/null
+++ b/development/ldso/deepbind/lib.c
@@ -0,0 +1,23 @@
+#define _GNU_SOURCE
+#include
+#include
+
+#ifndef NAME
+#define NAME ""
+#endif
+
+void test() {
+ puts(NAME ":test()");
+
+ // Lookup next symbol from the libraries scope, which will search only in the
+ // libraries LOCAL scope, starting from the next object after the current one.
+ (void)dlsym(RTLD_NEXT, "next_lib" NAME);
+
+ // Global lookup from the libraries scope, which will search libraries in the
+ // GLOBAL scope and the libraries LOCAL scope. The order in which the scopes
+ // are searched depends on whether the library was loaded (a) with DEEPBIND or
+ // (b) not. whether this library was loaded with DEEPBIND). In the first case,
+ // the LOCAL scope is searched first, where in the latter, the GLOBAL scope is
+ // searched first.
+ (void)dlsym(RTLD_DEFAULT, "default_lib" NAME);
+}
diff --git a/development/ldso/deepbind/main.c b/development/ldso/deepbind/main.c
new file mode 100644
index 0000000..6d93520
--- /dev/null
+++ b/development/ldso/deepbind/main.c
@@ -0,0 +1,40 @@
+#include
+#include
+
+int main() {
+ puts("-- deep --");
+ // Load library into its own LOCAL scope with DEEPBINDING, meaning that
+ // symbols will first resolve to the library + its dependencies first before
+ // considering global symbols.
+ void* h1 = dlopen("./libdeep.so", RTLD_LAZY | RTLD_LOCAL | RTLD_DEEPBIND);
+ if (h1) {
+ // Lookup symbol in the libraries LOCAL scope (library + its own
+ // dependencies).
+ void (*test_fn)() = dlsym(h1, "test");
+ test_fn();
+
+ // Lookup non-existing symbol in the libraries LOCAL scope (library + its
+ // own dependencies).
+ (void)dlsym(h1, "libdeep_main");
+ }
+
+ puts("-- nodp --");
+ // Load library into its own LOCAL scope.
+ void* h2 = dlopen("./libnodp.so", RTLD_LOCAL | RTLD_LAZY);
+ if (h2) {
+ // Lookup symbol in the libraries LOCAL scope (library + its own
+ // dependencies).
+ void (*test_fn)() = dlsym(h2, "test");
+ test_fn();
+
+ // Lookup non-existing symbol in the libraries LOCAL scope (library + its
+ // own dependencies).
+ (void)dlsym(h2, "libnodp_main");
+ }
+
+ puts("-- main --");
+ // Lookup non-existing symbol in the GLOBAL scope.
+ (void)dlsym(RTLD_DEFAULT, "default_main");
+
+ return 0;
+}
diff --git a/print.html b/print.html
index 9e5e1f6..b12601f 100644
--- a/print.html
+++ b/print.html
@@ -4747,13 +4747,13 @@ rule2 -> bar
- LD_PRELOAD=<l_so> colon separated list of libso's to be pre loaded
- LD_DEBUG=<opts> comma separated list of debug options
- =help list available options
- =libs show library search path
- =files processing of input files
- =symbols show search path for symbol lookup
- =bindings show against which definition a symbol is bound
+LD_PRELOAD=<l_so> colon separated list of libso's to be pre loaded
+LD_DEBUG=<opts> comma separated list of debug options
+ =help list available options
+ =libs show library search path
+ =files processing of input files
+ =symbols show search path for symbol lookup
+ =bindings show against which definition a symbol is bound
When dynamically loading a shared library during program runtime with
@@ -4771,14 +4771,14 @@ dlopen("libbar.so", RTLD_LAZY);
Libraries specified in LD_PRELOAD
are loaded from left-to-right
but
initialized from right-to-left
.
- > ldd ./main
- >> libc.so.6 => /usr/lib/libc.so.6
+> ldd ./main
+ >> libc.so.6 => /usr/lib/libc.so.6
- > LD_PRELOAD=liba.so:libb.so ./main
- -->
- preloaded in this order
- <--
- initialized in this order
+> LD_PRELOAD=liba.so:libb.so ./main
+ -->
+ preloaded in this order
+ <--
+ initialized in this order
The preload order determines:
@@ -4787,32 +4787,139 @@ initialized from right-to-left
.
For the example listed above the resulting link map
will look like the
following:
- +------+ +------+ +------+ +------+
+ +------+ +------+ +------+ +------+
| main | -> | liba | -> | libb | -> | libc |
+------+ +------+ +------+ +------+
This can be seen when running with LD_DEBUG=files
:
- > LD_DEBUG=files LD_PRELOAD=liba.so:libb.so ./main
- # load order (-> determines link map)
- >> file=liba.so [0]; generating link map
- >> file=libb.so [0]; generating link map
- >> file=libc.so.6 [0]; generating link map
-
- # init order
- >> calling init: /usr/lib/libc.so.6
- >> calling init: <path>/libb.so
- >> calling init: <path>/liba.so
- >> initialize program: ./main
+> LD_DEBUG=files LD_PRELOAD=liba.so:libb.so ./main
+ # load order (-> determines link map)
+ >> file=liba.so [0]; generating link map
+ >> file=libb.so [0]; generating link map
+ >> file=libc.so.6 [0]; generating link map
+
+ # init order
+ >> calling init: /usr/lib/libc.so.6
+ >> calling init: <path>/libb.so
+ >> calling init: <path>/liba.so
+ >> initialize program: ./main
To verify the link map
order we let ld.so
resolve the memcpy(3)
libc
symbol (used in main) dynamically, while enabling LD_DEBUG=symbols,bindings
to see the resolving in action.
- > LD_DEBUG=symbols,bindings LD_PRELOAD=liba.so:libb.so ./main
- >> symbol=memcpy; lookup in file=./main [0]
- >> symbol=memcpy; lookup in file=<path>/liba.so [0]
- >> symbol=memcpy; lookup in file=<path>/libb.so [0]
- >> symbol=memcpy; lookup in file=/usr/lib/libc.so.6 [0]
- >> binding file ./main [0] to /usr/lib/libc.so.6 [0]: normal symbol `memcpy' [GLIBC_2.14]
+> LD_DEBUG=symbols,bindings LD_PRELOAD=liba.so:libb.so ./main
+ >> symbol=memcpy; lookup in file=./main [0]
+ >> symbol=memcpy; lookup in file=<path>/liba.so [0]
+ >> symbol=memcpy; lookup in file=<path>/libb.so [0]
+ >> symbol=memcpy; lookup in file=/usr/lib/libc.so.6 [0]
+ >> binding file ./main [0] to /usr/lib/libc.so.6 [0]: normal symbol `memcpy' [GLIBC_2.14]
+
+
+As shown in the LD_PRELOAD
section above, when the dynamic linker resolves
+symbol relocations, it walks the link map and until the first object provides
+the requested symbol.
+When libraries are loaded dynamically during runtime with dlopen(3)
, one can
+control the visibility of the symbols for the loaded library. The following two
+flags control this visibility.
+
+RTLD_LOCAL
the symbols of the library (and its dependencies) are not
+visible in the global symbol scope and therefore do not participate in global
+symbol resolution from other libraries (default).
+RTLD_GLOBAL
the symbols of the library are visible in the global symbol
+scope.
+
+Additionally to the visibility one can use the RTLD_DEEPBIND
flag to define
+the lookup order when resolving symbols of the loaded library. With deep
+binding, the symbols of the loaded library (and its dependencies) are searched
+first before the global scope is searched. Without deep binding, the order is
+reversed and the global space is searched first, which is the default.
+The sources in ldso/deepbind give a minimal example, which can
+be used to experiment with the different flags and investigate their behavior.
+main
+|-> explicitly link against liblink.so
+|-> dlopen(libdeep.so, RTLD_LOCAL | RTLD_DEEPBIND)
+`-> dlopen(libnodp.so, RTLD_LOCAL)
+
+The following snippets are taken from LD_DEBUG
to demonstrate the
+RLTD_LOCAL
and RTLD_DEEPBIND
flags.
+# dlopen("libdeep.so", RTLD_LOCAL | RTLD_DEEPBIND)
+# scopes visible to libdeep.so, where scope [0] is the local one.
+object=./libdeep.so [0]
+ scope 0: ./libdeep.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+ scope 1: ./main ./libprel.so ./liblink.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+
+# main: dlsym(handle:libdeep.so, "test")
+symbol=test; lookup in file=./libdeep.so [0]
+binding file ./libdeep.so [0] to ./libdeep.so [0]: normal symbol `test'
+
+# libdeep.so: dlsym(RTLD_NEXT, "next_libdeep")
+symbol=next_libdeep; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=next_libdeep; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libdeep.so: error: symbol lookup error: undefined symbol: next_libdeep (fatal)
+
+# libdeep.so: dlsym(RTLD_DEFAULT, "default_libdeep")
+# first search local scope (DEEPBIND)
+symbol=default_libdeep; lookup in file=./libdeep.so [0]
+symbol=default_libdeep; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libdeep; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+symbol=default_libdeep; lookup in file=./main [0]
+symbol=default_libdeep; lookup in file=./libprel.so [0]
+symbol=default_libdeep; lookup in file=./liblink.so [0]
+symbol=default_libdeep; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libdeep; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libdeep.so: error: symbol lookup error: undefined symbol: default_libdeep (fatal)
+
+# main: dlsym(handle:libdeep.so, "libdeep_main")
+symbol=libdeep_main; lookup in file=./libdeep.so [0]
+symbol=libdeep_main; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=libdeep_main; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libdeep.so: error: symbol lookup error: undefined symbol: libdeep_main (fatal)
+
+The following snippets are taken from LD_DEBUG
to demonstrate the
+RLTD_LOCAL
flag without the RTLD_DEEPBIND
flag.
+# dlopen("libdeep.so", RTLD_LOCAL)
+# scopes visible to libnodp.so, where scope [0] is the global one.
+object=./libnodp.so [0]
+ scope 0: ./main ./libprel.so ./liblink.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+ scope 1: ./libnodp.so /usr/lib/libc.so.6 /lib64/ld-linux-x86-64.so.2
+
+# main: dlsym(handle:libnodp.so, "test")
+symbol=test; lookup in file=./libnodp.so [0]
+binding file ./libnodp.so [0] to ./libnodp.so [0]: normal symbol `test'
+
+# libnodp.so: dlsym(RTLD_NEXT, "next_libnodp")
+symbol=next_libnodp; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=next_libnodp; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libnodp.so: error: symbol lookup error: undefined symbol: next_libnodp (fatal)
+
+# libnodp.so: dlsym(RTLD_DEFAULT, "default_libnodp")
+# first search global scope (no DEEPBIND)
+symbol=default_libnodp; lookup in file=./main [0]
+symbol=default_libnodp; lookup in file=./libprel.so [0]
+symbol=default_libnodp; lookup in file=./liblink.so [0]
+symbol=default_libnodp; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libnodp; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+symbol=default_libnodp; lookup in file=./libnodp.so [0]
+symbol=default_libnodp; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_libnodp; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libnodp.so: error: symbol lookup error: undefined symbol: default_libnodp (fatal)
+
+# main: dlsym(handle:libnodp.so, "libnodp_main")
+symbol=libnodp_main; lookup in file=./libnodp.so [0]
+symbol=libnodp_main; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=libnodp_main; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./libnodp.so: error: symbol lookup error: undefined symbol: libnodp_main (fatal)
+
+The following is a global lookup from the main application, since
+lib{deep,nodp}.so
were loaded with RTLD_LOCAL
, they are not visible in the
+global symbol scope.
+# main: dlsym(RTLD_DEFAULT, "default_main")
+symbol=default_main; lookup in file=./main [0]
+symbol=default_main; lookup in file=./libprel.so [0]
+symbol=default_main; lookup in file=./liblink.so [0]
+symbol=default_main; lookup in file=/usr/lib/libc.so.6 [0]
+symbol=default_main; lookup in file=/lib64/ld-linux-x86-64.so.2 [0]
+./main: error: symbol lookup error: undefined symbol: default_main (fatal)
Dynamic linking basically works via one indirect jump. It uses a combination of
@@ -4821,33 +4928,33 @@ section).
On the first call the trampoline sets up some metadata and then jumps to the
ld.so
runtime resolve function, which in turn patches the table with the
correct function pointer.
- .plt ....... procedure linkage table, contains function trampolines, usually
- located in code segment (rx permission)
- .got.plt ... global offset table for .plt, holds the function pointer table
+.plt ....... procedure linkage table, contains function trampolines, usually
+ located in code segment (rx permission)
+.got.plt ... global offset table for .plt, holds the function pointer table
Using radare2
we can analyze this in more detail:
- [0x00401040]> pd 4 @ section..got.plt
- ;-- section..got.plt:
- ;-- .got.plt: ; [22] -rw- section size 32 named .got.plt
- ;-- _GLOBAL_OFFSET_TABLE_:
- [0] 0x00404000 .qword 0x0000000000403e10 ; section..dynamic
- [1] 0x00404008 .qword 0x0000000000000000
- ; CODE XREF from section..plt @ +0x6
- [2] 0x00404010 .qword 0x0000000000000000
- ;-- reloc.puts:
- ; CODE XREF from sym.imp.puts @ 0x401030
- [3] 0x00404018 .qword 0x0000000000401036 ; RELOC 64 puts
-
- [0x00401040]> pd 6 @ section..plt
- ;-- section..plt:
- ;-- .plt: ; [12] -r-x section size 32 named .plt
- ┌─> 0x00401020 ff35e22f0000 push qword [0x00404008]
- ╎ 0x00401026 ff25e42f0000 jmp qword [0x00404010]
- ╎ 0x0040102c 0f1f4000 nop dword [rax]
- ┌ 6: int sym.imp.puts (const char *s);
- └ ╎ 0x00401030 ff25e22f0000 jmp qword [reloc.puts]
- ╎ 0x00401036 6800000000 push 0
- └─< 0x0040103b e9e0ffffff jmp sym..plt
+[0x00401040]> pd 4 @ section..got.plt
+ ;-- section..got.plt:
+ ;-- .got.plt: ; [22] -rw- section size 32 named .got.plt
+ ;-- _GLOBAL_OFFSET_TABLE_:
+ [0] 0x00404000 .qword 0x0000000000403e10 ; section..dynamic
+ [1] 0x00404008 .qword 0x0000000000000000
+ ; CODE XREF from section..plt @ +0x6
+ [2] 0x00404010 .qword 0x0000000000000000
+ ;-- reloc.puts:
+ ; CODE XREF from sym.imp.puts @ 0x401030
+ [3] 0x00404018 .qword 0x0000000000401036 ; RELOC 64 puts
+
+[0x00401040]> pd 6 @ section..plt
+ ;-- section..plt:
+ ;-- .plt: ; [12] -r-x section size 32 named .plt
+ ┌─> 0x00401020 ff35e22f0000 push qword [0x00404008]
+ ╎ 0x00401026 ff25e42f0000 jmp qword [0x00404010]
+ ╎ 0x0040102c 0f1f4000 nop dword [rax]
+┌ 6: int sym.imp.puts (const char *s);
+└ ╎ 0x00401030 ff25e22f0000 jmp qword [reloc.puts]
+ ╎ 0x00401036 6800000000 push 0
+ └─< 0x0040103b e9e0ffffff jmp sym..plt
diff --git a/searchindex.js b/searchindex.js
index 8307911..cb2e718 100644
--- a/searchindex.js
+++ b/searchindex.js
@@ -1 +1 @@
-Object.assign(window.search, {"doc_urls":["intro.html#notes","tools/index.html#tools","tools/zsh.html#zsh1","tools/zsh.html#keybindings","tools/zsh.html#parameter","tools/zsh.html#variables","tools/zsh.html#expansion-flags","tools/zsh.html#io-redirections","tools/zsh.html#process-substitution","tools/zsh.html#argument-parsing-with-zparseopts","tools/zsh.html#example","tools/zsh.html#regular-expressions","tools/zsh.html#completion","tools/zsh.html#installation","tools/zsh.html#completion-variables","tools/zsh.html#completion-functions","tools/zsh.html#example-1","tools/zsh.html#example-with-optional-arguments","tools/bash.html#bash1","tools/bash.html#expansion","tools/bash.html#generator","tools/bash.html#parameter","tools/bash.html#pathname","tools/bash.html#io-redirection","tools/bash.html#explanation","tools/bash.html#process-substitution--ref-","tools/bash.html#command-grouping","tools/bash.html#argument-parsing-with-getopts","tools/bash.html#example","tools/bash.html#regular-expressions","tools/bash.html#completion","tools/bash.html#example-1","tools/fish.html#fish1","tools/fish.html#quick-info","tools/fish.html#variables","tools/fish.html#setunset-variables","tools/fish.html#special-variables--ref","tools/fish.html#lists","tools/fish.html#command-handling","tools/fish.html#io-redirection","tools/fish.html#process-substitution","tools/fish.html#control-flow","tools/fish.html#if--else","tools/fish.html#switch","tools/fish.html#while-loop","tools/fish.html#for-loop","tools/fish.html#functions","tools/fish.html#autoloading","tools/fish.html#helper","tools/fish.html#argument-parsing-and-completion","tools/fish.html#prompt","tools/fish.html#useful-builtins","tools/fish.html#keymaps","tools/fish.html#debug","tools/tmux.html#tmux1","tools/tmux.html#tmux-cli","tools/tmux.html#scripting","tools/tmux.html#bindings","tools/tmux.html#command-mode","tools/git.html#git1","tools/git.html#working-areas","tools/git.html#clean","tools/git.html#staging","tools/git.html#remote","tools/git.html#branching","tools/git.html#update-local-from-remote","tools/git.html#tags","tools/git.html#merging","tools/git.html#worktree","tools/git.html#log--commit-history","tools/git.html#diff--commit-info","tools/git.html#patching","tools/git.html#resetting","tools/git.html#submodules","tools/git.html#inspection","tools/git.html#revision-specifier","tools/awk.html#awk1","tools/awk.html#input-processing","tools/awk.html#program","tools/awk.html#special-pattern","tools/awk.html#special-variables","tools/awk.html#special-statements--functions","tools/awk.html#examples","tools/awk.html#filter-records","tools/awk.html#negative-patterns","tools/awk.html#range-patterns","tools/awk.html#access-last-fields-in-records","tools/awk.html#split-on-multiple-tokens","tools/awk.html#capture-in-variables","tools/awk.html#capture-in-array","tools/awk.html#run-shell-command-and-capture-output","tools/emacs.html#emacs1","tools/emacs.html#help","tools/emacs.html#package-manager","tools/emacs.html#window","tools/emacs.html#buffer","tools/emacs.html#ibuffer","tools/emacs.html#isearch","tools/emacs.html#occur","tools/emacs.html#grep","tools/emacs.html#yankpaste","tools/emacs.html#register","tools/emacs.html#blockrect","tools/emacs.html#mass-edit","tools/emacs.html#narrow","tools/emacs.html#org","tools/emacs.html#org-source","tools/emacs.html#comapny","tools/emacs.html#tags","tools/emacs.html#lisp","tools/emacs.html#ido","tools/emacs.html#evil","tools/emacs.html#dired","tools/gpg.html#gpg1","tools/gpg.html#generate-new-keypair","tools/gpg.html#list-keys","tools/gpg.html#edit-keys","tools/gpg.html#export--import-keys","tools/gpg.html#search--send-keys","tools/gpg.html#encrypt-passphrase","tools/gpg.html#encrypt-public-key","tools/gpg.html#signing","tools/gpg.html#signing-detached","tools/gpg.html#abbreviations","tools/gpg.html#keyservers","tools/gpg.html#examples","tools/gpg.html#list-basic-key-information-from-file-with-long-keyids","tools/gpg.html#extend-expiring-key","tools/gdb.html#gdb1","tools/gdb.html#cli","tools/gdb.html#interactive-usage","tools/gdb.html#misc","tools/gdb.html#breakpoints","tools/gdb.html#watchpoints","tools/gdb.html#catchpoints","tools/gdb.html#inspection","tools/gdb.html#signal-handling","tools/gdb.html#multi-threading","tools/gdb.html#multi-process","tools/gdb.html#scheduling","tools/gdb.html#shell-commands","tools/gdb.html#source-file-locations","tools/gdb.html#configuration","tools/gdb.html#text-user-interface-tui","tools/gdb.html#user-commands-macros","tools/gdb.html#hooks","tools/gdb.html#examples","tools/gdb.html#automatically-print-next-instr","tools/gdb.html#conditional-breakpoints","tools/gdb.html#set-breakpoint-on-all-threads-except-one","tools/gdb.html#catch-sigsegv-and-execute-commands","tools/gdb.html#run-backtrace-on-thread-1-batch-mode","tools/gdb.html#script-gdb-for-automating-debugging-sessions","tools/gdb.html#hook-to-automatically-save-breakpoints-on-quit","tools/gdb.html#watchpoint-on-struct--class-member","tools/gdb.html#shell-commands-1","tools/gdb.html#know-bugs","tools/gdb.html#workaround-command--finish-bug","tools/gdbserver.html#gdbserver1","tools/gdbserver.html#cli","tools/gdbserver.html#example","tools/gdbserver.html#wrapper-example-set-environment-variables-just-for-the-debugee","tools/radare2.html#radare21","tools/radare2.html#print","tools/radare2.html#flags","tools/radare2.html#help","tools/radare2.html#relocation","tools/radare2.html#examples","tools/radare2.html#patch-file-alter-bytes","tools/radare2.html#assemble--disassmble-rasm2","tools/qemu.html#qemu1","tools/qemu.html#keybindings","tools/qemu.html#vm-config-snippet","tools/qemu.html#cpu--ram","tools/qemu.html#graphic--display","tools/qemu.html#boot-menu","tools/qemu.html#block-devices","tools/qemu.html#usb","tools/qemu.html#debugging","tools/qemu.html#io-redirection","tools/qemu.html#network","tools/qemu.html#shared-drives","tools/qemu.html#debug-logging","tools/qemu.html#tracing","tools/qemu.html#vm-snapshots","tools/qemu.html#vm-migration","tools/qemu.html#appendix-direct-kernel-boot","tools/qemu.html#appendix-cheap-instruction-tracer","tools/qemu.html#references","tools/pacman.html#pacman1","tools/pacman.html#remote-package-repositories","tools/pacman.html#remove-packages","tools/pacman.html#local-package-database","tools/pacman.html#local-file-database","tools/pacman.html#hacks","tools/dot.html#dot1","tools/dot.html#example-dot-file-to-copy--paste-from","tools/dot.html#references","tools/ffmpeg.html#ffmpeg-1","tools/ffmpeg.html#screen-capture-specific-window-x11","tools/column.html#column1","tools/column.html#examples","tools/sort.html#sort1","tools/sort.html#examples","tools/sed.html#sed1","tools/sed.html#examples","tools/sed.html#delete-lines","tools/sed.html#insert-lines","tools/sed.html#substitute-lines","tools/sed.html#multiple-scripts","tools/sed.html#edit-inplace-through-symlink","tools/gnuplot.html#gnuplot-1","tools/gnuplot.html#frequently-used-configuration","tools/gnuplot.html#plot","tools/gnuplot.html#example-multiple-data-sets-in-on-plot","monitor/index.html#resource-analysis--monitor","monitor/lsof.html#lsof8","monitor/lsof.html#examples","monitor/lsof.html#file-flags","monitor/lsof.html#open-tcp-connections","monitor/lsof.html#open-connection-to-specific-host","monitor/lsof.html#open-connection-to-specific-port","monitor/lsof.html#ipv4-tcp-connections-in-established-state","monitor/lsof.html#list-open-files-in-a-mounted-directory","monitor/ss.html#ss8","monitor/ss.html#examples","monitor/pidstat.html#pidstat1","monitor/pidstat.html#page-fault-and-memory-utilization","monitor/pidstat.html#io-statistics","monitor/pgrep.html#pgrep1","monitor/pgrep.html#debug-newest-process","monitor/ps.html#ps1","monitor/ps.html#example-use-output-for-scripting","monitor/ps.html#example-watch-processes-by-name","monitor/ps.html#example-show-signal-information","monitor/pmap.html#pmap1","monitor/pstack.html#pstack1","trace_profile/index.html#trace-and-profile","trace_profile/time.html#usrbintime1","trace_profile/strace.html#strace1","trace_profile/strace.html#examples","trace_profile/ltrace.html#ltrace1","trace_profile/ltrace.html#example","trace_profile/perf.html#perf1","trace_profile/perf.html#select-specific-events","trace_profile/perf.html#raw-events","trace_profile/perf.html#find-raw-performance-counter-events-intel","trace_profile/perf.html#raw-events-for-perfs-own-symbolic-names","trace_profile/perf.html#flamegraph","trace_profile/perf.html#flamegraph-with-single-event-trace","trace_profile/perf.html#flamegraph-with-multiple-event-traces","trace_profile/perf.html#examples","trace_profile/perf.html#estimate-max-instructions-per-cycle","trace_profile/perf.html#caller-vs-callee-callstacks","trace_profile/perf.html#references","trace_profile/oprofile.html#oprofile","trace_profile/callgrind.html#callgrind","trace_profile/callgrind.html#profile-specific-part-of-the-target","binary/index.html#binary","binary/od.html#od1","binary/od.html#ascii-to-hex-string","binary/od.html#extract-parts-of-file","binary/xxd.html#xxd1","binary/xxd.html#ascii-to-hex-stream","binary/xxd.html#hex-to-binary-stream","binary/xxd.html#ascii-to-binary","binary/xxd.html#ascii-to-c-array-hex-encoded","binary/readelf.html#readelf1","binary/objdump.html#objdump1","binary/objdump.html#disassemble-section","binary/objdump.html#example-disassemble-raw-binary","binary/objdump.html#example-disassemble-specific-symbol","binary/nm.html#nm1","development/index.html#development","development/c++filt.html#cfilt1","development/c++filt.html#demangle-symbol","development/c++filt.html#demangle-stream","development/c++filt.html#demangle-types","development/c++.html#c","development/c++.html#type-deduction","development/c++.html#strict-aliasing-and-type-punning","development/c++.html#__restrict-keyword","development/c++.html#type-punning","development/c++.html#variadic-templates--parameter-pack-","development/c++.html#forwarding-reference--fwd-ref-","development/c++.html#example-any_of-template-meta-function","development/c++.html#example--sfinae---enable_if-","development/c++.html#example-minimal-templatized-test-registry","development/c++.html#example-concepts-pre-c20","development/c++.html#template-selection-with-partially--fully-specializations","development/c++.html#example-perfect-forwarding","development/glibc.html#glibc","development/glibc.html#malloc-tracer--mtrace3","development/glibc.html#malloc-check--mallopt3","development/gcc.html#gcc1","development/gcc.html#cli","development/gcc.html#preprocessing","development/gcc.html#target-options","development/gcc.html#warnings--optimizations","development/gcc.html#builtins","development/gcc.html#__builtin_expectexpr-cond","development/gcc.html#abi-linux","development/cmake.html#cmake1","development/cmake.html#frequently-used-variables","development/cmake.html#private--public--interface","development/cmake.html#find_package--ref-","development/make.html#make1","development/make.html#anatomy-of-make-rules","development/make.html#pattern-rules--variables","development/make.html#pattern-rules","development/make.html#automatic-variables","development/make.html#multi-line-variables","development/make.html#arguments","development/make.html#useful-functions","development/make.html#substitution-references","development/make.html#patsubst--ref-","development/make.html#filter","development/make.html#filter-out","development/make.html#abspath","development/make.html#realpath","development/make.html#call---ref-","development/make.html#eval--ref-","development/make.html#foreach--ref-","development/make.html#examples","development/make.html#config-based-settings","development/make.html#using-foreach--eval--call-to-generate-new-rules","development/ld.so.html#ldso8","development/ld.so.html#environment-variables","development/ld.so.html#ld_library_path-and-dlopen3","development/ld.so.html#ld_preload-initialization-order-and-link-map","development/ld.so.html#dynamic-linking-x86_64","development/symbolver.html#elf-symbol-versioning","development/symbolver.html#example-version-script","development/symbolver.html#references","development/python.html#python","development/python.html#decorator--run-","development/python.html#walrus-operator--run-","development/python.html#unittest---run-","development/python.html#doctest---run-","development/python.html#timeit","development/gcov.html#gcov1","development/gcov.html#example","development/pgo.html#profile-guided-optimization-pgo","development/pgo.html#clang","development/pgo.html#gcc","linux/index.html#linux","linux/systemd.html#systemd","linux/systemd.html#systemctl","linux/systemd.html#example-list-failed-units","linux/systemd.html#example-trivial-user-unit","linux/systemd.html#journalctl","linux/systemd.html#references","linux/coredump.html#core5","linux/coredump.html#naming-of-coredump-files","linux/coredump.html#control-which-segments-are-dumped","linux/coredump.html#some-examples-out-there","linux/coredump.html#coredumpctl-systemd","linux/coredump.html#apport-ubuntu","linux/ptrace_scope.html#ptrace_scope","linux/cryptsetup.html#cryptsetup8","linux/cryptsetup.html#example-create-luks-encrypted-disk","linux/cryptsetup.html#example-using-an-existing-luks-device","linux/swap.html#swap","linux/swap.html#list-active-swap-areas","linux/swap.html#manual-swapfile-setup","linux/swap.html#using-dphys-swapfile-service","linux/input.html#linux-input","linux/input.html#mousex--mice","linux/input.html#eventx","linux/input.html#identifying-device-files","linux/input.html#example-toying-with-devinputeventx","linux/acl.html#access-control-list-acl","linux/acl.html#show-acl-entries","linux/acl.html#modify-acl-entries","linux/acl.html#masking-of-acl-entries","linux/acl.html#references","linux/zfs.html#zfs","linux/zfs.html#zfs-pool-management","linux/zfs.html#create-modify-and-destroy-zfs-pools","linux/zfs.html#inspect-zfs-pools","linux/zfs.html#modify-vdevs","linux/zfs.html#replace-faulty-disk","linux/zfs.html#import-or-export-zfs-pools","linux/zfs.html#zfs-dataset-management","linux/zfs.html#create-and-destroy-zfs-datasets","linux/zfs.html#list-all-zfs-datasets","linux/zfs.html#mount-zfs-datasets","linux/zfs.html#encrypted-datasets","linux/zfs.html#manage-zfs-encryption-keys","linux/zfs.html#manage-dataset-properties","linux/zfs.html#snapshots","linux/zfs.html#access-control-list","linux/zfs.html#example-zfs-pool-import-during-startup-systemd","network/index.html#network","network/tcpdump.html#tcpdump1","network/tcpdump.html#cli","network/tcpdump.html#examples","network/tcpdump.html#capture-packets-from-remote-host","network/tshark.html#tshark-1","network/tshark.html#examples","network/tshark.html#capture-and-filter-packet-to-file","network/firewall-cmd.html#firewall-cmd1","network/firewall-cmd.html#list-current-status-of-the-firewall","network/firewall-cmd.html#add-entries","network/firewall-cmd.html#remove-entries","network/firewall-cmd.html#references","network/nftables.html#nftables","network/nftables.html#ruleset","network/nftables.html#examples-save-rules-to-files-and-re-apply","network/nftables.html#example-fully-trace-evaluation-of-nftables-rules","network/nftables.html#example-ipv4-port-forwarding","network/nftables.html#example-base-vs-regular-chain","network/nftables.html#mental-model-for-netfilter-packet-flow","web/index.html#web","web/html.html#html","web/html.html#collapsible-element","web/html.html#minimal-2-column-layout","web/html.html#minimal-grid-area","web/html.html#minimal-tabs","web/html.html#minimal-tags-filter","web/html.html#single-active-filter-tag","web/html.html#multiple-active-filter-tags","web/html.html#floating-figures-with-caption","web/css.html#css","web/css.html#selector","web/chartjs.html#chartjs","web/chartjs.html#minimal-example-with--external--tooltips","arch/index.html#arch","arch/x86_64.html#x86_64","arch/x86_64.html#registers","arch/x86_64.html#general-purpose-register","arch/x86_64.html#special-register","arch/x86_64.html#flags-register","arch/x86_64.html#model-specific-register-msr","arch/x86_64.html#size-directives","arch/x86_64.html#addressing","arch/x86_64.html#string-instructions","arch/x86_64.html#example-simple-memset","arch/x86_64.html#sysv-x86_64-abi","arch/x86_64.html#passing-arguments-to-functions","arch/x86_64.html#return-values-from-functions","arch/x86_64.html#caller-saved-registers","arch/x86_64.html#callee-saved-registers","arch/x86_64.html#stack","arch/x86_64.html#function-prologue--epilogue","arch/x86_64.html#windows-x64-abi","arch/x86_64.html#passing-arguments-to-functions--ref-","arch/x86_64.html#return-values-from-functions-1","arch/x86_64.html#caller-saved-registers-1","arch/x86_64.html#callee-saved-registers-1","arch/x86_64.html#asm-skeleton","arch/x86_64.html#references","arch/arm64.html#arm64","arch/arm64.html#registers","arch/arm64.html#general-purpose-registers","arch/arm64.html#special-registers-per-el","arch/arm64.html#instructions-cheatsheet","arch/arm64.html#accessing-system-registers","arch/arm64.html#control-flow","arch/arm64.html#addressing","arch/arm64.html#offset","arch/arm64.html#index","arch/arm64.html#pair-access","arch/arm64.html#procedure-call-standard-arm64--aapcs64-","arch/arm64.html#passing-arguments-to-functions","arch/arm64.html#return-values-from-functions","arch/arm64.html#callee-saved-registers","arch/arm64.html#stack","arch/arm64.html#frame-chain","arch/arm64.html#function-prologue--epilogue","arch/arm64.html#asm-skeleton","arch/arm64.html#references","arch/armv7.html#armv7a","arch/armv7.html#registers","arch/armv7.html#general-purpose-registers","arch/armv7.html#special-registers","arch/armv7.html#cpsr-register","arch/armv7.html#instructions-cheatsheet","arch/armv7.html#accessing-system-registers","arch/armv7.html#control-flow","arch/armv7.html#loadstore","arch/armv7.html#procedure-call-standard-arm--aapcs32-","arch/armv7.html#passing-arguments-to-functions","arch/armv7.html#return-values-from-functions","arch/armv7.html#callee-saved-registers","arch/armv7.html#stack","arch/armv7.html#frame-chain","arch/armv7.html#function-prologue--epilogue","arch/armv7.html#asm-skeleton","arch/armv7.html#references","arch/riscv.html#riscv","arch/riscv.html#registers","arch/riscv.html#general-purpose-registers","arch/riscv.html#asm-skeleton","arch/riscv.html#references"],"index":{"documentStore":{"docInfo":{"0":{"body":8,"breadcrumbs":2,"title":1},"1":{"body":19,"breadcrumbs":2,"title":1},"10":{"body":40,"breadcrumbs":3,"title":1},"100":{"body":43,"breadcrumbs":3,"title":1},"101":{"body":24,"breadcrumbs":3,"title":1},"102":{"body":19,"breadcrumbs":3,"title":1},"103":{"body":32,"breadcrumbs":4,"title":2},"104":{"body":22,"breadcrumbs":3,"title":1},"105":{"body":39,"breadcrumbs":3,"title":1},"106":{"body":23,"breadcrumbs":4,"title":2},"107":{"body":26,"breadcrumbs":3,"title":1},"108":{"body":38,"breadcrumbs":3,"title":1},"109":{"body":49,"breadcrumbs":3,"title":1},"11":{"body":46,"breadcrumbs":4,"title":2},"110":{"body":24,"breadcrumbs":3,"title":1},"111":{"body":28,"breadcrumbs":3,"title":1},"112":{"body":16,"breadcrumbs":3,"title":1},"113":{"body":21,"breadcrumbs":3,"title":1},"114":{"body":4,"breadcrumbs":5,"title":3},"115":{"body":13,"breadcrumbs":4,"title":2},"116":{"body":55,"breadcrumbs":4,"title":2},"117":{"body":19,"breadcrumbs":5,"title":3},"118":{"body":14,"breadcrumbs":5,"title":3},"119":{"body":19,"breadcrumbs":4,"title":2},"12":{"body":0,"breadcrumbs":3,"title":1},"120":{"body":26,"breadcrumbs":5,"title":3},"121":{"body":55,"breadcrumbs":3,"title":1},"122":{"body":32,"breadcrumbs":4,"title":2},"123":{"body":23,"breadcrumbs":3,"title":1},"124":{"body":3,"breadcrumbs":3,"title":1},"125":{"body":0,"breadcrumbs":3,"title":1},"126":{"body":5,"breadcrumbs":9,"title":7},"127":{"body":28,"breadcrumbs":5,"title":3},"128":{"body":0,"breadcrumbs":3,"title":1},"129":{"body":59,"breadcrumbs":3,"title":1},"13":{"body":36,"breadcrumbs":3,"title":1},"130":{"body":0,"breadcrumbs":4,"title":2},"131":{"body":83,"breadcrumbs":3,"title":1},"132":{"body":118,"breadcrumbs":3,"title":1},"133":{"body":37,"breadcrumbs":3,"title":1},"134":{"body":66,"breadcrumbs":3,"title":1},"135":{"body":31,"breadcrumbs":3,"title":1},"136":{"body":42,"breadcrumbs":4,"title":2},"137":{"body":28,"breadcrumbs":4,"title":2},"138":{"body":43,"breadcrumbs":4,"title":2},"139":{"body":15,"breadcrumbs":3,"title":1},"14":{"body":25,"breadcrumbs":4,"title":2},"140":{"body":20,"breadcrumbs":4,"title":2},"141":{"body":33,"breadcrumbs":5,"title":3},"142":{"body":110,"breadcrumbs":3,"title":1},"143":{"body":20,"breadcrumbs":6,"title":4},"144":{"body":25,"breadcrumbs":5,"title":3},"145":{"body":24,"breadcrumbs":3,"title":1},"146":{"body":0,"breadcrumbs":3,"title":1},"147":{"body":24,"breadcrumbs":6,"title":4},"148":{"body":25,"breadcrumbs":4,"title":2},"149":{"body":18,"breadcrumbs":7,"title":5},"15":{"body":93,"breadcrumbs":4,"title":2},"150":{"body":13,"breadcrumbs":6,"title":4},"151":{"body":9,"breadcrumbs":8,"title":6},"152":{"body":36,"breadcrumbs":7,"title":5},"153":{"body":20,"breadcrumbs":7,"title":5},"154":{"body":214,"breadcrumbs":6,"title":4},"155":{"body":57,"breadcrumbs":4,"title":2},"156":{"body":0,"breadcrumbs":4,"title":2},"157":{"body":27,"breadcrumbs":6,"title":4},"158":{"body":0,"breadcrumbs":3,"title":1},"159":{"body":15,"breadcrumbs":3,"title":1},"16":{"body":62,"breadcrumbs":3,"title":1},"160":{"body":12,"breadcrumbs":3,"title":1},"161":{"body":16,"breadcrumbs":8,"title":6},"162":{"body":0,"breadcrumbs":3,"title":1},"163":{"body":11,"breadcrumbs":3,"title":1},"164":{"body":16,"breadcrumbs":3,"title":1},"165":{"body":9,"breadcrumbs":3,"title":1},"166":{"body":15,"breadcrumbs":3,"title":1},"167":{"body":0,"breadcrumbs":3,"title":1},"168":{"body":19,"breadcrumbs":6,"title":4},"169":{"body":18,"breadcrumbs":5,"title":3},"17":{"body":69,"breadcrumbs":5,"title":3},"170":{"body":11,"breadcrumbs":3,"title":1},"171":{"body":31,"breadcrumbs":3,"title":1},"172":{"body":37,"breadcrumbs":5,"title":3},"173":{"body":40,"breadcrumbs":4,"title":2},"174":{"body":30,"breadcrumbs":4,"title":2},"175":{"body":10,"breadcrumbs":4,"title":2},"176":{"body":105,"breadcrumbs":4,"title":2},"177":{"body":41,"breadcrumbs":3,"title":1},"178":{"body":18,"breadcrumbs":3,"title":1},"179":{"body":48,"breadcrumbs":4,"title":2},"18":{"body":0,"breadcrumbs":3,"title":1},"180":{"body":11,"breadcrumbs":3,"title":1},"181":{"body":22,"breadcrumbs":4,"title":2},"182":{"body":20,"breadcrumbs":4,"title":2},"183":{"body":32,"breadcrumbs":3,"title":1},"184":{"body":38,"breadcrumbs":4,"title":2},"185":{"body":89,"breadcrumbs":4,"title":2},"186":{"body":30,"breadcrumbs":6,"title":4},"187":{"body":63,"breadcrumbs":6,"title":4},"188":{"body":22,"breadcrumbs":3,"title":1},"189":{"body":0,"breadcrumbs":3,"title":1},"19":{"body":0,"breadcrumbs":3,"title":1},"190":{"body":33,"breadcrumbs":5,"title":3},"191":{"body":9,"breadcrumbs":4,"title":2},"192":{"body":37,"breadcrumbs":5,"title":3},"193":{"body":31,"breadcrumbs":5,"title":3},"194":{"body":57,"breadcrumbs":3,"title":1},"195":{"body":2,"breadcrumbs":3,"title":1},"196":{"body":91,"breadcrumbs":7,"title":5},"197":{"body":8,"breadcrumbs":3,"title":1},"198":{"body":0,"breadcrumbs":4,"title":2},"199":{"body":86,"breadcrumbs":7,"title":5},"2":{"body":0,"breadcrumbs":3,"title":1},"20":{"body":16,"breadcrumbs":3,"title":1},"200":{"body":0,"breadcrumbs":3,"title":1},"201":{"body":20,"breadcrumbs":3,"title":1},"202":{"body":28,"breadcrumbs":3,"title":1},"203":{"body":52,"breadcrumbs":3,"title":1},"204":{"body":45,"breadcrumbs":3,"title":1},"205":{"body":0,"breadcrumbs":3,"title":1},"206":{"body":52,"breadcrumbs":4,"title":2},"207":{"body":43,"breadcrumbs":4,"title":2},"208":{"body":9,"breadcrumbs":4,"title":2},"209":{"body":10,"breadcrumbs":4,"title":2},"21":{"body":83,"breadcrumbs":3,"title":1},"210":{"body":54,"breadcrumbs":6,"title":4},"211":{"body":23,"breadcrumbs":4,"title":2},"212":{"body":43,"breadcrumbs":5,"title":3},"213":{"body":64,"breadcrumbs":3,"title":1},"214":{"body":75,"breadcrumbs":7,"title":5},"215":{"body":7,"breadcrumbs":6,"title":3},"216":{"body":102,"breadcrumbs":5,"title":1},"217":{"body":0,"breadcrumbs":5,"title":1},"218":{"body":10,"breadcrumbs":6,"title":2},"219":{"body":21,"breadcrumbs":7,"title":3},"22":{"body":92,"breadcrumbs":3,"title":1},"220":{"body":9,"breadcrumbs":8,"title":4},"221":{"body":10,"breadcrumbs":8,"title":4},"222":{"body":4,"breadcrumbs":9,"title":5},"223":{"body":17,"breadcrumbs":9,"title":5},"224":{"body":52,"breadcrumbs":5,"title":1},"225":{"body":28,"breadcrumbs":5,"title":1},"226":{"body":26,"breadcrumbs":5,"title":1},"227":{"body":50,"breadcrumbs":8,"title":4},"228":{"body":6,"breadcrumbs":6,"title":2},"229":{"body":25,"breadcrumbs":5,"title":1},"23":{"body":38,"breadcrumbs":4,"title":2},"230":{"body":14,"breadcrumbs":7,"title":3},"231":{"body":122,"breadcrumbs":5,"title":1},"232":{"body":13,"breadcrumbs":8,"title":4},"233":{"body":7,"breadcrumbs":8,"title":4},"234":{"body":15,"breadcrumbs":8,"title":4},"235":{"body":27,"breadcrumbs":5,"title":1},"236":{"body":6,"breadcrumbs":5,"title":1},"237":{"body":6,"breadcrumbs":4,"title":2},"238":{"body":6,"breadcrumbs":4,"title":1},"239":{"body":135,"breadcrumbs":4,"title":1},"24":{"body":26,"breadcrumbs":3,"title":1},"240":{"body":26,"breadcrumbs":4,"title":1},"241":{"body":27,"breadcrumbs":4,"title":1},"242":{"body":11,"breadcrumbs":4,"title":1},"243":{"body":195,"breadcrumbs":4,"title":1},"244":{"body":80,"breadcrumbs":6,"title":3},"245":{"body":37,"breadcrumbs":5,"title":2},"246":{"body":41,"breadcrumbs":9,"title":6},"247":{"body":46,"breadcrumbs":8,"title":5},"248":{"body":0,"breadcrumbs":4,"title":1},"249":{"body":15,"breadcrumbs":7,"title":4},"25":{"body":16,"breadcrumbs":5,"title":3},"250":{"body":17,"breadcrumbs":7,"title":4},"251":{"body":0,"breadcrumbs":4,"title":1},"252":{"body":57,"breadcrumbs":8,"title":5},"253":{"body":78,"breadcrumbs":7,"title":4},"254":{"body":51,"breadcrumbs":4,"title":1},"255":{"body":43,"breadcrumbs":4,"title":1},"256":{"body":145,"breadcrumbs":4,"title":1},"257":{"body":33,"breadcrumbs":7,"title":4},"258":{"body":5,"breadcrumbs":2,"title":1},"259":{"body":45,"breadcrumbs":3,"title":1},"26":{"body":36,"breadcrumbs":4,"title":2},"260":{"body":34,"breadcrumbs":5,"title":3},"261":{"body":76,"breadcrumbs":5,"title":3},"262":{"body":19,"breadcrumbs":3,"title":1},"263":{"body":6,"breadcrumbs":5,"title":3},"264":{"body":7,"breadcrumbs":5,"title":3},"265":{"body":11,"breadcrumbs":4,"title":2},"266":{"body":15,"breadcrumbs":7,"title":5},"267":{"body":55,"breadcrumbs":3,"title":1},"268":{"body":49,"breadcrumbs":3,"title":1},"269":{"body":8,"breadcrumbs":4,"title":2},"27":{"body":64,"breadcrumbs":5,"title":3},"270":{"body":101,"breadcrumbs":6,"title":4},"271":{"body":20,"breadcrumbs":6,"title":4},"272":{"body":7,"breadcrumbs":3,"title":1},"273":{"body":12,"breadcrumbs":2,"title":1},"274":{"body":0,"breadcrumbs":3,"title":1},"275":{"body":8,"breadcrumbs":4,"title":2},"276":{"body":10,"breadcrumbs":4,"title":2},"277":{"body":53,"breadcrumbs":4,"title":2},"278":{"body":8,"breadcrumbs":3,"title":1},"279":{"body":14,"breadcrumbs":4,"title":2},"28":{"body":35,"breadcrumbs":3,"title":1},"280":{"body":496,"breadcrumbs":6,"title":4},"281":{"body":77,"breadcrumbs":4,"title":2},"282":{"body":8,"breadcrumbs":4,"title":2},"283":{"body":93,"breadcrumbs":6,"title":4},"284":{"body":141,"breadcrumbs":6,"title":4},"285":{"body":69,"breadcrumbs":7,"title":5},"286":{"body":248,"breadcrumbs":5,"title":3},"287":{"body":208,"breadcrumbs":7,"title":5},"288":{"body":314,"breadcrumbs":6,"title":4},"289":{"body":231,"breadcrumbs":7,"title":5},"29":{"body":58,"breadcrumbs":4,"title":2},"290":{"body":127,"breadcrumbs":5,"title":3},"291":{"body":0,"breadcrumbs":3,"title":1},"292":{"body":62,"breadcrumbs":5,"title":3},"293":{"body":34,"breadcrumbs":5,"title":3},"294":{"body":0,"breadcrumbs":3,"title":1},"295":{"body":0,"breadcrumbs":3,"title":1},"296":{"body":41,"breadcrumbs":3,"title":1},"297":{"body":18,"breadcrumbs":4,"title":2},"298":{"body":25,"breadcrumbs":4,"title":2},"299":{"body":0,"breadcrumbs":3,"title":1},"3":{"body":96,"breadcrumbs":3,"title":1},"30":{"body":123,"breadcrumbs":3,"title":1},"300":{"body":104,"breadcrumbs":4,"title":2},"301":{"body":10,"breadcrumbs":4,"title":2},"302":{"body":0,"breadcrumbs":3,"title":1},"303":{"body":16,"breadcrumbs":5,"title":3},"304":{"body":89,"breadcrumbs":5,"title":3},"305":{"body":28,"breadcrumbs":4,"title":2},"306":{"body":0,"breadcrumbs":3,"title":1},"307":{"body":27,"breadcrumbs":5,"title":3},"308":{"body":0,"breadcrumbs":5,"title":3},"309":{"body":36,"breadcrumbs":4,"title":2},"31":{"body":66,"breadcrumbs":3,"title":1},"310":{"body":81,"breadcrumbs":4,"title":2},"311":{"body":14,"breadcrumbs":5,"title":3},"312":{"body":20,"breadcrumbs":3,"title":1},"313":{"body":0,"breadcrumbs":4,"title":2},"314":{"body":14,"breadcrumbs":4,"title":2},"315":{"body":12,"breadcrumbs":4,"title":2},"316":{"body":16,"breadcrumbs":3,"title":1},"317":{"body":17,"breadcrumbs":4,"title":2},"318":{"body":12,"breadcrumbs":3,"title":1},"319":{"body":9,"breadcrumbs":3,"title":1},"32":{"body":0,"breadcrumbs":3,"title":1},"320":{"body":23,"breadcrumbs":4,"title":2},"321":{"body":30,"breadcrumbs":4,"title":2},"322":{"body":22,"breadcrumbs":4,"title":2},"323":{"body":0,"breadcrumbs":3,"title":1},"324":{"body":75,"breadcrumbs":5,"title":3},"325":{"body":43,"breadcrumbs":9,"title":7},"326":{"body":0,"breadcrumbs":3,"title":1},"327":{"body":38,"breadcrumbs":4,"title":2},"328":{"body":30,"breadcrumbs":4,"title":2},"329":{"body":128,"breadcrumbs":7,"title":5},"33":{"body":19,"breadcrumbs":4,"title":2},"330":{"body":246,"breadcrumbs":5,"title":3},"331":{"body":422,"breadcrumbs":6,"title":3},"332":{"body":278,"breadcrumbs":6,"title":3},"333":{"body":17,"breadcrumbs":4,"title":1},"334":{"body":0,"breadcrumbs":3,"title":1},"335":{"body":59,"breadcrumbs":4,"title":2},"336":{"body":45,"breadcrumbs":5,"title":3},"337":{"body":43,"breadcrumbs":4,"title":2},"338":{"body":28,"breadcrumbs":4,"title":2},"339":{"body":8,"breadcrumbs":3,"title":1},"34":{"body":19,"breadcrumbs":3,"title":1},"340":{"body":98,"breadcrumbs":3,"title":1},"341":{"body":140,"breadcrumbs":3,"title":1},"342":{"body":49,"breadcrumbs":6,"title":4},"343":{"body":273,"breadcrumbs":3,"title":1},"344":{"body":225,"breadcrumbs":3,"title":1},"345":{"body":8,"breadcrumbs":2,"title":1},"346":{"body":0,"breadcrumbs":3,"title":1},"347":{"body":80,"breadcrumbs":3,"title":1},"348":{"body":13,"breadcrumbs":6,"title":4},"349":{"body":31,"breadcrumbs":6,"title":4},"35":{"body":25,"breadcrumbs":4,"title":2},"350":{"body":46,"breadcrumbs":3,"title":1},"351":{"body":4,"breadcrumbs":3,"title":1},"352":{"body":27,"breadcrumbs":3,"title":1},"353":{"body":77,"breadcrumbs":5,"title":3},"354":{"body":87,"breadcrumbs":5,"title":3},"355":{"body":0,"breadcrumbs":4,"title":2},"356":{"body":48,"breadcrumbs":4,"title":2},"357":{"body":18,"breadcrumbs":4,"title":2},"358":{"body":43,"breadcrumbs":3,"title":1},"359":{"body":64,"breadcrumbs":3,"title":1},"36":{"body":28,"breadcrumbs":5,"title":3},"360":{"body":154,"breadcrumbs":7,"title":5},"361":{"body":36,"breadcrumbs":7,"title":5},"362":{"body":0,"breadcrumbs":3,"title":1},"363":{"body":7,"breadcrumbs":6,"title":4},"364":{"body":59,"breadcrumbs":5,"title":3},"365":{"body":42,"breadcrumbs":6,"title":4},"366":{"body":6,"breadcrumbs":4,"title":2},"367":{"body":62,"breadcrumbs":4,"title":2},"368":{"body":59,"breadcrumbs":3,"title":1},"369":{"body":30,"breadcrumbs":5,"title":3},"37":{"body":95,"breadcrumbs":3,"title":1},"370":{"body":166,"breadcrumbs":5,"title":3},"371":{"body":78,"breadcrumbs":6,"title":4},"372":{"body":6,"breadcrumbs":5,"title":3},"373":{"body":41,"breadcrumbs":5,"title":3},"374":{"body":34,"breadcrumbs":5,"title":3},"375":{"body":3,"breadcrumbs":3,"title":1},"376":{"body":75,"breadcrumbs":3,"title":1},"377":{"body":4,"breadcrumbs":5,"title":3},"378":{"body":50,"breadcrumbs":7,"title":5},"379":{"body":29,"breadcrumbs":5,"title":3},"38":{"body":8,"breadcrumbs":4,"title":2},"380":{"body":96,"breadcrumbs":4,"title":2},"381":{"body":94,"breadcrumbs":5,"title":3},"382":{"body":66,"breadcrumbs":6,"title":4},"383":{"body":4,"breadcrumbs":5,"title":3},"384":{"body":13,"breadcrumbs":6,"title":4},"385":{"body":5,"breadcrumbs":5,"title":3},"386":{"body":16,"breadcrumbs":5,"title":3},"387":{"body":51,"breadcrumbs":4,"title":2},"388":{"body":31,"breadcrumbs":6,"title":4},"389":{"body":22,"breadcrumbs":5,"title":3},"39":{"body":8,"breadcrumbs":4,"title":2},"390":{"body":51,"breadcrumbs":3,"title":1},"391":{"body":29,"breadcrumbs":5,"title":3},"392":{"body":26,"breadcrumbs":9,"title":7},"393":{"body":5,"breadcrumbs":2,"title":1},"394":{"body":0,"breadcrumbs":3,"title":1},"395":{"body":64,"breadcrumbs":3,"title":1},"396":{"body":0,"breadcrumbs":3,"title":1},"397":{"body":17,"breadcrumbs":6,"title":4},"398":{"body":92,"breadcrumbs":4,"title":2},"399":{"body":0,"breadcrumbs":3,"title":1},"4":{"body":88,"breadcrumbs":3,"title":1},"40":{"body":12,"breadcrumbs":4,"title":2},"400":{"body":38,"breadcrumbs":6,"title":4},"401":{"body":5,"breadcrumbs":5,"title":2},"402":{"body":31,"breadcrumbs":7,"title":4},"403":{"body":41,"breadcrumbs":5,"title":2},"404":{"body":29,"breadcrumbs":5,"title":2},"405":{"body":5,"breadcrumbs":4,"title":1},"406":{"body":60,"breadcrumbs":3,"title":1},"407":{"body":13,"breadcrumbs":3,"title":1},"408":{"body":10,"breadcrumbs":8,"title":6},"409":{"body":54,"breadcrumbs":8,"title":6},"41":{"body":0,"breadcrumbs":4,"title":2},"410":{"body":31,"breadcrumbs":6,"title":4},"411":{"body":140,"breadcrumbs":7,"title":5},"412":{"body":1,"breadcrumbs":7,"title":5},"413":{"body":3,"breadcrumbs":2,"title":1},"414":{"body":0,"breadcrumbs":3,"title":1},"415":{"body":19,"breadcrumbs":4,"title":2},"416":{"body":55,"breadcrumbs":6,"title":4},"417":{"body":128,"breadcrumbs":5,"title":3},"418":{"body":50,"breadcrumbs":4,"title":2},"419":{"body":0,"breadcrumbs":5,"title":3},"42":{"body":10,"breadcrumbs":2,"title":0},"420":{"body":120,"breadcrumbs":6,"title":4},"421":{"body":154,"breadcrumbs":6,"title":4},"422":{"body":360,"breadcrumbs":5,"title":3},"423":{"body":0,"breadcrumbs":3,"title":1},"424":{"body":87,"breadcrumbs":3,"title":1},"425":{"body":0,"breadcrumbs":3,"title":1},"426":{"body":236,"breadcrumbs":6,"title":4},"427":{"body":4,"breadcrumbs":2,"title":1},"428":{"body":21,"breadcrumbs":3,"title":1},"429":{"body":0,"breadcrumbs":3,"title":1},"43":{"body":14,"breadcrumbs":3,"title":1},"430":{"body":62,"breadcrumbs":5,"title":3},"431":{"body":15,"breadcrumbs":4,"title":2},"432":{"body":102,"breadcrumbs":4,"title":2},"433":{"body":14,"breadcrumbs":6,"title":4},"434":{"body":40,"breadcrumbs":4,"title":2},"435":{"body":52,"breadcrumbs":3,"title":1},"436":{"body":116,"breadcrumbs":4,"title":2},"437":{"body":17,"breadcrumbs":5,"title":3},"438":{"body":0,"breadcrumbs":5,"title":3},"439":{"body":40,"breadcrumbs":5,"title":3},"44":{"body":4,"breadcrumbs":3,"title":1},"440":{"body":23,"breadcrumbs":5,"title":3},"441":{"body":14,"breadcrumbs":5,"title":3},"442":{"body":15,"breadcrumbs":5,"title":3},"443":{"body":29,"breadcrumbs":3,"title":1},"444":{"body":31,"breadcrumbs":5,"title":3},"445":{"body":0,"breadcrumbs":5,"title":3},"446":{"body":44,"breadcrumbs":6,"title":4},"447":{"body":17,"breadcrumbs":5,"title":3},"448":{"body":13,"breadcrumbs":5,"title":3},"449":{"body":20,"breadcrumbs":5,"title":3},"45":{"body":5,"breadcrumbs":3,"title":1},"450":{"body":94,"breadcrumbs":4,"title":2},"451":{"body":53,"breadcrumbs":3,"title":1},"452":{"body":14,"breadcrumbs":3,"title":1},"453":{"body":0,"breadcrumbs":3,"title":1},"454":{"body":40,"breadcrumbs":5,"title":3},"455":{"body":52,"breadcrumbs":6,"title":4},"456":{"body":0,"breadcrumbs":4,"title":2},"457":{"body":18,"breadcrumbs":5,"title":3},"458":{"body":38,"breadcrumbs":4,"title":2},"459":{"body":0,"breadcrumbs":3,"title":1},"46":{"body":11,"breadcrumbs":3,"title":1},"460":{"body":47,"breadcrumbs":3,"title":1},"461":{"body":18,"breadcrumbs":3,"title":1},"462":{"body":18,"breadcrumbs":4,"title":2},"463":{"body":0,"breadcrumbs":7,"title":5},"464":{"body":35,"breadcrumbs":5,"title":3},"465":{"body":8,"breadcrumbs":5,"title":3},"466":{"body":3,"breadcrumbs":5,"title":3},"467":{"body":27,"breadcrumbs":3,"title":1},"468":{"body":52,"breadcrumbs":4,"title":2},"469":{"body":36,"breadcrumbs":5,"title":3},"47":{"body":24,"breadcrumbs":3,"title":1},"470":{"body":141,"breadcrumbs":4,"title":2},"471":{"body":30,"breadcrumbs":3,"title":1},"472":{"body":10,"breadcrumbs":3,"title":1},"473":{"body":0,"breadcrumbs":3,"title":1},"474":{"body":23,"breadcrumbs":5,"title":3},"475":{"body":8,"breadcrumbs":4,"title":2},"476":{"body":55,"breadcrumbs":4,"title":2},"477":{"body":0,"breadcrumbs":4,"title":2},"478":{"body":18,"breadcrumbs":5,"title":3},"479":{"body":50,"breadcrumbs":4,"title":2},"48":{"body":24,"breadcrumbs":3,"title":1},"480":{"body":96,"breadcrumbs":3,"title":1},"481":{"body":0,"breadcrumbs":7,"title":5},"482":{"body":44,"breadcrumbs":5,"title":3},"483":{"body":11,"breadcrumbs":5,"title":3},"484":{"body":3,"breadcrumbs":5,"title":3},"485":{"body":26,"breadcrumbs":3,"title":1},"486":{"body":65,"breadcrumbs":4,"title":2},"487":{"body":19,"breadcrumbs":5,"title":3},"488":{"body":165,"breadcrumbs":4,"title":2},"489":{"body":21,"breadcrumbs":3,"title":1},"49":{"body":185,"breadcrumbs":5,"title":3},"490":{"body":9,"breadcrumbs":3,"title":1},"491":{"body":4,"breadcrumbs":3,"title":1},"492":{"body":55,"breadcrumbs":5,"title":3},"493":{"body":143,"breadcrumbs":4,"title":2},"494":{"body":9,"breadcrumbs":3,"title":1},"5":{"body":79,"breadcrumbs":3,"title":1},"50":{"body":24,"breadcrumbs":3,"title":1},"51":{"body":74,"breadcrumbs":4,"title":2},"52":{"body":37,"breadcrumbs":3,"title":1},"53":{"body":19,"breadcrumbs":3,"title":1},"54":{"body":19,"breadcrumbs":3,"title":1},"55":{"body":86,"breadcrumbs":4,"title":2},"56":{"body":119,"breadcrumbs":3,"title":1},"57":{"body":128,"breadcrumbs":3,"title":1},"58":{"body":24,"breadcrumbs":4,"title":2},"59":{"body":0,"breadcrumbs":3,"title":1},"6":{"body":79,"breadcrumbs":4,"title":2},"60":{"body":23,"breadcrumbs":4,"title":2},"61":{"body":26,"breadcrumbs":3,"title":1},"62":{"body":7,"breadcrumbs":3,"title":1},"63":{"body":21,"breadcrumbs":3,"title":1},"64":{"body":85,"breadcrumbs":3,"title":1},"65":{"body":44,"breadcrumbs":5,"title":3},"66":{"body":45,"breadcrumbs":3,"title":1},"67":{"body":54,"breadcrumbs":3,"title":1},"68":{"body":58,"breadcrumbs":3,"title":1},"69":{"body":46,"breadcrumbs":5,"title":3},"7":{"body":4,"breadcrumbs":4,"title":2},"70":{"body":65,"breadcrumbs":5,"title":3},"71":{"body":118,"breadcrumbs":3,"title":1},"72":{"body":50,"breadcrumbs":3,"title":1},"73":{"body":64,"breadcrumbs":3,"title":1},"74":{"body":27,"breadcrumbs":3,"title":1},"75":{"body":28,"breadcrumbs":4,"title":2},"76":{"body":18,"breadcrumbs":3,"title":1},"77":{"body":45,"breadcrumbs":4,"title":2},"78":{"body":63,"breadcrumbs":3,"title":1},"79":{"body":29,"breadcrumbs":4,"title":2},"8":{"body":16,"breadcrumbs":4,"title":2},"80":{"body":29,"breadcrumbs":4,"title":2},"81":{"body":108,"breadcrumbs":5,"title":3},"82":{"body":0,"breadcrumbs":3,"title":1},"83":{"body":18,"breadcrumbs":4,"title":2},"84":{"body":7,"breadcrumbs":4,"title":2},"85":{"body":40,"breadcrumbs":4,"title":2},"86":{"body":19,"breadcrumbs":6,"title":4},"87":{"body":13,"breadcrumbs":5,"title":3},"88":{"body":39,"breadcrumbs":4,"title":2},"89":{"body":34,"breadcrumbs":4,"title":2},"9":{"body":48,"breadcrumbs":5,"title":3},"90":{"body":25,"breadcrumbs":7,"title":5},"91":{"body":0,"breadcrumbs":3,"title":1},"92":{"body":74,"breadcrumbs":3,"title":1},"93":{"body":21,"breadcrumbs":4,"title":2},"94":{"body":40,"breadcrumbs":3,"title":1},"95":{"body":50,"breadcrumbs":3,"title":1},"96":{"body":77,"breadcrumbs":3,"title":1},"97":{"body":57,"breadcrumbs":3,"title":1},"98":{"body":51,"breadcrumbs":3,"title":1},"99":{"body":24,"breadcrumbs":3,"title":1}},"docs":{"0":{"body":"A personal collection of notes and cheatsheets. Source code is located at johannst/notes .","breadcrumbs":"Introduction » Notes","id":"0","title":"Notes"},"1":{"body":"zsh bash fish tmux git awk emacs gpg gdb gdbserver radare2 qemu pacman dot ffmpeg column sort sed gnuplot","breadcrumbs":"Tools » Tools","id":"1","title":"Tools"},"10":{"body":"#!/bin/zsh\nfunction test() { zparseopts -D -E -A opts f=flag o: -long: echo \"flag $flag\" echo \"o $opts[-o]\" echo \"long $opts[--long]\" echo \"pos $1\"\n} test -f -o OPTION --long LONG_OPT POSITIONAL # Outputs:\n# flag -f\n# o OPTION\n# long LONG_OPT\n# pos POSITIONAL","breadcrumbs":"Tools » zsh » Example","id":"10","title":"Example"},"100":{"body":"key fn description\n--------------------------------------------- C- set-mark-command set start mark to select text M-w kill-ring-save copy selected text C-w kill-region kill selected text C-y yank paste selected text M-y yank-pop cycle through kill-ring (only after paste)","breadcrumbs":"Tools » emacs » yank/paste","id":"100","title":"yank/paste"},"101":{"body":"key fn description\n------------------------------------------------ C-x r s copy-to-register save region in register C-x r i insert-register insert content of register ","breadcrumbs":"Tools » emacs » register","id":"101","title":"register"},"102":{"body":"key fn description\n------------------------------------------------ C-x rectangle-mark-mode activate rectangle-mark-mode string-rectangle insert text in marked rect","breadcrumbs":"Tools » emacs » block/rect","id":"102","title":"block/rect"},"103":{"body":"key fn description\n------------------------------------------------ C-x h mark-whole-buffer mark whole buffer delete-matching-line delete lines matching regex M-% query-replace search & replace C-M-% query-replace-regexp search & replace regex","breadcrumbs":"Tools » emacs » mass edit","id":"103","title":"mass edit"},"104":{"body":"key fn description\n--------------------------------------------- C-x n n narrow-to-region show only focused region (narrow) C-x n w widen show whole buffer (wide)","breadcrumbs":"Tools » emacs » narrow","id":"104","title":"narrow"},"105":{"body":"key fn description\n------------------------------------ M-up/M-down re-arrange items in same hierarchy M-left/M-right change item hierarchy C-RET create new item below current C-S-RET create new TODO item below current S-left/S-right cycle TODO states","breadcrumbs":"Tools » emacs » org","id":"105","title":"org"},"106":{"body":"key fn description\n------------------------------ get doc for completion condidate M- select completion candidate","breadcrumbs":"Tools » emacs » comapny","id":"107","title":"comapny"},"108":{"body":"To generate etags using ctags ctags -R -e . generate emacs tag file (important `-e`) Navigate using tags key fn description\n----------------------------------------------- xref-find-definitions find definition of tag xref-find-apropos find symbols matching regexp xref-find-references find references of tag","breadcrumbs":"Tools » emacs » tags","id":"108","title":"tags"},"109":{"body":"key fn description\n------------------------------ ielm open interactive elips shell In lisp-interaction-mode (*scratch* buffer by defult) key fn description\n-------------------------------------------------------- C-j eval-print-last-sexp evaluate & print preceeding lisp expr C-x C-e eval-last-sexp evaluate lisp expr C-u C-x C-e eval-last-sexp evaluate & print","breadcrumbs":"Tools » emacs » lisp","id":"109","title":"lisp"},"11":{"body":"Zsh supports regular expression matching with the binary operator =~. The match results can be accessed via the $MATCH variable and $match indexed array: $MATCH contains the full match $match[1] contains match of the first capture group INPUT='title foo : 1234'\nREGEX='^title (.+) : ([0-9]+)$'\nif [[ $INPUT =~ $REGEX ]]; then echo \"$MATCH\" # title foo : 1234 echo \"$match[1]\" # foo echo \"$match[2]\" # 1234\nfi","breadcrumbs":"Tools » zsh » Regular Expressions","id":"11","title":"Regular Expressions"},"110":{"body":"Builtin fuzzy completion mode (eg buffer select, dired, ...). key fn description\n------------------------------------------ ido-mode toggle ido mode / cycle through available competions select completion","breadcrumbs":"Tools » emacs » ido","id":"110","title":"ido"},"111":{"body":"key fn description\n-------------------------- C-z toggle emacs/evil mode C-^ toggle between previous and current buffer C-p after paste cycle kill-ring back C-n after paste cycle kill-ring forward","breadcrumbs":"Tools » emacs » evil","id":"111","title":"evil"},"112":{"body":"key fn description\n-------------------------- i open sub-dir in same buffer + create new directory C copy file/dir q quit","breadcrumbs":"Tools » emacs » dired","id":"112","title":"dired"},"113":{"body":"gpg -o|--output Specify output file -a|--armor Create ascii output -u|--local-user Specify key for signing -r|--recipient Encrypt for user","breadcrumbs":"Tools » gpg » gpg(1)","id":"113","title":"gpg(1)"},"114":{"body":"gpg --full-generate-key","breadcrumbs":"Tools » gpg » Generate new keypair","id":"114","title":"Generate new keypair"},"115":{"body":"gpg -k / --list-key # public keys\ngpg -K / --list-secret-keys # secret keys","breadcrumbs":"Tools » gpg » List keys","id":"115","title":"List keys"},"116":{"body":"gpg --edit-key Gives prompt to modify KEY ID, common commands: help show help\nsave save & quit list list keys and user IDs\nkey select subkey \nuid select user ID expire change expiration of selected key adduid add user ID\ndeluid delete selected user ID addkey add subkey\ndelkey delete selected subkey","breadcrumbs":"Tools » gpg » Edit keys","id":"116","title":"Edit keys"},"117":{"body":"gpg --export --armor --output \ngpg --export-secret-key --armor --output \ngpg --import ","breadcrumbs":"Tools » gpg » Export & Import Keys","id":"117","title":"Export & Import Keys"},"118":{"body":"gpg --keyserver --send-keys \ngpg --keyserver --search-keys ","breadcrumbs":"Tools » gpg » Search & Send keys","id":"118","title":"Search & Send keys"},"119":{"body":"Encrypt file using passphrase and write encrypted data to .gpg. gpg --symmetric # Decrypt using passphrase\ngpg -o --decrypt .gpg","breadcrumbs":"Tools » gpg » Encrypt (passphrase)","id":"119","title":"Encrypt (passphrase)"},"12":{"body":"","breadcrumbs":"Tools » zsh » Completion","id":"12","title":"Completion"},"120":{"body":"Encrypt file with public key of specified recipient and write encrypted data to .gpg. gpg --encrypt -r foo@bar.de # Decrypt at foos side (private key required)\ngpg -o --decrypt .gpg","breadcrumbs":"Tools » gpg » Encrypt (public key)","id":"120","title":"Encrypt (public key)"},"121":{"body":"Generate a signed file and write to .gpg. # Sign with private key of foo@bar.de\ngpg --sign -u foor@bar.de # Verify with public key of foo@bar.de\ngpg --verify # Extract content from signed file\ngpg -o --decrypt .gpg Without -u use first private key in list gpg -K for signing. Files can also be signed and encrypted at once, gpg will first sign the file and then encrypt it. gpg --sign --encrypt -r ","breadcrumbs":"Tools » gpg » Signing","id":"121","title":"Signing"},"122":{"body":"Generate a detached signature and write to .asc. Send .asc along with when distributing. gpg --detach-sign --armor -u foor@bar.de # Verify\ngpg --verify .asc Without -u use first private key in list gpg -K for signing.","breadcrumbs":"Tools » gpg » Signing (detached)","id":"122","title":"Signing (detached)"},"123":{"body":"sec secret key ssb secret subkey pub public key sub public subkey Key usage flags: [S] signing [C] create certificates [E] encrypting [A] authentication","breadcrumbs":"Tools » gpg » Abbreviations","id":"123","title":"Abbreviations"},"124":{"body":"http://pgp.mit.edu http://keyserver.ubuntu.com hkps://pgp.mailbox.org","breadcrumbs":"Tools » gpg » Keyservers","id":"124","title":"Keyservers"},"125":{"body":"","breadcrumbs":"Tools » gpg » Examples","id":"125","title":"Examples"},"126":{"body":"gpg --keyid-format 0xlong ","breadcrumbs":"Tools » gpg » List basic key information from file with long keyids","id":"126","title":"List basic key information from file with long keyids"},"127":{"body":"gpg --edit-key # By default we are on the primary key, can switch to sub key.\ngpg> key 1 # Update the expire date.\ngpg> expire gpg> save # Update keyserver(s) and/or export new pub keyfile.","breadcrumbs":"Tools » gpg » Extend expiring key","id":"127","title":"Extend expiring key"},"128":{"body":"","breadcrumbs":"Tools » gdb » gdb(1)","id":"128","title":"gdb(1)"},"129":{"body":"gdb [opts] [prg [-c coredump | -p pid]] gdb [opts] --args prg opts: -p attach to pid -c use -x execute script before prompt -ex execute command before prompt --tty set I/O tty for debugee --batch run in batch mode, exit after processing options (eg used for scripting) --batch-silent link --batch, but surpress gdb stdout","breadcrumbs":"Tools » gdb » CLI","id":"129","title":"CLI"},"13":{"body":"Completion functions are provided via files and need to be placed in a location covered by $fpath. By convention the completion files are names as _. A completion skeleton for the command foo, stored in _foo #compdef _foo foo function _foo() { ...\n} Alternatively one can install a completion function explicitly by calling compdef .","breadcrumbs":"Tools » zsh » Installation","id":"13","title":"Installation"},"130":{"body":"","breadcrumbs":"Tools » gdb » Interactive usage","id":"130","title":"Interactive usage"},"131":{"body":"apropos Search commands matching regex. tty Set as tty for debugee. Make sure nobody reads from target tty, easiest is to spawn a shell and run following in target tty: > while true; do sleep 1024; done sharedlibrary [] Load symbols of shared libs loaded by debugee. Optionally use to filter libs for symbol loading. display [/FMT] Print every time debugee stops. Eg print next instr, see examples below. undisplay [] Delete display expressions either all or one referenced by . info display List display expressions. info sharedlibrary [] List shared libraries loaded. Optionally use to filter.","breadcrumbs":"Tools » gdb » Misc","id":"131","title":"Misc"},"132":{"body":"break [-qualified] thread Set a breakpoint only for a specific thread. -qualified: Treat as fully qualified symbol (quiet handy to set breakpoints on C symbols in C++ contexts) break if Set conditional breakpoint (see examples below). delete [] Delete breakpoint either all or one referenced by . info break List breakpoints. cond Make existing breakpoint conditional with . cond Remove condition from breakpoint . tbreak Set temporary breakpoint, will be deleted when hit. Same syntax as `break`. rbreak Set breakpoints matching , where matching internally is done on: .*.* command [] Define commands to run after breakpoint hit. If is not specified attach command to last created breakpoint. Command block terminated with 'end' token. : Space separates list, eg 'command 2 5-8' to run command for breakpoints: 2,5,6,7,8. save break Save breakpoints to . Can be loaded with the `source` command.","breadcrumbs":"Tools » gdb » Breakpoints","id":"132","title":"Breakpoints"},"133":{"body":"watch [-location|-l] [thread ] Create a watchpoint for , will break if is written to. Watchpoints respect scope of variables, -l can be used to watch the memory location instead. rwatch ... Sets a read watchpoint, will break if is read from. awatch ... Sets an access watchpoint, will break if is written to or read from.","breadcrumbs":"Tools » gdb » Watchpoints","id":"133","title":"Watchpoints"},"134":{"body":"catch load [] Stop when shared libraries are loaded, optionally specify a to stop only on matches. catch unload [] Stop when shared libraries are unloaded, optionally specify a to stop only on matches. catch throw Stop when an exception is thrown. catch rethrow Stop when an exception is rethrown. catch catch Stop when an exception is caught. catch fork Stop at calls to fork (also stops at clones, as some systems implement fork via clone). catch syscall [ ..] Stop at syscall. If no argument is given, stop at all syscalls. Optionally give a list of syscalls to stop at.","breadcrumbs":"Tools » gdb » Catchpoints","id":"134","title":"Catchpoints"},"135":{"body":"info functions [] List functions matching . List all functions if no provided. info variables [] List variables matching . List all variables if no provided. info register [ ..] Dump content of all registers or only the specified ister.","breadcrumbs":"Tools » gdb » Inspection","id":"135","title":"Inspection"},"136":{"body":"info handle [] Print how to handle . If no specified print for all signals. handle Configure how gdb handles sent to debugee. : stop/nostop Catch signal in gdb and break. print/noprint Print message when gdb catches signal. pass/nopass Pass signal down to debugee. catch signal Create a catchpoint for .","breadcrumbs":"Tools » gdb » Signal handling","id":"136","title":"Signal handling"},"137":{"body":"info thread List all threads. thread apply [] Run command on all threads listed by (space separated list). When 'all' is specified as the is run on all threads. thread name The for the current thread.","breadcrumbs":"Tools » gdb » Multi-threading","id":"137","title":"Multi-threading"},"138":{"body":"set follow-fork-mode Specify which process to follow when debuggee makes a fork(2) syscall. set detach-on-fork Turn on/off detaching from new child processes (on by default). Turning this off allows to debug multiple processes (inferiors) with one gdb session. info inferiors List all processes gdb debugs. inferior Switch to inferior with .","breadcrumbs":"Tools » gdb » Multi-process","id":"138","title":"Multi-process"},"139":{"body":"set schedule-multiple on: Resume all threads of all processes (inferiors) when continuing or stepping. off: (default) Resume only threads of current process (inferior).","breadcrumbs":"Tools » gdb » Scheduling","id":"139","title":"Scheduling"},"14":{"body":"Following variables are available in Completion functions: $words # array with command line in words\n$#words # number words\n$CURRENT # index into $words for cursor position\n$words[CURRENT-1] # previous word (relative to cursor position)","breadcrumbs":"Tools » zsh » Completion Variables","id":"14","title":"Completion Variables"},"140":{"body":"shell Run the shell_cmd and print the output, can also contain a pipeline. pipe | Evaluate the gdb_cmd and run the shell_cmd which receives the output of the gdb_cmd via stdin.","breadcrumbs":"Tools » gdb » Shell commands","id":"140","title":"Shell commands"},"141":{"body":"dir Add to the beginning of the searh path for source files. show dir Show current search path. set substitute-path Add substitution rule checked during source file lookup. show substitute-path Show current substitution rules.","breadcrumbs":"Tools » gdb » Source file locations","id":"141","title":"Source file locations"},"142":{"body":"set disassembly-flavor Set the disassembly style \"flavor\". set pagination Turn on/off gdb's pagination. set breakpoint pending on: always set pending breakpoints. off: error when trying to set pending breakpoints. auto: interatively query user to set breakpoint. set print pretty Turn on/off pertty printing of structures. set style enabled Turn on/off styling (eg colored output). set logging Enable output logging to file (default gdb.txt). set logging file Change output log file to set logging redirect on: only log to file. off: log to file and tty. set logging overwrite on: Truncate log file on each run. off: Append to logfile (default). set history filename Change file where to save and restore command history to and from. set history Enable or disable saving of command history. Logging options should be configured before logging is turned on.","breadcrumbs":"Tools » gdb » Configuration","id":"142","title":"Configuration"},"143":{"body":"C-x a Toggle UI. C-l Redraw UI (curses UI can be messed up after the debugee prints to stdout/stderr). C-x o Change focus.","breadcrumbs":"Tools » gdb » Text user interface (TUI)","id":"143","title":"Text user interface (TUI)"},"144":{"body":"Gdb allows to create & document user commands as follows: define # cmds end document # docu end To get all user commands or documentations one can use: help user-defined help ","breadcrumbs":"Tools » gdb » User commands (macros)","id":"144","title":"User commands (macros)"},"145":{"body":"Gdb allows to create two types of command hooks hook- will be run before hookpost- will be run after define hook- # cmds end define hookpost- # cmds end","breadcrumbs":"Tools » gdb » Hooks","id":"145","title":"Hooks"},"146":{"body":"","breadcrumbs":"Tools » gdb » Examples","id":"146","title":"Examples"},"147":{"body":"When ever the debugee stops automatically print the memory at the current instruction pointer ($rip x86) and format as instruction /i. # rip - x86 display /i $rip # step instruction, after the step the next instruction is automatically printed si","breadcrumbs":"Tools » gdb » Automatically print next instr","id":"147","title":"Automatically print next instr"},"148":{"body":"Create conditional breakpoints for a function void foo(int i) in the debugee. # Create conditional breakpoint b foo if i == 42 b foo # would create bp 2 # Make existing breakpoint conditional cond 2 i == 7","breadcrumbs":"Tools » gdb » Conditional breakpoints","id":"148","title":"Conditional breakpoints"},"149":{"body":"Create conditional breakpoint using the $_thread convenience variable . # Create conditional breakpoint on all threads except thread 12. b foo if $_thread != 12","breadcrumbs":"Tools » gdb » Set breakpoint on all threads except one","id":"149","title":"Set breakpoint on all threads except one"},"15":{"body":"_describe simple completion, just words + description _arguments sophisticated completion, allow to specify actions Completion with _describe _describe MSG COMP MSG simple string with header message COMP array of completions where each entry is \"opt:description\" function _foo() { local -a opts opts=('bla:desc for bla' 'blu:desc for blu') _describe 'foo-msg' opts\n}\ncompdef _foo foo foo -- foo-msg --\nbla -- desc for bla\nblu -- desc for blu Completion with _arguments _arguments SPEC [SPEC...] where SPEC can have one of the following forms: OPT[DESC]:MSG:ACTION for option flags N:MSG:ACTION for positional arguments Available actions (op1 op2) list possible matches\n->VAL set $state=VAL and continue, `$state` can be checked later in switch case\nFUNC call func to generate matches\n{STR} evaluate `STR` to generate matches","breadcrumbs":"Tools » zsh » Completion Functions","id":"15","title":"Completion Functions"},"150":{"body":"This creates a catchpoint for the SIGSEGV signal and attached the command to it. catch signal SIGSEGV command bt c end","breadcrumbs":"Tools » gdb » Catch SIGSEGV and execute commands","id":"150","title":"Catch SIGSEGV and execute commands"},"151":{"body":"gdb --batch -ex 'thread 1' -ex 'bt' -p ","breadcrumbs":"Tools » gdb » Run backtrace on thread 1 (batch mode)","id":"151","title":"Run backtrace on thread 1 (batch mode)"},"152":{"body":"To script gdb add commands into a file and pass it to gdb via -x. For example create run.gdb: set pagination off break mmap command info reg rdi rsi rdx bt c end #initial drop c This script can be used as: gdb --batch -x ./run.gdb -p ","breadcrumbs":"Tools » gdb » Script gdb for automating debugging sessions","id":"152","title":"Script gdb for automating debugging sessions"},"153":{"body":"define break-save save breakpoint $arg0.gdb.bp\nend\ndefine break-load source $arg0.gdb.bp\nend define hook-quit break-save quit\nend","breadcrumbs":"Tools » gdb » Hook to automatically save breakpoints on quit","id":"153","title":"Hook to automatically save breakpoints on quit"},"154":{"body":"A symbolic watchpoint defined on a member variable for debugging is only valid as long as the expression is in scope. Once out of scope the watchpoint gets deleted. When debugging some memory corruption we want to keep the watchpoint even the expression goes out of scope to find the location that overrides the variable and introduces the corruption. (gdb) l\n1 struct S { int v; };\n2\n3 void set(struct S* s, int v) {\n4 s->v = v;\n5 }\n6\n7 int main() {\n8 struct S s;\n9 set(&s, 1);\n10 set(&s, 2);\n11 set(&s, 3);\n... (gdb) s\nset (s=0x7fffffffe594, v=1) at test.c:4\n4 s->v = v; # Define a new watchpoint on the member of the struct. The expression however\n# is only valid in the current functions scope. (gdb) watch s->v\nHardware watchpoint 2: s->v (gdb) c\nHardware watchpoint 2: s->v\nOld value = 0\nNew value = 1\nset (s=0x7fffffffe594, v=1) at test.c:5\n5 } # The watchpoint gets deleted as soon as we leave the function scope. (gdb) c\nWatchpoint 2 deleted because the program has left the block in\nwhich its expression is valid.\nmain () at test.c:10\n10 set(&s, 2); # Define the watchpoint on the location of the object to watch. (gdb) watch -l s->v # This is equivalent to the following. (gdb) p &s->v\n$1 = (int *) 0x7fffffffe594 # Define a watchpoint to the address of the member variable of the s instance.\n# This of course only makes sense as long as the s instance is not moved in memory. (gdb) watch *0x7fffffffe594\nHardware watchpoint 3: *0x7fffffffe594 (gdb) c\nHardware watchpoint 3: *0x7fffffffe594\nOld value = 1\nNew value = 2\nset (s=0x7fffffffe594, v=2) at test.c:5\n5 } (gdb) c\nHardware watchpoint 3: *0x7fffffffe594\nOld value = 2\nNew value = 3\nset (s=0x7fffffffe594, v=3) at test.c:5\n5 }","breadcrumbs":"Tools » gdb » Watchpoint on struct / class member","id":"154","title":"Watchpoint on struct / class member"},"155":{"body":"# Run shell commands. (gdb) shell zcat /proc/config.gz | grep CONFIG_KVM=\nCONFIG_KVM=m # Pipe gdb command to shell command. (gdb) pipe info proc mapping | grep libc 0x7ffff7a1a000 0x7ffff7a42000 0x28000 0x0 r--p /usr/lib/libc.so.6 0x7ffff7a42000 0x7ffff7b9d000 0x15b000 0x28000 r-xp /usr/lib/libc.so.6 0x7ffff7b9d000 0x7ffff7bf2000 0x55000 0x183000 r--p /usr/lib/libc.so.6 0x7ffff7bf2000 0x7ffff7bf6000 0x4000 0x1d7000 r--p /usr/lib/libc.so.6 0x7ffff7bf6000 0x7ffff7bf8000 0x2000 0x1db000 rw-p /usr/lib/libc.so.6","breadcrumbs":"Tools » gdb » Shell commands","id":"155","title":"Shell commands"},"156":{"body":"","breadcrumbs":"Tools » gdb » Know Bugs","id":"156","title":"Know Bugs"},"157":{"body":"When using finish inside a command block, commands after finish are not executed. To workaround that bug one can create a wrapper function which calls finish. define handler bt finish info reg rax end command handler end","breadcrumbs":"Tools » gdb » Workaround command + finish bug","id":"157","title":"Workaround command + finish bug"},"158":{"body":"","breadcrumbs":"Tools » gdbserver » gdbserver(1)","id":"158","title":"gdbserver(1)"},"159":{"body":"gdbserver [opts] comm prog [args] opts: --disable-randomization --no-disable-randomization --wrapper W -- comm: host:port tty","breadcrumbs":"Tools » gdbserver » CLI","id":"159","title":"CLI"},"16":{"body":"Skeleton to copy/paste for writing simple completions. Assume a program foo with the following interface: foo -c green|red|blue -s low|high -f -d -h The completion handler could be implemented as follows in a file called _foo: #compdef _foo foo function _foo_color() { local colors=() colors+=('green:green color') colors+=('red:red color') colors+=('blue:blue color') _describe \"color\" colors\n} function _foo() { _arguments \\ \"-c[define color]:color:->s_color\" \\ \"-s[select sound]:sound:(low high)\" \\ \"-f[select file]:file:_files\" \\ \"-d[select dir]:dir:_files -/\" \\ \"-h[help]\" case $state in s_color) _foo_color;; esac\n}","breadcrumbs":"Tools » zsh » Example","id":"16","title":"Example"},"160":{"body":"# Start gdbserver.\ngdbserver localhost:1234 /bin/ls # Attach gdb.\ngdb -ex 'target remote localhost:1234'","breadcrumbs":"Tools » gdbserver » Example","id":"160","title":"Example"},"161":{"body":"Set env as execution wrapper with some variables. The wrapper will be executed before the debugee. gdbserver --wrapper env FOO=123 BAR=321 -- :12345 /bin/ls","breadcrumbs":"Tools » gdbserver » Wrapper example: Set environment variables just for the debugee","id":"161","title":"Wrapper example: Set environment variables just for the debugee"},"162":{"body":"","breadcrumbs":"Tools » radare2 » radare2(1)","id":"162","title":"radare2(1)"},"163":{"body":"pd [@ ] # print disassembly for instructions # with optional temporary seek to ","breadcrumbs":"Tools » radare2 » print","id":"163","title":"print"},"164":{"body":"fs # list flag-spaces fs # select flag-space f # print flags of selected flag-space","breadcrumbs":"Tools » radare2 » flags","id":"164","title":"flags"},"165":{"body":"?*~ # '?*' list all commands and '~' grep for ?*~... # '..' less mode /'...' interactive search","breadcrumbs":"Tools » radare2 » help","id":"165","title":"help"},"166":{"body":"> r2 -B # open mapped to addr oob # reopen current file at ","breadcrumbs":"Tools » radare2 » relocation","id":"166","title":"relocation"},"167":{"body":"","breadcrumbs":"Tools » radare2 » Examples","id":"167","title":"Examples"},"168":{"body":"> r2 [-w] oo+ # re-open for write if -w was not passed s # seek to position wv # write 4 byte (dword)","breadcrumbs":"Tools » radare2 » Patch file (alter bytes)","id":"168","title":"Patch file (alter bytes)"},"169":{"body":"rasm2 -L # list supported archs > rasm2 -a x86 'mov eax, 0xdeadbeef' b8efbeadde > rasm2 -a x86 -d \"b8efbeadde\" mov eax, 0xdeadbeef","breadcrumbs":"Tools » radare2 » Assemble / Disassmble (rasm2)","id":"169","title":"Assemble / Disassmble (rasm2)"},"17":{"body":"For this example we assume that the command foo takes at least three optional arguments such as foo arg1 arg2 arg3 [argN..] function _foo() { _arguments \\ \"1:opt 1:(a b c)\" \\ \":opt next:(d e f)\" \\ \"*:opt all:(u v w)\"\n} Explanation: 1:MSG:ACTION sets completion for the first optional argument :MSG:ACTION sets completion for the next optional argument *:MSG:ACTION sets completion for the optional argument where none of the previous rules apply, so in our example for arg3, argN... _files is a zsh builtin utility function to complete files/dirs see zsh completion functions zsh completion utility functions","breadcrumbs":"Tools » zsh » Example with optional arguments","id":"17","title":"Example with optional arguments"},"170":{"body":"All the examples & notes use qemu-system-x86_64 but in most cases this can be swapped with the system emulator for other architectures.","breadcrumbs":"Tools » qemu » qemu(1)","id":"170","title":"qemu(1)"},"171":{"body":"Graphic mode: Ctrl+Alt+g release mouse capture from VM Ctrl+Alt+1 switch to display of VM\nCtrl+Alt+2 switch to qemu monitor No graphic mode: Ctrl+a h print help\nCtrl+a x exit emulator\nCtrl+a c switch between monitor and console","breadcrumbs":"Tools » qemu » Keybindings","id":"171","title":"Keybindings"},"172":{"body":"Following command-line gives a good starting point to assemble a VM: qemu-system-x86_64 \\ -cpu host -enable-kvm -smp 4 \\ -m 8G \\ -vga virtio -display sdl,gl=on \\ -boot menu=on \\ -cdrom \\ -hda \\ -device qemu-xhci,id=xhci \\ -device usb-host,bus=xhci.0,vendorid=0x05e1,productid=0x0408,id=capture-card","breadcrumbs":"Tools » qemu » VM config snippet","id":"172","title":"VM config snippet"},"173":{"body":"# Emulate host CPU in guest VM, enabling all supported host featured (requires KVM).\n# List available CPUs `qemu-system-x86_64 -cpu help`.\n-cpu host # Enable KVM instead software emulation.\n-enable-kvm # Configure number of guest CPUs.\n-smp # Configure size of guest RAM.\n-m 8G","breadcrumbs":"Tools » qemu » CPU & RAM","id":"173","title":"CPU & RAM"},"174":{"body":"# Use sdl window as display and enable openGL context.\n-display sdl,gl=on # Use vnc server as display (eg on display `:42` here).\n-display vnc=localhost:42 # Confifure virtio as 3D video graphic accelerator (requires virgl in guest).\n-vga virtio","breadcrumbs":"Tools » qemu » Graphic & Display","id":"174","title":"Graphic & Display"},"175":{"body":"# Enables boot menu to select boot device (enter with `ESC`).\n-boot menu=on","breadcrumbs":"Tools » qemu » Boot Menu","id":"175","title":"Boot Menu"},"176":{"body":"# Attach cdrom drive with iso to a VM.\n-cdrom # Attach disk drive to a VM.\n-hda # Generic way to configure & attach a drive to a VM.\n-drive file=,format=qcow2 Create a disk with qemu-img To create a qcow2 disk (qemu copy-on-write) of size 10G: qemu-img create -f qcow2 disk.qcow2 10G The disk does not contain any partitions or a partition table. We can format the disk from within the guest as following example: # Create `gpt` partition table.\nsudo parted /dev/sda mktable gpt # Create two equally sized primary partitions.\nsudo parted /dev/sda mkpart primary 0% 50%\nsudo parted /dev/sda mkpart primary 50% 100% # Create filesystem on each partition.\nsudo mkfs.ext3 /dev/sda1\nsudo mkfs.ext4 /dev/sda2 lsblk -f /dev/sda NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT sda ├─sda1 ext3 .... └─sda2 ext4 ....","breadcrumbs":"Tools » qemu » Block devices","id":"176","title":"Block devices"},"177":{"body":"Host Controller # Add XHCI USB controller to the VM (supports USB 3.0, 2.0, 1.1).\n# `id=xhci` creates a usb bus named `xhci`.\n-device qemu-xhci,id=xhci USB Device # Pass-through USB device from host identified by vendorid & productid and\n# attach to usb bus `xhci.0` (defined with controller `id`).\n-device usb-host,bus=xhci.0,vendorid=0x05e1,productid=0x0408","breadcrumbs":"Tools » qemu » USB","id":"177","title":"USB"},"178":{"body":"# Open gdbstub on tcp `` (`-s` shorthand for `-gdb tcp::1234`).\n-gdb tcp:: # Freeze guest CPU at startup and wait for debugger connection.\n-S","breadcrumbs":"Tools » qemu » Debugging","id":"178","title":"Debugging"},"179":{"body":"# Create raw tcp server for `serial IO` and wait until a client connects\n# before executing the guest.\n-serial tcp:localhost:12345,server,wait # Create telnet server for `serial IO` and wait until a client connects\n# before executing the guest.\n-serial telnet:localhost:12345,server,wait # Configure redirection for the QEMU `mointor`, arguments similar to `-serial`\n# above.\n-monitor ... In server mode use nowait to execute guest without waiting for a client connection.","breadcrumbs":"Tools » qemu » IO redirection","id":"179","title":"IO redirection"},"18":{"body":"","breadcrumbs":"Tools » bash » bash(1)","id":"18","title":"bash(1)"},"180":{"body":"# Redirect host tcp port `1234` to guest port `4321`.\n-nic user,hostfwd=tcp:localhost:1234-:4321","breadcrumbs":"Tools » qemu » Network","id":"180","title":"Network"},"181":{"body":"# Attach a `virtio-9p-pci` device to the VM.\n# The guest requires 9p support and can mount the shared drive as:\n# mount -t 9p -o trans=virtio someName /mnt\n-virtfs local,id=someName,path=,mount_tag=someName,security_model=none","breadcrumbs":"Tools » qemu » Shared drives","id":"181","title":"Shared drives"},"182":{"body":"# List debug items.\n-d help # Write debug log to file instead stderr.\n-D # Examples\n-d in_asm Log executed guest instructions.","breadcrumbs":"Tools » qemu » Debug logging","id":"182","title":"Debug logging"},"183":{"body":"# List name of all trace points.\n-trace help # Enable trace points matching pattern and optionally write trace to file.\n-trace [,file=] # Enable trace points for all events listed in the file.\n# File must contain one event/pattern per line.\n-trace events=","breadcrumbs":"Tools » qemu » Tracing","id":"183","title":"Tracing"},"184":{"body":"VM snapshots require that there is at least on qcow2 disk attached to the VM ( VM Snapshots ). Commands for qemu Monitor or QMP : # List available snapshots.\ninfo snapshots # Create/Load/Delete snapshot with name .\nsavevm \nloadvm \ndelvm The snapshot can also be directly specified when invoking qemu as: qemu-system-x86_64 \\ -loadvm \\ ...","breadcrumbs":"Tools » qemu » VM snapshots","id":"184","title":"VM snapshots"},"185":{"body":"Online migration example: # Start machine 1 on host ABC.\nqemu-system-x86_64 -monitor stdio -cdrom # Prepare machine 2 on host DEF as migration target.\n# Listen for any connection on port 12345.\nqemu-system-x86_64 -monitor stdio -incoming tcp:0.0.0.0:12345 # Start migration from the machine 1 monitor console.\n(qemu) migrate tcp:DEF:12345 Save to external file example: ```bash\n# Start machine 1.\nqemu-system-x86_64 -monitor stdio -cdrom # Save VM state to file.\n(qemu) migrate \"exec:gzip -c > vm.gz\" # Load VM from file.\nqemu-system-x86_64 -monitor stdio -incoming \"exec: gzip -d -c vm.gz\" The migration source machine and the migration target machine should be launched with the same parameters.","breadcrumbs":"Tools » qemu » VM Migration","id":"185","title":"VM Migration"},"186":{"body":"Example command line to directly boot a Kernel with an initrd ramdisk. qemu-system-x86_64 \\ -cpu host \\ -enable-kvm \\ -kernel /arch/x86/boot/bzImage \\ -append \"earlyprintk=ttyS0 console=ttyS0 nokaslr init=/init debug\" \\ -initrd /initramfs.cpio.gz \\ ... Instructions to build a minimal Kernel and initrd .","breadcrumbs":"Tools » qemu » Appendix: Direct Kernel boot","id":"186","title":"Appendix: Direct Kernel boot"},"187":{"body":"test: test.s as -o test.o test.s ld -o test test.o testc.o trace: test qemu-x86_64 -singlestep -d nochain,cpu ./test 2>&1 | awk '/RIP/ { print $$1; }' clean: $(RM) test test-bin test.o .section .text, \"ax\" .global _start\n_start: xor %rax, %rax mov $0x8, %rax\n1: cmp $0, %rax je 2f dec %rax jmp 1b\n2: # x86-64 exit(2) syscall mov $0, %rdi mov $60, %rax syscall","breadcrumbs":"Tools » qemu » Appendix: Cheap instruction tracer","id":"187","title":"Appendix: Cheap instruction tracer"},"188":{"body":"QEMU USB QEMU IMG QEMU Tools QEMU System QEMU Invocation (command line args) QEMU Monitor QEMU machine protocol (QMP) QEMU VM Snapshots","breadcrumbs":"Tools » qemu » References","id":"188","title":"References"},"189":{"body":"","breadcrumbs":"Tools » pacman » pacman(1)","id":"189","title":"pacman(1)"},"19":{"body":"","breadcrumbs":"Tools » bash » Expansion","id":"19","title":"Expansion"},"190":{"body":"pacman -Sy refresh package database\npacman -S install pkg\npacman -Ss search remote package database\npacman -Si get info for pkg\npacman -Su upgrade installed packages\npacman -Sc clean local package cache","breadcrumbs":"Tools » pacman » Remote package repositories","id":"190","title":"Remote package repositories"},"191":{"body":"pacman -Rsn uninstall package and unneeded deps + config files","breadcrumbs":"Tools » pacman » Remove packages","id":"191","title":"Remove packages"},"192":{"body":"Local package database of installed packages. pacman -Q list all installed packages\npacman -Qs search local package database\npacman -Ql list files installed by pkg\npacman -Qo query package that owns file\npacman -Qe only list explicitly installed packages","breadcrumbs":"Tools » pacman » Local package database","id":"192","title":"Local package database"},"193":{"body":"Local file database which allows to search packages owning certain files. Also searches non installed packages, but database must be synced. pacman -Fy refresh file database\npacman -Fl list files in pkg (must not be installed)\npacman -Fx search","breadcrumbs":"Tools » pacman » Local file database","id":"193","title":"Local file database"},"194":{"body":"Uninstall all orphaned packages (including config files) that were installed as dependencies. pacman -Rsn $(pacman -Qtdq) List explicitly installed packages that are not required as dependency by any package and sort by size. pacman -Qetq | xargs pacman -Qi | awk '/Name/ { name=$3 } /Installed Size/ { printf \"%8.2f%s %s\\n\", $4, $5, name }' | sort -h Install package into different root directory but keep using the default database. pacman --root abc --dbpath /var/lib/pacman -S mingw-w64-gcc","breadcrumbs":"Tools » pacman » Hacks","id":"194","title":"Hacks"},"195":{"body":"Online playground","breadcrumbs":"Tools » dot » dot(1)","id":"195","title":"dot(1)"},"196":{"body":"Can be rendered to svg with the following command. dot -T svg -o g.svg g.dot Example dot file. // file: g.dot\ndigraph { // Render ranks from left to right. rankdir=LR // Make background transparent. bgcolor=transparent // Global node attributes. node [shape=box] // Global edge attributes. edge [style=dotted,color=red] // Add nodes & edge. stage1 -> stage2 // Add multiple edges at once. stage2 -> { stage3_1, stage3_2 } // Add edge with custom attributes. stage3_2 -> stage4 [label=\"some text\"] // Set custom attributes for specific node. stage4 [color=green,fillcolor=lightgray,style=\"filled,dashed\",label=\"s4\"] // Create a subgraph. This can be used to group nodes/edges or as scope for // global node/edge attributes. // If the name starts with 'cluster' a border is drawn. subgraph cluster_1 { stage5_1 stage5_2 } // Add some edges to subgraph nodes. stage3_1 -> { stage5_1, stage5_2 }\n} Rendered svg file. g.svg","breadcrumbs":"Tools » dot » Example dot file to copy & paste from.","id":"196","title":"Example dot file to copy & paste from."},"197":{"body":"DOT language Attributes Node shapes Colors User manual","breadcrumbs":"Tools » dot » References","id":"197","title":"References"},"198":{"body":"","breadcrumbs":"Tools » ffmpeg » ffmpeg (1)","id":"198","title":"ffmpeg (1)"},"199":{"body":"Following snippet allows to select a window which is then captured. #!/bin/bash echo \"Click on window to record ..\"\n# Extract window size and x,y offset.\nvideo_args=$(xwininfo \\ | awk '/Absolute upper-left X:/ { xoff = $4 } /Absolute upper-left Y:/ { yoff=$4 } /Width:/ { if ($2 % 2 == 1) { width=$2-1; } else { width=$2; } } /Height:/ { if ($2 % 2 == 1) { height=$2-1; } else { height=$2; } } END { printf \"-video_size %dx%d -i :0.0+%d,%d\", width, height, xoff, yoff }') ffmpeg -framerate 25 -f x11grab $video_args -pix_fmt yuv420p $@ output.mp4 Use yuv420p pixel format if video is played on the web ( ref ) The input -i 0,0+xoff,yoff means to capture $DISPLAY=0.0 starting at the coordinate (xoff, yoff), which is the left-upper corner, and the size of the capture is defined by the -video_size argument.","breadcrumbs":"Tools » ffmpeg » screen capture specific window (x11)","id":"199","title":"screen capture specific window (x11)"},"2":{"body":"","breadcrumbs":"Tools » zsh » zsh(1)","id":"2","title":"zsh(1)"},"20":{"body":"# generate sequence from n to m\n{n..m}\n# generate sequence from n to m step by s\n{n..m..s} # expand cartesian product\n{a,b}{c,d}","breadcrumbs":"Tools » bash » Generator","id":"20","title":"Generator"},"200":{"body":"","breadcrumbs":"Tools » column » column(1)","id":"200","title":"column(1)"},"201":{"body":"# Show as table (aligned columns), with comma as delimiter from stdin.\necho -e 'a,b,c\\n111,22222,33' | column -t -s ',' # Show file as table.\ncolumn -t -s ',' test.csv","breadcrumbs":"Tools » column » Examples","id":"201","title":"Examples"},"202":{"body":"sort [opts] [file] opts: -r reverse output -b ignore leading blanks -n sort by numeric -h sort by human numeric -V sort by version -k sort by Nth key -t field separator","breadcrumbs":"Tools » sort » sort(1)","id":"202","title":"sort(1)"},"203":{"body":"# Sort by directory sizes.\ndu -sh * | sort -h # Sort numeric by second key.\n# The default key separator is non-blank to blank transition.\necho 'a 4\nd 10\nc 21' | sort -k2 -n # Sort numeric by second key, split at comma.\necho 'a,4\nd,10\nc,21' | sort -k2 -n -t, Use --debug to annotate part of the line used to sort and hence debug the key usage.","breadcrumbs":"Tools » sort » Examples","id":"203","title":"Examples"},"204":{"body":"sed [opts] [script] [file] opts: -i edit file in place -i.bk edit file in place and create backup file (with .bk suffix, can be specified differently) --follow-symlinks follow symlinks when editing in place -e SCRIPT add SCRIPT to commands to be executed (can be specified multiple times) -f FILE add content of FILE to command to be executed --debug annotate program execution","breadcrumbs":"Tools » sed » sed(1)","id":"204","title":"sed(1)"},"205":{"body":"","breadcrumbs":"Tools » sed » Examples","id":"205","title":"Examples"},"206":{"body":"# Delete two lines.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '1d;3d'\n# bb\n# dd # Delete last ($) line.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '$d'\n# aa\n# bb\n# cc # Delete range of lines.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '1,3d'\n# dd # Delete lines matching pattern.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '/bb/d'\n# aa\n# cc\n# dd # Delete lines NOT matching pattern.\necho -e 'aa\\nbb\\ncc\\ndd' | sed '/bb/!d'\n# bb","breadcrumbs":"Tools » sed » Delete lines","id":"206","title":"Delete lines"},"207":{"body":"# Insert before line.\necho -e 'aa\\nbb' | sed '2iABC'\n# aa\n# ABC\n# bb # Insert after line.\necho -e 'aa\\nbb' | sed '2aABC'\n# aa\n# bb\n# ABC # Replace line.\necho -e 'aa\\nbb' | sed '2cABC'\n# aa\n# ABC # Insert before pattern match.\necho -e 'aa\\nbb' | sed '/bb/i 123'\n# aa\n# 123\n# bb","breadcrumbs":"Tools » sed » Insert lines","id":"207","title":"Insert lines"},"208":{"body":"# Substitute by regex.\necho -e 'aafooaa\\ncc' | sed 's/foo/MOOSE/'\n# aaMOOSEaa\n# cc","breadcrumbs":"Tools » sed » Substitute lines","id":"208","title":"Substitute lines"},"209":{"body":"echo -e 'foo\\nbar' | sed -e 's/foo/FOO/' -e 's/FOO/BAR/'\n# BAR\n# bar","breadcrumbs":"Tools » sed » Multiple scripts","id":"209","title":"Multiple scripts"},"21":{"body":"# default value\nbar=${foo:-some_val} # if $foo set, then bar=$foo else bar=some_val # alternate value\nbar=${foo:+bla $foo} # if $foo set, then bar=\"bla $foo\" else bar=\"\" # check param set\nbar=${foo:?msg} # if $foo set, then bar=$foo else exit and print msg # indirect\nFOO=foo\nBAR=FOO\nbar=${!BAR} # deref value of BAR -> bar=$FOO # prefix\n${foo#prefix} # remove prefix when expanding $foo\n# suffix\n${foo%suffix} # remove suffix when expanding $foo # substitute\n${foo/pattern/string} # replace pattern with string when expanding foo\n# pattern starts with\n# '/' replace all occurences of pattern\n# '#' pattern match at beginning\n# '%' pattern match at end # set programmatically with priintf builtin\nprintf -v \"VAR1\" \"abc\"\nNAME=VAR2\nprintf -v \"$NAME\" \"%s\" \"def\" Note: prefix/suffix/pattern are expanded as pathnames .","breadcrumbs":"Tools » bash » Parameter","id":"21","title":"Parameter"},"210":{"body":"touch file\nln -s file link\nls -l link\n# lrwxrwxrwx 1 johannst johannst 4 Feb 7 23:02 link -> file sed -i --follow-symlinks '1iabc' link\nls -l link\n# lrwxrwxrwx 1 johannst johannst 4 Feb 7 23:02 link -> file sed -i '1iabc' link\nls -l link\n# -rw-r--r-- 1 johannst johannst 0 Feb 7 23:02 link","breadcrumbs":"Tools » sed » Edit inplace through symlink","id":"210","title":"Edit inplace through symlink"},"211":{"body":"# Launch interactive shell.\ngnuplot # Launch interactive shell.\ngnuplot [opt] opt: -p ................ persist plot window -c ......... run script file -e \"; ..\" ... run cmd(s)","breadcrumbs":"Tools » gnuplot » gnuplot (1)","id":"211","title":"gnuplot (1)"},"212":{"body":"# Plot title.\nset title \"the plot\" # Labels.\nset xlabel \"abc\"\nset ylabel \"def\" # Output format, 'help set term' for all output formats.\nset term svg\n# Output file.\nset output \"out.svg\" # Make axis logarithmic to given base.\nset logscale x 2 # Change separator, default is whitespace.\nset datafile separator \",\"","breadcrumbs":"Tools » gnuplot » Frequently used configuration","id":"212","title":"Frequently used configuration"},"213":{"body":"# With specific style (eg lines, linespoint, boxes, steps, impulses, ..).\nplot \"\" with > cat data.txt\n1 1 3\n2 2 2\n3 3 1\n4 2 2 # Plot specific column.\nplot \"data.txt\" using 1:2, \"data.txt\" using 1:3\n# Equivalent using the special file \"\", which re-uses the previous input file.\nplot \"data.txt\" using 1:2, \"\" using 1:3 # Plot piped data.\nplot \"< head -n2 data.txt\" # Plot with alternate title.\nplot \"data.txt\" title \"moose\"","breadcrumbs":"Tools » gnuplot » Plot","id":"213","title":"Plot"},"214":{"body":"# file: mem_lat.plot set title \"memory latency (different strides)\"\nset xlabel \"array in KB\"\nset ylabel \"cycles / access\" set logscale x 2 plot \"stride_32.txt\" title \"32\" with linespoints, \\ \"stride_64.txt\" title \"64\" with linespoints, \\ \"stride_128.txt\" title \"128\" with linespoints, \\ \"stride_256.txt\" title \"256\" with linespoints, \\ \"stride_512.txt\" title \"512\" with linespoints On Linux x86_64, mem_lat.c provides an example which can be run as follows. gcc -o mem_lat mem_lat.c -g -O3 -Wall -Werror for stride in 32 64 128 256 512; do \\ taskset -c 1 ./mem_lat 128 $stride | tee stride_$stride.txt ; \\\ndone gnuplot -p -c mem_lat.plot","breadcrumbs":"Tools » gnuplot » Example: multiple data sets in on plot","id":"214","title":"Example: multiple data sets in on plot"},"215":{"body":"lsof ss pidstat pgrep ps pmap pstack","breadcrumbs":"Resource analysis & monitor » Resource analysis & monitor","id":"215","title":"Resource analysis & monitor"},"216":{"body":"lsof -r ..... repeatedly execute command ervery seconds -a ......... AND slection filters instead ORing (OR: default) -p ... filter by +fg ........ show file flags for file descripros -n ......... don't convert network addr to hostnames -P ......... don't convert network port to service names -i <@h[:p]>. show connections to h (hostname|ip addr) with optional port p -s