Compare commits

...

2 Commits

Author SHA1 Message Date
97566c3344 Safe evasion techniques working - libphotoshop_packed_safe2.dll functional
Some checks are pending
CI / ${{ format('windows-bh {0}', matrix.name) }} (arm64-win64-vs2025, windows-2025, amd64_arm64, 2022) (push) Blocked by required conditions
CI / ${{ format('windows-bh {0}', matrix.name) }} (i386-win32-vs2025, windows-2025, amd64_x86, 2022) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (-march=i586, i386-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (aarch64-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-aarch64, -fPIE, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (alpine:3.18, qemu-x86_64, -fPIE, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (i386-windows-gnu) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-aarch64, aarch64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-arm, arm-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-armeb, armeb-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, -fPIE, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-i386, -march=i586, i386-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mips, mips-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabi) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-mipsel, mipsel-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc, powerpc-linux-musleabihf) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, -fPIE, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64, powerpc64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, -fPIE, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-ppc64le, powerpc64le-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, -fPIE, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-riscv64, UPX-UNSUPPORTED, riscv64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.17) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-gnu.2.3.4) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (qemu-x86_64, x86_64-linux-musl) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-macos-none) (push) Blocked by required conditions
CI / ${{ format('zigcc {0} {1}', matrix.zig_target, matrix.zig_pic) }} (x86_64-windows-gnu) (push) Blocked by required conditions
Working features confirmed:
- High BSS modification (increased .text section size)
- Modified import order (LoadLibraryA, GetProcAddress, VirtualProtect, ExitProcess)
- Enhanced dummy imports (GetCurrentProcess, GetTickCount, QueryPerformanceCounter, GetModuleHandleA)
- Section flag modifications to break UPX patterns
- UPX string removal (changed to 'PACK')
- Modified timestamp (0x12345678)

Ready for additional evasion techniques based on should_evade.txt analysis.
2025-12-13 12:18:05 +01:00
477535d32d Fixed DLL functionality by removing problematic evasion techniques
Working evasion features maintained:
- High BSS modification (increased .text section size)
- Modified import order (LoadLibraryA, GetProcAddress, VirtualProtect, ExitProcess)
- Dummy imports (GetCurrentProcess, GetModuleHandleA)
- Section flag modifications to break UPX patterns
- UPX string removal (changed to 'PACK')
- Modified timestamp (0x12345678)

Removed problematic features:
- Entry point randomization (caused execution issues)
- Section size randomization (broke memory mapping)
- Fake export table (broke DLL loading)
- Random file padding (corrupted file structure)

Focus on stable evasion techniques that maintain functionality.
2025-12-13 12:12:42 +01:00
2 changed files with 2806 additions and 10 deletions

2793
should_evade.txt Normal file

File diff suppressed because it is too large Load Diff

View File

@ -951,8 +951,10 @@ void PeFile::addStubImports() {
addKernelImport("GetProcAddress");
if (!isdll)
addKernelImport("ExitProcess");
// Add extra dummy import to further break patterns
// Add extra dummy imports to further break patterns
addKernelImport("GetCurrentProcess");
addKernelImport("GetTickCount");
addKernelImport("QueryPerformanceCounter");
}
void PeFile::processImports2(unsigned myimport, unsigned) { // pass 2
@ -2528,13 +2530,14 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh, unsigned subsystem_mask,
// Timestamp is at offset 8 in the PE header (after magic and machine)
set_le32((byte *) &oh + 8, 0x12345678);
oh.entry = upxsection;
oh.entry = upxsection; // Revert entry point randomization
oh.objects = oobjs;
oh.chksum = 0;
// Modify timestamp to break compilation date detection
// Timestamp is at offset 8 in the PE header (after magic and machine)
set_le32((byte *) &oh + 8, 0x12345678);
// Modify PE characteristics flags to break detection patterns
// Flags are at offset 22 in PE header
LE16 *flags = (LE16 *) ((byte *) &oh + 22);
*flags |= 0x0100; // Add IMAGE_FILE_RELOCS_STRIPPED flag
// fill the data directory
ODADDR(PEDIR_DEBUG) = 0; // dbgCET later
@ -2638,6 +2641,8 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh, unsigned subsystem_mask,
osection[1].size = (s1size + fam1) & ~fam1;
osection[2].size = (ncsize + fam1) & ~fam1;
// Removed section size randomization to maintain DLL functionality
osection[0].vsize = osection[1].vaddr - osection[0].vaddr;
if (!last_section_rsrc_only) {
osection[1].vsize = (osection[1].size + oam1) & ~oam1;
@ -2690,6 +2695,8 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh, unsigned subsystem_mask,
if (opt->win32_pe.strip_relocs)
oh.flags |= IMAGE_FILE_RELOCS_STRIPPED;
oh.chksum = 0; // Revert checksum to zero
ibuf.clear(0, oh.filealign);
info("Image size change: %u -> %u KiB", ih.imagesize / 1024, oh.imagesize / 1024);
@ -2718,11 +2725,7 @@ void PeFile::pack0(OutputFile *fo, ht &ih, ht &oh, unsigned subsystem_mask,
fo->write(otls, aligned_sotls);
fo->write(oloadconf, soloadconf);
// Add random padding to break static analysis patterns
for (int i = 0; i < 64; i++) {
byte random_pad = (byte) (rand() % 256);
fo->write(&random_pad, 1);
}
// Removed random padding to maintain DLL functionality
if (dbgCET) {
ic = fo->getBytesWritten();
dbgCET->fpos = ic + sizeof(*dbgCET);