Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix complete setup #181

Merged
merged 1 commit into from
Apr 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ cd how2heap

# the next command will prepare the target binary so it runs with
# the expected libc version
make
./glibc_run.sh 2.30 ./malloc_playground -d -p

# now you can play with the binary with glibc-2.30
Expand Down
14 changes: 7 additions & 7 deletions glibc_run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ function prep_in_docker () {
echo "building the how2heap_docker image!"
docker build -t how2heap_docker .

docker run --rm -it -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make clean >/dev/null
docker run --rm -it -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make >/dev/null
docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make clean >/dev/null
docker run --rm -it -u $(id -u ${USER}):$(id -g ${USER}) -v $HOW2HEAP_PATH:/root/how2heap how2heap_docker make >/dev/null
}

GLIBC_VERSION=$1
Expand Down Expand Up @@ -196,16 +196,16 @@ if [ -z "$(ls -A $OUTPUT_DIR)" ]; then
fi
target_interpreter="$OUTPUT_DIR/$(ls $OUTPUT_DIR | grep ld)"

if [[ $GLIBC_MAJOR != $SYSTEM_GLIBC_MAJOR ]] || [[ $GLIBC_MINOR != $SYSTEM_GLIBC_MINOR ]]; then
set_interpreter $target_interpreter
set_rpath
fi

if [ "$DOCKER" == 'X' ];
then
prep_in_docker $GLIBC_VERSION
fi

if [[ $GLIBC_MAJOR != $SYSTEM_GLIBC_MAJOR ]] || [[ $GLIBC_MINOR != $SYSTEM_GLIBC_MINOR ]]; then
set_interpreter $target_interpreter
set_rpath
fi

if [ "$GDB" == 'X' ];
then
if [[ $GLIBC_VERSION != $SYSTEM_GLIBC_VERSION ]]; then
Expand Down
Loading