zhaodice / qemu-anti-detection

A patch to hide qemu itself, bypass mhyprot,EAC,nProtect / VMProtect,VProtect, Themida, Enigma Protector,Safegine Shielden
746 stars 113 forks source link

Cannot apply patches #34

Open buddyman1 opened 11 months ago

buddyman1 commented 11 months ago

Hey I am on Ubuntu, after the qemu repo had been cloned I moved the patch into the qemu folder and then ran "git apply qemu7.0.0.patch"

I got the error "warning: unable to rmdir 'roms/edk2': Directory not empty" I ran the cmd again and got the errors:

error: patch failed: block/vhdx.c:2005 error: block/vhdx.c: patch does not apply error: patch failed: block/vvfat.c:1174 error: block/vvfat.c: patch does not apply error: patch failed: chardev/msmouse.c:150 error: chardev/msmouse.c: patch does not apply error: patch failed: chardev/wctablet.c:179 error: chardev/wctablet.c: patch does not apply error: patch failed: contrib/vhost-user-gpu/vhost-user-gpu.c:1190 error: contrib/vhost-user-gpu/vhost-user-gpu.c: patch does not apply error: patch failed: hw/acpi/aml-build.c:1724 error: hw/acpi/aml-build.c: patch does not apply error: patch failed: hw/arm/nseries.c:847 error: hw/arm/nseries.c: patch does not apply error: patch failed: hw/arm/sbsa-ref.c:835 error: hw/arm/sbsa-ref.c: patch does not apply error: patch failed: hw/arm/virt.c:1588 error: hw/arm/virt.c: patch does not apply error: patch failed: hw/audio/hda-codec.c:117 error: hw/audio/hda-codec.c: patch does not apply error: patch failed: hw/char/escc.c:959 error: hw/char/escc.c: patch does not apply error: patch failed: hw/display/edid-generate.c:394 error: hw/display/edid-generate.c: patch does not apply error: patch failed: hw/i386/acpi-build.c:2674 error: hw/i386/acpi-build.c: patch does not apply error: patch failed: hw/i386/pc_piix.c:174 error: hw/i386/pc_piix.c: patch does not apply error: patch failed: hw/i386/pc_q35.c:197 error: hw/i386/pc_q35.c: patch does not apply error: patch failed: hw/ide/atapi.c:796 error: hw/ide/atapi.c: patch does not apply error: patch failed: hw/ide/core.c:2560 error: hw/ide/core.c: patch does not apply error: patch failed: hw/input/adb-kbd.c:356 error: hw/input/adb-kbd.c: patch does not apply error: patch failed: hw/input/adb-mouse.c:236 error: hw/input/adb-mouse.c: patch does not apply error: patch failed: hw/input/ads7846.c:154 error: hw/input/ads7846.c: patch does not apply error: patch failed: hw/input/hid.c:511 error: hw/input/hid.c: patch does not apply error: patch failed: hw/input/ps2.c:1219 error: hw/input/ps2.c: patch does not apply error: patch failed: hw/input/tsc2005.c:510 error: hw/input/tsc2005.c: patch does not apply error: patch failed: hw/input/tsc210x.c:1106 error: hw/input/tsc210x.c: patch does not apply error: patch failed: hw/input/virtio-input-hid.c:16 error: hw/input/virtio-input-hid.c: patch does not apply error: patch failed: hw/m68k/virt.c:271 error: hw/m68k/virt.c: patch does not apply error: patch failed: hw/nvme/ctrl.c:6710 error: hw/nvme/ctrl.c: patch does not apply error: patch failed: hw/nvram/fw_cfg.c:56 error: hw/nvram/fw_cfg.c: patch does not apply error: patch failed: hw/pci-host/gpex.c:207 error: hw/pci-host/gpex.c: patch does not apply error: patch failed: hw/ppc/e500plat.c:22 error: hw/ppc/e500plat.c: patch does not apply error: patch failed: hw/scsi/mptconfig.c:189 error: hw/scsi/mptconfig.c: patch does not apply error: patch failed: hw/scsi/scsi-bus.c:555 error: hw/scsi/scsi-bus.c: patch does not apply error: patch failed: hw/scsi/scsi-disk.c:2395 error: hw/scsi/scsi-disk.c: patch does not apply error: patch failed: hw/scsi/spapr_vscsi.c:713 error: hw/scsi/spapr_vscsi.c: patch does not apply error: patch failed: hw/usb/dev-audio.c:73 error: hw/usb/dev-audio.c: patch does not apply error: patch failed: hw/usb/dev-hid.c:63 error: hw/usb/dev-hid.c: patch does not apply error: patch failed: hw/usb/dev-hub.c:104 error: hw/usb/dev-hub.c: patch does not apply error: patch failed: hw/usb/dev-mtp.c:248 error: hw/usb/dev-mtp.c: patch does not apply error: patch failed: hw/usb/dev-network.c:97 error: hw/usb/dev-network.c: patch does not apply error: patch failed: hw/usb/dev-serial.c:119 error: hw/usb/dev-serial.c: patch does not apply error: patch failed: hw/usb/dev-smartcard-reader.c:80 error: hw/usb/dev-smartcard-reader.c: patch does not apply error: patch failed: hw/usb/dev-storage.c:47 error: hw/usb/dev-storage.c: patch does not apply error: patch failed: hw/usb/dev-uas.c:171 error: hw/usb/dev-uas.c: patch does not apply error: patch failed: hw/usb/dev-wacom.c:64 error: hw/usb/dev-wacom.c: patch does not apply error: patch failed: hw/usb/u2f-emulated.c:386 error: hw/usb/u2f-emulated.c: patch does not apply error: patch failed: hw/usb/u2f-passthru.c:531 error: hw/usb/u2f-passthru.c: patch does not apply error: patch failed: hw/usb/u2f.c:46 error: hw/usb/u2f.c: patch does not apply error: patch failed: include/hw/acpi/aml-build.h:4 error: include/hw/acpi/aml-build.h: patch does not apply error: patch failed: include/hw/i386/pc.h:290 error: include/hw/i386/pc.h: patch does not apply error: patch failed: include/hw/pci/pci.h:71 error: include/hw/pci/pci.h: patch does not apply error: patch failed: include/standard-headers/linux/qemu_fw_cfg.h:71 error: include/standard-headers/linux/qemu_fw_cfg.h: patch does not apply error: patch failed: migration/migration.c:1190 error: migration/migration.c: patch does not apply error: patch failed: migration/rdma.c:248 error: migration/rdma.c: patch does not apply error: patch failed: pc-bios/optionrom/optionrom.h:43 error: pc-bios/optionrom/optionrom.h: patch does not apply error: patch failed: pc-bios/s390-ccw/virtio-scsi.h:25 error: pc-bios/s390-ccw/virtio-scsi.h: patch does not apply error: patch failed: target/i386/kvm/kvm.c:1694 error: target/i386/kvm/kvm.c: patch does not apply error: patch failed: target/s390x/tcg/misc_helper.c:322 error: target/s390x/tcg/misc_helper.c: patch does not apply error: patch failed: ui/spice-core.c:807 error: ui/spice-core.c: patch does not apply

