You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+18-4
Original file line number
Diff line number
Diff line change
@@ -61,14 +61,28 @@ Try to inline the whole technique in a single `.c` -- it's a lot easier to learn
61
61
```shell
62
62
git clone https://github.com/shellphish/how2heap
63
63
cd how2heap
64
-
make clean all
65
-
./glibc_run.sh 2.30 ./malloc_playground -u -r
64
+
make clean base
65
+
./malloc_playground
66
66
```
67
-
Notice that it does not work if you compile the target binary (`malloc_playground`) using glibc >= 2.34 and try to run it on glibc < 2.34 because of glibc's symbol versioning. For details, please refer to [this](https://github.com/shellphish/how2heap/issues/169).
67
+
Notice that this will link the binaries with your system libc. If you want to play with other libc versions. Please refer to `Complete Setup`.
68
68
69
69
## Complete Setup
70
70
71
-
This uses Docker-based approach to prepare the needed environment
71
+
You will encounter symbol versioning issues (see [this](https://github.com/shellphish/how2heap/issues/169)) if you try to `LD_PRELOAD` libcs to a binary that's compiled on your host machine.
72
+
We have two ways to bypass it.
73
+
74
+
### Method 1: use linker magic (Experimental)
75
+
This one uses some linker magic to tell the compiler that it needs to link with a libc that may not be the latest.
76
+
```shell
77
+
git clone https://github.com/shellphish/how2heap
78
+
cd how2heap
79
+
H2H_USE_SYSTEM_LIBC=N make v2.23
80
+
```
81
+
This will link all the binaries against corresponding libcs. What's better is that it comes with debug symbols. Now you can play with any libc versions on your host machine.
82
+
In this example, it will compile all glibc-2.23 binaries and link them with libc-2.23. You can change the number to play with other libc versions.
83
+
84
+
### Method 2: use docker
85
+
This uses Docker-based approach to complie binaries inside an old ubuntu container so it is runnable with the target libc version.
0 commit comments