{"id":17102007,"url":"https://github.com/maskray/elfhacks","last_synced_at":"2026-01-04T18:13:24.151Z","repository":{"id":29307507,"uuid":"32840732","full_name":"MaskRay/ElfHacks","owner":"MaskRay","description":"Dive into ELF files using simple self-contained examples","archived":false,"fork":false,"pushed_at":"2015-08-30T09:34:32.000Z","size":209,"stargazers_count":144,"open_issues_count":0,"forks_count":28,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-01-29T02:41:17.440Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Makefile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MaskRay.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-03-25T03:36:29.000Z","updated_at":"2025-01-21T09:10:51.000Z","dependencies_parsed_at":"2022-09-20T06:13:15.968Z","dependency_job_id":null,"html_url":"https://github.com/MaskRay/ElfHacks","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaskRay%2FElfHacks","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaskRay%2FElfHacks/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaskRay%2FElfHacks/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MaskRay%2FElfHacks/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MaskRay","download_url":"https://codeload.github.com/MaskRay/ElfHacks/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245153892,"owners_count":20569408,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-14T15:27:48.399Z","updated_at":"2026-01-04T18:13:24.116Z","avatar_url":"https://github.com/MaskRay.png","language":"Makefile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ElfHacks\n\nDive into ELF files using simple self-contained examples.\n\n## Examples\n\n| #                                | Program         | Description                                                                       |\n| -----------------------------    | --------------- | --------------------------------------------------------------------------------- |\n| backtrace                        | gcc             | `backtrace(3)`                                                                    |\n| bss-section-in-c-and-c++         | gcc/g++         | .bss                                                                              |\n| hot-swapping                     | g++             | hot swapping of C++ programs                                                      |\n| gcc-attribute-alias              | gcc             | `alias` attribute emits an alias for another symbol                               |\n| gcc-builtin\\_return\\_address     | gcc             | `__builtin_return_address`                                                        |\n| gcc-finstrument-functions        | gcc             | generate instrumentation calls for entry and exit to functions                    |\n| gcc-nostdlib                     | gcc             | do not use standard system startup files or libraries                             |\n| gcc-pie                          | gcc             | produce a position independent executable (IMHO, like PIC+Bsymbolic)              |\n| gcc-static                       | gcc             | statically linked executable                                                      |\n| get-got-address                  | readelf,objdump | get GOT address of functions or variables                                         |\n| get-plt-address                  | readelf,objdump | get PLT address of functions                                                      |\n| g++-inline-means-weak-symbol     | g++             | inline functions translated to weak symbols                                       |\n| implicit-inline-member-function  | g++             | member functions defined in classes are implicitly inline                         |\n| ld-Bsymbolic                     | ld              | `-Bsymbolic` binds references to local symbols                                    |\n| ld-dy-dn                         | ld              | `-dn` makes ld link against static libraries                                      |\n| ld-execstack                     | ld              | `-z` execstack and NX bit                                                         |\n| ld-export-dynamic                | ld              | `--export-dynamic` makes executables export dynamic symbols                       |\n| ld-now                           | ld              | `-z` now tells ld.so to resolve symbols immediately                               |\n| ld-relro                         | ld              | RELocation Read-Only                                                              |\n| ld-rpath                         | ld              | `-rpath` sets `DT_RUNPATH` which adds a directory to runtime library search path  |\n| ld-whole-archive                 | ld              | `--whole-archive` includes every object files (not only those which are required) |\n| ld-wrap                          | ld              | `--wrap` makes undefined references to `SYMBOL` be resolved to `__wrap_SYMBOL`    |\n| LD\\_BIND\\_NOW                    | ld.so           | resolve all symbols at startup instead of deferring resolution to the first call  |\n| LD\\_PROFILE                      | ld.so           | profile a shared library                                                          |\n| LD\\_TRACE\\_LOADED\\_OBJECTS       | ld.so           | list dynamic library dependencies rather than running                             |\n| as-syscall                       | as              | make syscalls in x86-64 assembly                                                  |\n| as-syscall-i386                  | as              | make syscalls in i386 assembly                                                    |\n| shellcode-in-c                   | gcc,objcopy     | write shellcode in c using gcc \u0026 objcopy                                          |\n| objcopy-link-blob                | objcopy         | link blob into executable                                                         |\n| libSegFault                      | glibc           |                                                                                   |\n| version-script-hiding-c++-dynsym | ld              | hide C++ dynamic symbols using a version script                                   |\n\n## Dynamic linker\n\nThe man page `ld.so(8)` specifies directories are searched in which order when resolving library dependencies:\n\n- `DT_RPATH` attribute in dynamic section is `DT_RUNPATH` does not exist\n- environment variable `LD_LIBRARY_PATH`\n- `DT_RUNPATH` attribute in dynamic section\n- `/etc/ld.so.cache`\n- `/lib`, `/usr/lib`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaskray%2Felfhacks","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaskray%2Felfhacks","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaskray%2Felfhacks/lists"}