Compare commits
No commits in common. "a6ff3f5086a7afdd5152e3c6930254b49f1026d6" and "2f27b7f29e462867b872b2ee516e187b775aba8b" have entirely different histories.
a6ff3f5086
...
2f27b7f29e
30
chap/C.tex
30
chap/C.tex
@ -472,36 +472,6 @@ Libérer deux fois la mémoire.
|
||||
|
||||
% =========================================================
|
||||
|
||||
\section{Debug} \index{Debug}
|
||||
|
||||
Des outils et astuces en page \pageref{chap:Debug}.
|
||||
|
||||
\begin{quote}
|
||||
splint is an annotation-assisted lightweight static checker.
|
||||
It is a tool for
|
||||
statically checking C programs for security vulnerabilities and coding
|
||||
mistakes.
|
||||
If additional effort is invested in adding annotations to programs,
|
||||
splint can perform stronger checking.
|
||||
\end{quote}
|
||||
|
||||
% =========================================================
|
||||
\section{Legalize}
|
||||
|
||||
"The two forms of conforming implementation are hosted and freestanding.
|
||||
A conforming hosted implementation shall accept any strictly conforming
|
||||
program. A conforming freestanding implementation shall accept any
|
||||
strictly conforming program in which the use of the features specified
|
||||
in the library clause (Clause 7) is confined to the contents of the
|
||||
standard headers <float.h> , <iso646.h> , <limits.h> , <stdalign.h> ,
|
||||
<stdarg.h> , <stdbool.h> , <stddef.h> , <stdint.h> , and <stdnoreturn.h>
|
||||
. Additionally, a conforming freestanding implementation shall accept
|
||||
any strictly conforming program in which the use of the features
|
||||
specified in the header <string.h> , except the following functions:
|
||||
strdup , strndup , strcoll , strxfrm , strerror ." (4p6)
|
||||
|
||||
% =========================================================
|
||||
|
||||
\section{Ailleurs dans cet ouvrage}
|
||||
|
||||
Il y a plein d'autres exemples de code en C, sur des sujets
|
||||
|
@ -70,8 +70,6 @@ tth@tranxene:~$
|
||||
\subsection{dig}
|
||||
\index{dig}
|
||||
|
||||
% https://jvns.ca/blog/2021/12/04/how-to-use-dig/
|
||||
|
||||
Dig (\textit{domain information groper}) est un outil d'interrogation
|
||||
des serveurs DNS. Par défaut, il questionne les serveurs
|
||||
listés dans \texttt{/etc/resolv.conf}.
|
||||
@ -82,10 +80,6 @@ Pour résoudre récursivement un nom de domaine à partir de la racine :
|
||||
Pour obtenir le reverse d'une adresse IP :
|
||||
\texttt{\$ dig +trace -x <adresse.ip>}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
% ------------------------------------------------------------
|
||||
% \subsection{delv}
|
||||
% \index{delv}
|
||||
|
@ -180,7 +180,43 @@ Il nius faut donc remplacer le getenv de la libc par notre propre
|
||||
version qui va écouter et exfiltrer l'utilisation de cette
|
||||
fonction.
|
||||
|
||||
\lstinputlisting[language=C]{code/debug/spy_getenv.c}
|
||||
\begin{lstlisting}[language=C]
|
||||
/*
|
||||
spy_getenv.so: spy_getenv.c Makefile
|
||||
gcc -Wall -shared -fPIC $< -ldl -o $@
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
#define __USE_GNU
|
||||
#include <dlfcn.h>
|
||||
typedef char * (*original_getenv)(const char *envname);
|
||||
|
||||
char *getenv(char *envname)
|
||||
{
|
||||
static char *arrow = "--getenv--> ";
|
||||
static char *wtf = " --> WTF ?";
|
||||
char *content;
|
||||
|
||||
original_getenv orig_getenv;
|
||||
orig_getenv = (original_getenv)dlsym(RTLD_NEXT, "getenv");
|
||||
|
||||
write(STDERR_FILENO, arrow, strlen(arrow));
|
||||
write(STDERR_FILENO, envname, strlen(envname));
|
||||
content = orig_getenv(envname);
|
||||
if (NULL != content) {
|
||||
write(STDERR_FILENO, "=", 1);
|
||||
write(STDERR_FILENO, content, strlen(content));
|
||||
}
|
||||
else {
|
||||
write(STDERR_FILENO, wtf, strlen(wtf));
|
||||
}
|
||||
|
||||
write(STDERR_FILENO, "\n", 1);
|
||||
return content;
|
||||
}
|
||||
\end{lstlisting}
|
||||
|
||||
Simple et efficace.
|
||||
|
||||
|
@ -52,11 +52,6 @@ map_henon: map_henon.f
|
||||
Hélas, je n'ai pas de commande \texttt{g77} dans ma machine,
|
||||
que faire ? En écrire une ?
|
||||
|
||||
% ==============================================================
|
||||
\section{qemu}
|
||||
\index{qemu}\label{qemu}
|
||||
|
||||
http://sven.stormbind.net/blog/posts/deb\_qemu\_local\_openwrt/
|
||||
|
||||
% ==============================================================
|
||||
|
||||
|
@ -100,27 +100,6 @@ la commande\texttt{tail} au début du script. Ensuite les deux clauses
|
||||
coordonnées X et Z, dans le repère POVray, qui n'est pas le même que
|
||||
celui de Gnuplot.
|
||||
|
||||
|
||||
% ------------------------------------------------
|
||||
\subsection{image\_map}
|
||||
|
||||
% ------------------------------------------------
|
||||
|
||||
\subsection{height\_field}
|
||||
|
||||
Les champs d'altitude... Toute une histoire...
|
||||
|
||||
\begin{verbatim}
|
||||
#declare Champ_Altitude = object
|
||||
{
|
||||
height_field {
|
||||
png "WS/hf5.png" gamma 1.8
|
||||
}
|
||||
pigment { color Cyan }
|
||||
scale 2
|
||||
}
|
||||
\end{verbatim}
|
||||
|
||||
% ------------------------------------------------
|
||||
|
||||
\subsection{Trucs à voir}
|
||||
|
@ -111,12 +111,6 @@ changer la dimension de l'image. En détail, j'ai pas tout compris.
|
||||
|
||||
% ------------------------------------------
|
||||
|
||||
\subsection{Trucs}
|
||||
|
||||
convert -average frame*.png output.png
|
||||
|
||||
% ------------------------------------------
|
||||
|
||||
\subsection{Ressources}
|
||||
|
||||
Le futur livre de Brunus. Réclamez les prmiers drafts dans
|
||||
|
@ -10,4 +10,4 @@ TP Link
|
||||
Archer C7
|
||||
\end{verbatim}
|
||||
|
||||
http://sven.stormbind.net/blog/posts/deb\_qemu\_local\_openwrt/
|
||||
|
||||
|
@ -2,8 +2,6 @@
|
||||
\label{S-lang}
|
||||
\index{S-lang}
|
||||
|
||||
% ----------------------------------------------------------
|
||||
|
||||
\section{C'est quoi ?}
|
||||
|
||||
S-lang est une bibliothèque de fonctions multi-plateforme
|
||||
@ -15,8 +13,6 @@ L'exemple le plus éblouissant étant le célèbre
|
||||
longuement dans les pages consacrées à Usenet\index{Usenet}
|
||||
(page \pageref{slrn}).
|
||||
|
||||
% ----------------------------------------------------------
|
||||
|
||||
\section{slsh}
|
||||
\index{slsh}
|
||||
|
||||
@ -44,4 +40,3 @@ tth@plop:~/Essais/Slang$
|
||||
|
||||
Cool...
|
||||
|
||||
% ----------------------------------------------------------
|
||||
|
10
chap/son.tex
10
chap/son.tex
@ -154,21 +154,13 @@ Elle supporte une grande variété de formats.
|
||||
|
||||
La configuration se fait par deux fichiers :
|
||||
\texttt{/etc/libao.conf} surchargeable par
|
||||
\texttt{\$HOME/.libao.conf}, et schématiquement, nous pouvons
|
||||
\texttt{\$HOME/.libao.conf}, et scématiquement, nous pouvons
|
||||
voir qu'elle est à deux niveaux.
|
||||
|
||||
https://www.xiph.org/ao/doc/drivers.html
|
||||
|
||||
%------------------------------------------------------------------
|
||||
|
||||
\section{Portaudio} \label{Portaudio} \index{Portaudio}
|
||||
|
||||
Une suggestion de Wargreen pour avancer un peu dans la construction
|
||||
de ma DAW\footnote{Digital Audio Workstation, aka machine à sons}
|
||||
\textsl{custom-made} à mon idée\dots
|
||||
|
||||
%------------------------------------------------------------------
|
||||
|
||||
\section{Ladspa}
|
||||
\index{ladspa}
|
||||
|
||||
|
@ -1,62 +0,0 @@
|
||||
%
|
||||
%
|
||||
%
|
||||
\chapter{Web servers}
|
||||
|
||||
% ==============================================================
|
||||
\section{Apache} \index{Apache}
|
||||
|
||||
Le grand classique.
|
||||
|
||||
|
||||
% ==============================================================
|
||||
\section{Lighttpd} \index{Lighttpd}
|
||||
|
||||
Un outsider ?
|
||||
|
||||
\begin{verbatim}
|
||||
root@ramen:~# lighty-enable-mod userdir
|
||||
Enabling userdir: ok
|
||||
Run "service lighttpd force-reload" to enable changes
|
||||
root@ramen:~# service lighttpd force-reload
|
||||
root@ramen:~#
|
||||
\end{verbatim}
|
||||
|
||||
% ==============================================================
|
||||
|
||||
\section{Custom made}
|
||||
|
||||
\begin{verbatim}
|
||||
tth@ramen:~/Houba/Fractales90$ apt show libmicrohttpd12
|
||||
Package: libmicrohttpd12
|
||||
Version: 0.9.72-2
|
||||
Priority: optional
|
||||
Section: libs
|
||||
Source: libmicrohttpd
|
||||
Maintainer: Daniel Baumann <daniel.baumann@progress-linux.org>
|
||||
Installed-Size: 211 kB
|
||||
Depends: libc6 (>= 2.17), libgnutls30 (>= 3.7.0)
|
||||
Homepage: https://www.gnu.org/software/libmicrohttpd/
|
||||
Tag: role::shared-lib
|
||||
Download-Size: 109 kB
|
||||
APT-Sources: http://deb.debian.org/debian bullseye/main amd64 Packages
|
||||
Description: library embedding HTTP server functionality
|
||||
GNU libmicrohttpd is a small C library that is supposed to make it
|
||||
easy to run an HTTP server as part of another application.
|
||||
Key features that distinguish GNU Libmicrohttpd from other
|
||||
projects are:
|
||||
* C library: fast and small
|
||||
* API is simple, expressive and fully reentrant
|
||||
* Implementation is HTTP 1.1 compliant
|
||||
* HTTP server can listen on multiple ports
|
||||
* Four different threading models (select, poll, pthread, thread pool)
|
||||
* Support for IPv6
|
||||
* Support for SHOUTcast
|
||||
* Support for incremental processing of POST data (optional)
|
||||
* Support for basic and digest authentication (optional)
|
||||
* Support for SSL3 and TLS
|
||||
\end{verbatim}
|
||||
|
||||
|
||||
% ==============================================================
|
||||
|
@ -1,45 +0,0 @@
|
||||
/*
|
||||
*
|
||||
* spy_getenv.so: spy_getenv.c Makefile
|
||||
* gcc -Wall -shared -fPIC $< -ldl -o $@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#define __USE_GNU
|
||||
#include <dlfcn.h>
|
||||
|
||||
typedef char * (*original_getenv)(const char *envname);
|
||||
|
||||
char *getenv(char *envname)
|
||||
{
|
||||
static char *arrow = "--getenv--> ";
|
||||
static char *wtf = " --> (nil)";
|
||||
|
||||
char *content;
|
||||
original_getenv orig_getenv;
|
||||
|
||||
orig_getenv = (original_getenv)dlsym(RTLD_NEXT, "getenv");
|
||||
|
||||
write(STDERR_FILENO, arrow, strlen(arrow));
|
||||
write(STDERR_FILENO, envname, strlen(envname));
|
||||
|
||||
content = orig_getenv(envname);
|
||||
if (NULL != content) {
|
||||
write(STDERR_FILENO, "=", 1);
|
||||
write(STDERR_FILENO, content, strlen(content));
|
||||
}
|
||||
else {
|
||||
write(STDERR_FILENO, wtf, strlen(wtf));
|
||||
}
|
||||
|
||||
write(STDERR_FILENO, "\n", 1);
|
||||
|
||||
return content;
|
||||
}
|
||||
|
||||
/* j'adore quand un plan se déroule sans accrc */
|
||||
|
4
main.tex
4
main.tex
@ -139,6 +139,7 @@ en ligne sur le site du Tetalab. Your mileage may vary\dots
|
||||
\input{chap/plugins}
|
||||
\input{chap/Bonjour}
|
||||
\input{chap/ioctl}
|
||||
|
||||
\input{chap/debug}
|
||||
\input{chap/buzybox}
|
||||
\input{chap/gif89a}
|
||||
@ -147,12 +148,11 @@ en ligne sur le site du Tetalab. Your mileage may vary\dots
|
||||
\input{chap/Usenet}
|
||||
\input{chap/DNS}
|
||||
\input{chap/ssh}
|
||||
\input{chap/webserver}
|
||||
\input{chap/hardware}
|
||||
\input{chap/gadgets}
|
||||
\input{chap/sdr}
|
||||
|
||||
\input{chap/slang}
|
||||
% \input{chap/slang}
|
||||
\input{chap/curses}
|
||||
\input{chap/openwrt}
|
||||
\input{chap/WiFi}
|
||||
|
Loading…
Reference in New Issue
Block a user