c:accueil

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

Les deux révisions précédentes Révision précédente
Prochaine révision
Révision précédente
c:accueil [2024/11/14 13:00] – add ifuncs phswc:accueil [2025/11/05 15:18] (Version actuelle) – [Langage C] add link phsw
Ligne 17: Ligne 17:
   * [[https://github.com/theokwebb/C-from-Scratch|C from Scratch]]   * [[https://github.com/theokwebb/C-from-Scratch|C from Scratch]]
   * [[https://bible.malcore.io/readme/the-beginning/introduction-to-c|Introduction to C]]   * [[https://bible.malcore.io/readme/the-beginning/introduction-to-c|Introduction to C]]
 +  * [[https://lemon.rip/w/c99-vla-tricks/|C99 doesn't need function bodies, or 'VLAs are Turing complete']]
 +  * [[https://developers.redhat.com/articles/2024/12/11/making-memcpynull-null-0-well-defined|Making memcpy(NULL, NULL, 0) well-defined]]
 +  * [[https://fuckingfunctionpointers.com/|How Do I Declare a Function Pointer in C?]]
 +  * [[https://embeddedor.com/blog/2024/06/18/how-to-use-the-new-counted_by-attribute-in-c-and-linux/|How to use the new counted_by attribute in C (and Linux)]]
 +  * [[https://github.com/CodeWithHarry/The-Ultimate-C-Programming-Course|The Ultimate C Programming Handbook]]
 +  * [[http://www.graphics.stanford.edu/~seander/bithacks.html|Bit Twiddling Hacks]]
 +
  
  
Ligne 283: Ligne 290:
     printf("stdin is a file or a pipe\n");     printf("stdin is a file or a pipe\n");
 </code> </code>
 +
 +
 +==== _Generic ====
 +
 +  * [[https://www.chiark.greenend.org.uk/~sgtatham/quasiblog/c11-generic/|Workarounds for C11 _Generic]]
 +  * [[https://medium.com/@pauljlucas/generic-in-c-d7ab47e3b5ab|_Generic in C]]
 +  * [[https://en.cppreference.com/w/c/language/generic.html|Generic selection (since C11)]]
 +  * [[http://www.robertgamble.net/2012/01/c11-generic-selections.html|C11 - Generic Selections]]
  
  
Ligne 318: Ligne 333:
 <code bash> <code bash>
 addr2line -e main.out 0x4007db addr2line -e main.out 0x4007db
 +</code>
 +
 +<code bash>
 +#!/bin/bash
 +
 +readonly BACKTRACE_FILE=$1
 +
 +for l in $(grep -E "^/.+\(.+\)\[.+\]" $BACKTRACE_FILE)
 +do
 + lib=$(echo $l | sed -E "s/(\/.+)\(.+/\1/g")
 + addr=$(echo $l | sed -E "s/.+\((.+)\).+/\1/g")
 + ans=$(addr2line -e $lib $addr)
 + if [[ $ans == "??"* ]]
 + then
 + echo $l
 + else
 + echo $ans
 + fi
 +done
 </code> </code>
  
Ligne 332: Ligne 366:
  
   * [[https://blog.malicious.group/inline-assembly/|Inline Assembly]]   * [[https://blog.malicious.group/inline-assembly/|Inline Assembly]]
 +  * [[https://s-mazigh.github.io/ASMx86_64/index.html|ASM x86_64]]
 +  * https://diveintosystems.org/book/C7-x86_64/index.html
 +  * [[https://yuriygeorgiev.com/2024/02/19/x86-64-cpu-architecture-the-stack/|x86/x64 CPU architecture: the stack & stack frames]]
 +  * [[https://cs.brown.edu/courses/cs033/docs/guides/x64_cheatsheet.pdf|x64 Cheat Sheet]]
  
  
Ligne 348: Ligne 386:
   * [[https://willnewton.name/2013/07/02/using-gnu-indirect-functions/|Using GNU indirect functions]]   * [[https://willnewton.name/2013/07/02/using-gnu-indirect-functions/|Using GNU indirect functions]]
   * [[https://maskray.me/blog/2021-01-18-gnu-indirect-function|GNU indirect function]]   * [[https://maskray.me/blog/2021-01-18-gnu-indirect-function|GNU indirect function]]
 +
 +
 +==== Gestion des caractères non-ASCII ====
 +
 +  * [[https://stackoverflow.com/questions/32523898/c-reading-non-ascii-characters|c reading non ASCII characters]]
 +
 +
 +==== Fichiers de suppressions pour sanitizers ====
 +
 +  * [[https://github.com/google/sanitizers/wiki/AddressSanitizerLeakSanitizer#suppressions]]
 +
 +Dans un fichier ''asan.supp'' :
 +<code>
 +leak:libdbus-1.so
 +</code>
 +
 +<code bash>
 +LSAN_OPTIONS=suppressions=asan.supp,print_suppressions=0 ./programme
 +</code>
  • c/accueil.1731585608.txt.gz
  • Dernière modification : 2024/11/14 13:00
  • de phsw