From 8160dc371e2a340c892e63db131e43c0a43adb4a Mon Sep 17 00:00:00 2001 From: Michael Henke Date: Fri, 27 Jan 2023 15:54:07 -0800 Subject: [PATCH 1/4] Fix error: multiple definition of `disctype'; CMakeFiles/friidumplib.dir/disc.c.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status https://github.com/bradenmcd/friidump/issues/10 --- libfriidump/unscrambler.c | 3 ++- libfriidump/unscrambler.h | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libfriidump/unscrambler.c b/libfriidump/unscrambler.c index 2198ee9..fba0730 100644 --- a/libfriidump/unscrambler.c +++ b/libfriidump/unscrambler.c @@ -25,7 +25,7 @@ * As Nintendo GameCube/Wii discs use the standars DVD-ROM scrambling algorithm, but with different, unknown, seeds, the actual seeds have to be brute-forced. * The functions in this file take care of the brute-forcing and of the actual unscrambling of the read sectors. * - * The code in this file has been derived from unscrambler 0.4, Copyright (C) 2006 Victor Muñoz (xt5@ingenieria-inversa.cl), GPL v2+, + * The code in this file has been derived from unscrambler 0.4, Copyright (C) 2006 Victor Mu�oz (xt5@ingenieria-inversa.cl), GPL v2+, * http://www.ingenieria-inversa.cl/?lp_lang_pref=en . */ @@ -48,6 +48,7 @@ /*! \brief Number of bytes of a sector on which the EDC is calculated */ #define EDC_LENGTH (RAW_SECTOR_SIZE - 4) /* The EDC value is contained in the bottom 4 bytes of a frame */ +u_int8_t disctype; /*! \brief A structure that represents a seed */ diff --git a/libfriidump/unscrambler.h b/libfriidump/unscrambler.h index b7f3da6..4c2209f 100644 --- a/libfriidump/unscrambler.h +++ b/libfriidump/unscrambler.h @@ -31,8 +31,6 @@ typedef struct unscrambler_s unscrambler; the progress function the same format we use elsewhere */ typedef void (*unscrambler_progress_func) (bool start, u_int32_t current_sector, u_int32_t total_sectors, void *progress_data); -u_int8_t disctype; - FRIIDUMPLIB_EXPORT unscrambler *unscrambler_new (void); FRIIDUMPLIB_EXPORT void *unscrambler_destroy (unscrambler *u); FRIIDUMPLIB_EXPORT bool unscrambler_unscramble_16sectors (unscrambler *u, u_int32_t sector_no, u_int8_t *inbuf, u_int8_t *outbuf); From 6e82bac0869de50e39bc0b1e54505767d963e15f Mon Sep 17 00:00:00 2001 From: Michael Henke Date: Fri, 27 Jan 2023 16:00:04 -0800 Subject: [PATCH 2/4] add Dockerfile --- .dockerignore | 1 + Docker/Dockerfile | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .dockerignore create mode 100644 Docker/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..6d0eac4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +docker \ No newline at end of file diff --git a/Docker/Dockerfile b/Docker/Dockerfile new file mode 100644 index 0000000..bdb86dd --- /dev/null +++ b/Docker/Dockerfile @@ -0,0 +1,21 @@ +FROM alpine:3.17 AS build-env + +#RUN apk add --update autoconf automake libtool git make gcc zlib g++ +RUN apk add --update make gcc cmake g++ linux-headers + +COPY . src/ + +RUN cd src \ + && mkdir BUILD \ + && cd BUILD \ + && cmake .. \ + && make \ + && make install + +FROM alpine:3.17 + +COPY --from=build-env /usr/local/bin /usr/local/bin + +WORKDIR / + +ENTRYPOINT ["/usr/local/bin/friidump"] \ No newline at end of file From 084042c4edeb3d65ddd02aad257eddc611677eef Mon Sep 17 00:00:00 2001 From: Michael Henke <433270+aphex3k@users.noreply.github.com> Date: Fri, 27 Jan 2023 16:19:01 -0800 Subject: [PATCH 3/4] Added Docker quick instructions --- README | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/README b/README index 5e1eb77..3f6f32a 100644 --- a/README +++ b/README @@ -67,6 +67,12 @@ Other drives might work, most likely those based on the Hitachi MN103 microcontroller. If you find any of them, please report so that they can be added to the compatibility list. +=============================================================================== +Docker +=============================================================================== + +$ docker build -f Docker/Dockerfile -t friidump . +$ docker run --rm --name friidump --privileged -v /dev/sr0:/dev/cdrom friidump -d /dev/cdrom -a =============================================================================== Installation From 96bbf45160bcce8084eebf366be879f677850f34 Mon Sep 17 00:00:00 2001 From: Michael Henke <433270+aphex3k@users.noreply.github.com> Date: Fri, 27 Jan 2023 16:27:35 -0800 Subject: [PATCH 4/4] Update README --- README | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README b/README index 3f6f32a..f9a58a7 100644 --- a/README +++ b/README @@ -72,7 +72,7 @@ Docker =============================================================================== $ docker build -f Docker/Dockerfile -t friidump . -$ docker run --rm --name friidump --privileged -v /dev/sr0:/dev/cdrom friidump -d /dev/cdrom -a +$ docker run --rm --name friidump --privileged -v /dev/sr0:/dev/cdrom -v ${PWD}:/data aphex3k/friidump:latest -d /dev/cdrom -a =============================================================================== Installation