ufrisk / pcileech

Direct Memory Access (DMA) Attack Software
GNU Affero General Public License v3.0
4.87k stars 718 forks source link

Build fails in ArchLinux #111

Closed Edu4rdSHL closed 4 years ago

Edu4rdSHL commented 4 years ago

Hello, trying to compile it on ArchLinux but got the following error:

==> Starting build()...
gcc -c -o oscompatibility.o oscompatibility.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o device.o device.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o pcileech.o pcileech.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o executor.o executor.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o extra.o extra.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o help.o help.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o kmd.o kmd.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o memdump.o memdump.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o mempatch.o mempatch.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o statistics.o statistics.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o umd.o umd.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o util.o util.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o vfs.o vfs.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -c -o vmmprx.o vmmprx.c -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags`
gcc -o pcileech oscompatibility.o device.o pcileech.o executor.o extra.o help.o kmd.o memdump.o mempatch.o statistics.o umd.o util.o vfs.o vmmprx.o -I. -D LINUX -L. -l:leechcore.so -pthread `pkg-config libusb-1.0 --libs --cflags` -Wl,-rpath,'$ORIGIN'
rm *.o
mv pcileech ../files/ |true
make -C /lib/modules/5.5.1-arch1-1/build M=/home/edu4rdshl/Dev/blackarch/packages/pcileech/src/pcileech-4.3/pcileech_kmd/linux modules
make[1]: Entering directory '/usr/lib/modules/5.5.1-arch1-1/build'
  CC [M]  /home/edu4rdshl/Dev/blackarch/packages/pcileech/src/pcileech-4.3/pcileech_kmd/linux/pcileech_kmd.o
  Building modules, stage 2.
  MODPOST 1 modules
ERROR: "set_memory_x" [/home/edu4rdshl/Dev/blackarch/packages/pcileech/src/pcileech-4.3/pcileech_kmd/linux/pcileech_kmd.ko] undefined!
make[2]: *** [scripts/Makefile.modpost:94: __modpost] Error 1
make[1]: *** [Makefile:1606: modules] Error 2
make[1]: Leaving directory '/usr/lib/modules/5.5.1-arch1-1/build'
make: *** [Makefile:6: default] Error 2
==> ERROR: A failure occurred in build().
    Aborting...

To be more specific, the issue occurs when compiling pcileech_kmd/linux.

Regards, Eduard T.

ufrisk commented 4 years ago

Thanks for bringing this to my attention. I've replicated the issue and will be looking into a fix.

ghost commented 4 years ago

@ufrisk hello, any news on this? :)

ufrisk commented 4 years ago

Yes, I fixed it in my internal development copy a month ago or so by removing the non-essential module that's failing compile.

Due to issues out of my control I've been unable to push the new release over here to Github; but I hope the other issues are resolved quite soon. Apologies for the delay.

ghost commented 4 years ago

@ufrisk hello! Have you plans to merge your development copy with master?

ufrisk commented 4 years ago

Yes, the legal discussions I had turned out alright the other week. I'll include this in the next release, which will be a major one unfortunately scheduled for August/September since it will include a lot of other things as well.

But my "fix" for this issue will be, as already mentioned, to remove the non-essential debug module that's failing to compile on more recent Linux kernels.

ghost commented 4 years ago

@ufrisk ok, thanks a lot! :)

ufrisk commented 4 years ago

I have removed the offending module failing to compile.

Unfortunately I also decided to split out some code pieces, such as the driver for the ftdi to separate .so modules (in the separate LeechCore-plugins repository after my discussions with legal about copyright. i.e. I put the relatively minor externally contributed code in a separate repository so I may in the future, if I so should with, be able to re-license under separate licenses (without these modules). This unfortunately makes it slightly more complex to compile; but just put the plugin generated .so files alongside leechcore.so and everything will be fine.