Any help will be appreciated.

zhaodice commented 11 months ago

The qemu7.0.0.patch can only be used on qemu version 7.0.0, check the branch tag please.

buddyman1 commented 11 months ago

Hey, so I downloaded qemu 7.0.0, I used: git clone https://gitlab.com/qemu-project/qemu/ -b v7.0.0 --depth 1 --recursive Also do i need to have qemu already installed?

buddyman1 commented 11 months ago

I am new to this, so if you could explain what i need to do that will be great.

Thanks

zhaodice commented 11 months ago

Hey, so I downloaded qemu 7.0.0, I used: git clone https://gitlab.com/qemu-project/qemu/ -b v7.0.0 --depth 1 --recursive Also do i need to have qemu already installed?

You needn't install qemu, you can do follows:

# If you did this , skip
git clone https://gitlab.com/qemu-project/qemu/ -b v7.0.0 --depth 1 --recursive 
cd qemu

#Check if is in qemu folder
pwd
#!!!!Must be current QEMU folder
rm -rf ./*
#Recovery QEMU sources
git checkout .
#Apply patch again
zhaodice commented 11 months ago

If you see warning: unable to rmdir 'roms/edk2': Directory not empty only at first, it is success.please don't apply again, or you will get errors.

buddyman1 commented 11 months ago

After doing: make -j $(nproc)

output: FAILED: libqemuutil.a.p/util_async.c.o cc -m64 -mcx16 -Ilibqemuutil.a.p -I. -I../qemu -Isubprojects/libvhost-user -I../qemu/subprojects/libvhost-user -Iqapi -Itrace -Iui -Iui/shader -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/gio-unix-2.0 -I/usr/include/p11-kit-1 -I/usr/include/pixman-1 -fdiagnostics-color=auto -Wall -Winvalid-pch -Werror -std=gnu11 -O2 -g -isystem /home/rav/qemu/linux-headers -isystem linux-headers -iquote . -iquote /home/rav/qemu -iquote /home/rav/qemu/include -iquote /home/rav/qemu/disas/libvixl -iquote /home/rav/qemu/tcg/i386 -pthread -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -Wstrict-prototypes -Wredundant-decls -Wundef -Wwrite-strings -Wmissing-prototypes -fno-strict-aliasing -fno-common -fwrapv -Wold-style-declaration -Wold-style-definition -Wtype-limits -Wformat-security -Wformat-y2k -Winit-self -Wignored-qualifiers -Wempty-body -Wnested-externs -Wendif-labels -Wexpansion-to-defined -Wimplicit-fallthrough=2 -Wno-missing-include-dirs -Wno-shift-negative-value -Wno-psabi -fstack-protector-strong -fPIE -MD -MQ libqemuutil.a.p/util_async.c.o -MF libqemuutil.a.p/util_async.c.o.d -o libqemuutil.a.p/util_async.c.o -c ../qemu/util/async.c In file included from /home/rav/qemu/include/qemu/coroutine.h:18, from /home/rav/qemu/include/block/aio.h:20, from ../qemu/util/async.c:28: ../qemu/util/async.c: In function ‘aio_bh_poll’: /home/rav/qemu/include/qemu/queue.h:303:22: error: storing the address of local variable ‘slice’ in ‘*ctx.bh_slice_list.sqh_last’ [-Werror=dangling-pointer=] 303 | (head)->sqh_last = &(elm)->field.sqe_next; \ | ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ ../qemu/util/async.c:153:5: note: in expansion of macro ‘QSIMPLEQ_INSERT_TAIL’ 153 | QSIMPLEQ_INSERT_TAIL(&ctx->bh_slice_list, &slice, next); | ^~~~~~~~~~~~~~~~~~~~ ../qemu/util/async.c:148:17: note: ‘slice’ declared here 148 | BHListSlice slice; | ^~~~~ ../qemu/util/async.c:146:29: note: ‘ctx’ declared here 146 | int aio_bh_poll(AioContext *ctx) | ~~~~~~~~~~~~^~~ cc1: all warnings being treated as errors [704/2777] Compiling C object libqemuutil.a.p/util_nvdimm-utils.c.o [705/2777] Compiling C object libqemuutil.a.p/util_block-helpers.c.o [706/2777] Compiling C object libqemuutil.a.p/util_qemu-coroutine-io.c.o [707/2777] Compiling C object libqemuutil.a.p/util_lockcnt.c.o [708/2777] Compiling C object libqemuutil.a.p/util_qemu-coroutine.c.o [709/2777] Compiling C object libqemuutil.a.p/util_main-loop.c.o [710/2777] Compiling C object libqemuutil.a.p/util_qemu-coroutine-sleep.c.o [711/2777] Compiling C object libqemuutil.a.p/util_iov.c.o [712/2777] Compiling C object libqemuutil.a.p/util_qemu-co-shared-resource.c.o [713/2777] Compiling C object libqemuutil.a.p/util_vhost-user-server.c.o [714/2777] Compiling C object libqemuutil.a.p/util_qemu-coroutine-lock.c.o [715/2777] Compiling C object libqemuutil.a.p/util_hbitmap.c.o [716/2777] Compiling C object libqemuutil.a.p/util_qemu-sockets.c.o [717/2777] Compiling C object libqemuutil.a.p/util_bufferiszero.c.o [718/2777] Compiling C object libqemuutil.a.p/util_uri.c.o ninja: build stopped: subcommand failed. make: *** [Makefile:163: run-ninja] Error 1

buddyman1 commented 11 months ago

I found another person with the issue: https://gitlab.com/qemu-project/qemu/-/issues/1655

zhaodice commented 11 months ago

-disable-werror or downgrade your gcc version