myph-v2.git


myph-v2

~ rust shellcode loader with evasive capabilities
git clone https://github.com/djnnvx/myph-v2.git
log | files | refs | archive | README

commit 7295aaf7537ee178550bc44479383a31bf06dec8
parent 5ca24034a78250e578eb38f63af03236f8aa3818
Author: djnn <[email protected]>
Date: Sun, 11 Jan 2026 18:43:04 +0900

feat(cli): adding `--low-ressources` mode

Diffstat:
M.github/workflows/ci.yml | 512++++++++++++++++++++++++++++++++++++++++++++-----------------------------------
MREADME.md | 39+++++++++++++++++++++++++++++++++++++++
Msrc/cli/mod.rs | 18++++++++++++++++++
Msrc/internals/loader.rs | 51+++++++++++++++++++++++++++++++++++++++++++++------
Msrc/internals/templates/cargo_config.rs | 270++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------
Msrc/main.rs | 12+++++++++++-

6 files changed, 643 insertions(+), 259 deletions(-)

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
@@ -122,21 +122,21 @@ jobs:
           # Create a test directory
           mkdir -p e2e-test
           cd e2e-test
-          
+
           # Create a test shellcode file
           echo -ne '\x90\x90\x90\xc3' > test_shellcode.raw
           echo "✓ Created test shellcode file (4 bytes)"
-          
+
           # Test 1: EXE binary generation with default encryption (AES)
           echo "=== Test 1: EXE binary with AES encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_aes.exe -e aes
-          
+
           # Verify the EXE binary was created
           if [ ! -f "test_aes.exe" ]; then
             echo "Error: Binary 'test_aes.exe' was not created"
             exit 1
           fi
-          
+
           # Verify it's a Windows PE executable
           if file test_aes.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ EXE is a Windows PE32+ executable"
@@ -144,129 +144,129 @@ jobs:
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           if file test_aes.exe | grep -q "stripped"; then
             echo "✓ EXE binary is stripped"
           else
             echo "Warning: EXE binary may not be stripped"
           fi
-          
+
           BINARY_SIZE=$(stat -f%z test_aes.exe 2>/dev/null || stat -c%s test_aes.exe)
           echo "✓ EXE binary size: $BINARY_SIZE bytes"
-          
+
           # Test 2: EXE binary generation with ChaCha20 encryption
           echo ""
           echo "=== Test 2: EXE binary with ChaCha20 encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_chacha20.exe -e chacha20
-          
+
           if [ ! -f "test_chacha20.exe" ]; then
             echo "Error: Binary 'test_chacha20.exe' was not created"
             exit 1
           fi
-          
+
           if file test_chacha20.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ ChaCha20 encrypted binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 3: EXE binary generation with XOR encryption
           echo ""
           echo "=== Test 3: EXE binary with XOR encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_xor.exe -e xor
-          
+
           if [ ! -f "test_xor.exe" ]; then
             echo "Error: Binary 'test_xor.exe' was not created"
             exit 1
           fi
-          
+
           if file test_xor.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ XOR encrypted binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 4: EXE binary generation with Blowfish encryption
           echo ""
           echo "=== Test 4: EXE binary with Blowfish encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_blowfish.exe -e blowfish
-          
+
           if [ ! -f "test_blowfish.exe" ]; then
             echo "Error: Binary 'test_blowfish.exe' was not created"
             exit 1
           fi
-          
+
           if file test_blowfish.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Blowfish encrypted binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 4a: EXE binary generation with AES-256 encryption
           echo ""
           echo "=== Test 4a: EXE binary with AES-256 encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_aes256.exe -e aes256
-          
+
           if [ ! -f "test_aes256.exe" ]; then
             echo "Error: Binary 'test_aes256.exe' was not created"
             exit 1
           fi
-          
+
           if file test_aes256.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ AES-256 encrypted binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 4b: EXE binary generation with Twofish encryption
           echo ""
           echo "=== Test 4b: EXE binary with Twofish encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_twofish.exe -e twofish
-          
+
           if [ ! -f "test_twofish.exe" ]; then
             echo "Error: Binary 'test_twofish.exe' was not created"
             exit 1
           fi
-          
+
           if file test_twofish.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Twofish encrypted binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 4c: EXE binary generation with Camellia encryption
           echo ""
           echo "=== Test 4c: EXE binary with Camellia encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_camellia.exe -e camellia
-          
+
           if [ ! -f "test_camellia.exe" ]; then
             echo "Error: Binary 'test_camellia.exe' was not created"
             exit 1
           fi
-          
+
           if file test_camellia.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Camellia encrypted binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 5: DLL binary generation with encrypted shellcode
           echo ""
           echo "=== Test 5: DLL binary with AES encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_output.dll -b dll -e aes
-          
+
           # Verify the DLL binary was created
           if [ ! -f "test_output.dll" ]; then
             echo "Error: DLL 'test_output.dll' was not created"
             exit 1
           fi
-          
+
           # Verify it's a Windows PE DLL
           if file test_output.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ DLL is a Windows PE32+ DLL"
@@ -274,50 +274,50 @@ jobs:
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           if file test_output.dll | grep -q "stripped"; then
             echo "✓ DLL binary is stripped"
           else
             echo "Warning: DLL binary may not be stripped"
           fi
-          
+
           DLL_SIZE=$(stat -f%z test_output.dll 2>/dev/null || stat -c%s test_output.dll)
           echo "✓ DLL binary size: $DLL_SIZE bytes"
-          
+
           # Test 6: EXE binary generation with fixed key (AES)
           echo ""
           echo "=== Test 6: EXE binary with AES encryption and fixed key ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_aes_fixed_key.exe -e aes -k "MyFixedKey12345"
-          
+
           if [ ! -f "test_aes_fixed_key.exe" ]; then
             echo "Error: Binary 'test_aes_fixed_key.exe' was not created"
             exit 1
           fi
-          
+
           if file test_aes_fixed_key.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ AES encrypted binary with fixed key is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 7: EXE binary generation with fixed key (XOR)
           echo ""
           echo "=== Test 7: EXE binary with XOR encryption and fixed key ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_xor_fixed_key.exe -e xor -k "SecretXORKey"
-          
+
           if [ ! -f "test_xor_fixed_key.exe" ]; then
             echo "Error: Binary 'test_xor_fixed_key.exe' was not created"
             exit 1
           fi
-          
+
           if file test_xor_fixed_key.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ XOR encrypted binary with fixed key is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 8: Verify encrypted shellcode is embedded (should be larger than raw)
           echo ""
           echo "=== Test 8: Verify encryption increased embedded data size ==="
@@ -326,102 +326,102 @@ jobs:
           echo "Original shellcode size: $ORIGINAL_SIZE bytes"
           echo "Note: Encrypted shellcode in binary should be larger due to IV/nonce/padding"
           echo "✓ Encryption is applied before embedding"
-          
+
           # Test 9: CRT (CreateRemoteThread) technique with notepad.exe
           echo ""
           echo "=== Test 9: EXE binary with CRT technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_crt.exe -e aes --technique crt --process notepad.exe
-          
+
           if [ ! -f "test_crt.exe" ]; then
             echo "Error: Binary 'test_crt.exe' was not created"
             exit 1
           fi
-          
+
           if file test_crt.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ CRT technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 10: CRTx (CreateRemoteThreadEx) technique with cmd.exe
           echo ""
           echo "=== Test 10: EXE binary with CRTx technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_crtx.exe -e xor --technique crtx --process cmd.exe
-          
+
           if [ ! -f "test_crtx.exe" ]; then
             echo "Error: Binary 'test_crtx.exe' was not created"
             exit 1
           fi
-          
+
           if file test_crtx.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ CRTx technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 11: EnumCalendar technique (no process injection)
           echo ""
           echo "=== Test 11: EXE binary with EnumCalendar technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_enum_calendar.exe -e chacha20 --technique enum-calendar
-          
+
           if [ ! -f "test_enum_calendar.exe" ]; then
             echo "Error: Binary 'test_enum_calendar.exe' was not created"
             exit 1
           fi
-          
+
           if file test_enum_calendar.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ EnumCalendar technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 12: DLL with CRT technique
           echo ""
           echo "=== Test 12: DLL binary with CRT technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_crt.dll -b dll -e aes --technique crt --process explorer.exe
-          
+
           if [ ! -f "test_crt.dll" ]; then
             echo "Error: DLL 'test_crt.dll' was not created"
             exit 1
           fi
-          
+
           if file test_crt.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ CRT technique DLL is a valid PE32+ DLL"
           else
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           # Test 13: CreateFiber technique
           echo ""
           echo "=== Test 13: EXE binary with CreateFiber technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_create_fiber.exe -e xor --technique create-fiber
-          
+
           if [ ! -f "test_create_fiber.exe" ]; then
             echo "Error: Binary 'test_create_fiber.exe' was not created"
             exit 1
           fi
-          
+
           if file test_create_fiber.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ CreateFiber technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 13a: LNK binary generation with AES encryption
           echo ""
           echo "=== Test 13a: LNK binary with AES encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_output.lnk -b lnk -e aes --technique create-fiber
-          
+
           if [ ! -f "test_output.lnk" ]; then
             echo "Error: Binary 'test_output.lnk' was not created"
             exit 1
           fi
-          
+
           # Verify the file exists and has non-zero size
           LNK_SIZE=$(stat -f%z test_output.lnk 2>/dev/null || stat -c%s test_output.lnk)
           if [ "$LNK_SIZE" -gt 0 ]; then
@@ -430,24 +430,24 @@ jobs:
             echo "Error: LNK file is empty"
             exit 1
           fi
-          
+
           # Verify it's recognized as a Windows shortcut
           if file test_output.lnk | grep -q "MS Windows shortcut"; then
             echo "✓ LNK file is recognized as MS Windows shortcut"
           else
             echo "Warning: file command may not recognize LNK format on this system"
           fi
-          
+
           # Test 13b: LNK binary with XOR encryption
           echo ""
           echo "=== Test 13b: LNK binary with XOR encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_xor.lnk -b lnk -e xor --technique syscall
-          
+
           if [ ! -f "test_xor.lnk" ]; then
             echo "Error: Binary 'test_xor.lnk' was not created"
             exit 1
           fi
-          
+
           LNK_SIZE=$(stat -f%z test_xor.lnk 2>/dev/null || stat -c%s test_xor.lnk)
           if [ "$LNK_SIZE" -gt 0 ]; then
             echo "✓ LNK file with XOR encryption created successfully ($LNK_SIZE bytes)"
@@ -455,17 +455,17 @@ jobs:
             echo "Error: LNK file is empty"
             exit 1
           fi
-          
+
           # Test 13c: LNK binary with ChaCha20 encryption
           echo ""
           echo "=== Test 13c: LNK binary with ChaCha20 encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_chacha.lnk -b lnk -e chacha20 --technique enum-calendar
-          
+
           if [ ! -f "test_chacha.lnk" ]; then
             echo "Error: Binary 'test_chacha.lnk' was not created"
             exit 1
           fi
-          
+
           LNK_SIZE=$(stat -f%z test_chacha.lnk 2>/dev/null || stat -c%s test_chacha.lnk)
           if [ "$LNK_SIZE" -gt 0 ]; then
             echo "✓ LNK file with ChaCha20 encryption created successfully ($LNK_SIZE bytes)"
@@ -473,856 +473,890 @@ jobs:
             echo "Error: LNK file is empty"
             exit 1
           fi
-          
+
           # Test 14: Etwp technique
           echo ""
           echo "=== Test 14: EXE binary with Etwp technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_etwp.exe -e aes --technique etwp
-          
+
           if [ ! -f "test_etwp.exe" ]; then
             echo "Error: Binary 'test_etwp.exe' was not created"
             exit 1
           fi
-          
+
           if file test_etwp.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Etwp technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 15: NtCreateThreadEx technique
           echo ""
           echo "=== Test 15: EXE binary with NtCreateThreadEx technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_nt_create_thread_ex.exe -e chacha20 --technique nt-create-thread-ex
-          
+
           if [ ! -f "test_nt_create_thread_ex.exe" ]; then
             echo "Error: Binary 'test_nt_create_thread_ex.exe' was not created"
             exit 1
           fi
-          
+
           if file test_nt_create_thread_ex.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ NtCreateThreadEx technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 16: ProcessHollowing technique
           echo ""
           echo "=== Test 16: EXE binary with ProcessHollowing technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_process_hollowing.exe -e blowfish --technique process-hollowing --process notepad.exe
-          
+
           if [ ! -f "test_process_hollowing.exe" ]; then
             echo "Error: Binary 'test_process_hollowing.exe' was not created"
             exit 1
           fi
-          
+
           if file test_process_hollowing.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ ProcessHollowing technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 17: SetTimer technique
           echo ""
           echo "=== Test 17: EXE binary with SetTimer technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_set_timer.exe -e xor --technique set-timer
-          
+
           if [ ! -f "test_set_timer.exe" ]; then
             echo "Error: Binary 'test_set_timer.exe' was not created"
             exit 1
           fi
-          
+
           if file test_set_timer.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ SetTimer technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 18: Syscall technique
           echo ""
           echo "=== Test 18: EXE binary with Syscall technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_syscall.exe -e aes --technique syscall
-          
+
           if [ ! -f "test_syscall.exe" ]; then
             echo "Error: Binary 'test_syscall.exe' was not created"
             exit 1
           fi
-          
+
           if file test_syscall.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Syscall technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 19: EnumWindows technique
           echo ""
           echo "=== Test 19: EXE binary with EnumWindows technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_enum_windows.exe -e chacha20 --technique enum-windows
-          
+
           if [ ! -f "test_enum_windows.exe" ]; then
             echo "Error: Binary 'test_enum_windows.exe' was not created"
             exit 1
           fi
-          
+
           if file test_enum_windows.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ EnumWindows technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 20: EnumSystemLocales technique
           echo ""
           echo "=== Test 20: EXE binary with EnumSystemLocales technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_enum_system_locales.exe -e blowfish --technique enum-system-locales
-          
+
           if [ ! -f "test_enum_system_locales.exe" ]; then
             echo "Error: Binary 'test_enum_system_locales.exe' was not created"
             exit 1
           fi
-          
+
           if file test_enum_system_locales.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ EnumSystemLocales technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 21: QueueUserAPC technique
           echo ""
           echo "=== Test 21: EXE binary with QueueUserAPC technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_queue_user_apc.exe -e xor --technique queue-user-apc
-          
+
           if [ ! -f "test_queue_user_apc.exe" ]; then
             echo "Error: Binary 'test_queue_user_apc.exe' was not created"
             exit 1
           fi
-          
+
           if file test_queue_user_apc.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ QueueUserAPC technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 21a: ImageGetDigestStream technique
           echo ""
           echo "=== Test 21a: EXE binary with ImageGetDigestStream technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_image_get_digest_stream.exe -e aes --technique image-get-digest-stream
-          
+
           if [ ! -f "test_image_get_digest_stream.exe" ]; then
             echo "Error: Binary 'test_image_get_digest_stream.exe' was not created"
             exit 1
           fi
-          
+
           if file test_image_get_digest_stream.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ ImageGetDigestStream technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 22: EXE binary with API Hammering
           echo ""
           echo "=== Test 22: EXE binary with API Hammering (AES encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_api_hammering.exe -e aes --with-api-hammering
-          
+
           if [ ! -f "test_api_hammering.exe" ]; then
             echo "Error: Binary 'test_api_hammering.exe' was not created"
             exit 1
           fi
-          
+
           if file test_api_hammering.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ API Hammering binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
-          # Test 23: DLL binary with API Hammering  
+
+          # Test 23: DLL binary with API Hammering
           echo ""
           echo "=== Test 23: DLL binary with API Hammering (XOR encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_api_hammering.dll -b dll -e xor --with-api-hammering --technique crt --process notepad.exe
-          
+
           if [ ! -f "test_api_hammering.dll" ]; then
             echo "Error: DLL 'test_api_hammering.dll' was not created"
             exit 1
           fi
-          
+
           if file test_api_hammering.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ API Hammering DLL is a valid PE32+ DLL"
           else
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           # Test 24: EXE binary with AMSI Patch
           echo ""
           echo "=== Test 24: EXE binary with AMSI Patch (AES encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_amsi_patch.exe -e aes --with-amsi-patch
-          
+
           if [ ! -f "test_amsi_patch.exe" ]; then
             echo "Error: Binary 'test_amsi_patch.exe' was not created"
             exit 1
           fi
-          
+
           if file test_amsi_patch.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ AMSI Patch binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 25: DLL binary with AMSI Patch
           echo ""
           echo "=== Test 25: DLL binary with AMSI Patch (XOR encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_amsi_patch.dll -b dll -e xor --with-amsi-patch --technique crt --process explorer.exe
-          
+
           if [ ! -f "test_amsi_patch.dll" ]; then
             echo "Error: DLL 'test_amsi_patch.dll' was not created"
             exit 1
           fi
-          
+
           if file test_amsi_patch.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ AMSI Patch DLL is a valid PE32+ DLL"
           else
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           # Test 26: EXE binary with combined features (API Hammering + AMSI Patch)
           echo ""
           echo "=== Test 26: EXE binary with API Hammering and AMSI Patch ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_combined.exe -e chacha20 --with-api-hammering --with-amsi-patch --technique crt --process notepad.exe
-          
+
           if [ ! -f "test_combined.exe" ]; then
             echo "Error: Binary 'test_combined.exe' was not created"
             exit 1
           fi
-          
+
           if file test_combined.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Combined features binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 27: EXE binary with String Encryption
           echo ""
           echo "=== Test 27: EXE binary with String Encryption (AES encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_string_encryption.exe -e aes --with-string-encryption
-          
+
           if [ ! -f "test_string_encryption.exe" ]; then
             echo "Error: Binary 'test_string_encryption.exe' was not created"
             exit 1
           fi
-          
+
           if file test_string_encryption.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ String Encryption binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 28: DLL binary with String Encryption
           echo ""
           echo "=== Test 28: DLL binary with String Encryption (XOR encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_string_encryption.dll -b dll -e xor --with-string-encryption --technique crt --process notepad.exe
-          
+
           if [ ! -f "test_string_encryption.dll" ]; then
             echo "Error: DLL 'test_string_encryption.dll' was not created"
             exit 1
           fi
-          
+
           if file test_string_encryption.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ String Encryption DLL is a valid PE32+ DLL"
           else
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           # Test 29: EXE binary with Dynamic Function Resolver
           echo ""
           echo "=== Test 29: EXE binary with Dynamic Function Resolver (XOR encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_resolver.exe -e xor --with-dynamic-function-resolver --technique create-fiber
-          
+
           if [ ! -f "test_dynamic_resolver.exe" ]; then
             echo "Error: Binary 'test_dynamic_resolver.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynamic_resolver.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic Function Resolver binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 30: DLL binary with Dynamic Function Resolver
           echo ""
           echo "=== Test 30: DLL binary with Dynamic Function Resolver (AES encryption) ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_resolver.dll -b dll -e aes --with-dynamic-function-resolver --technique crt --process notepad.exe
-          
+
           if [ ! -f "test_dynamic_resolver.dll" ]; then
             echo "Error: DLL 'test_dynamic_resolver.dll' was not created"
             exit 1
           fi
-          
+
           if file test_dynamic_resolver.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ Dynamic Function Resolver DLL is a valid PE32+ DLL"
           else
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           # Test 31: Multiple techniques with Dynamic Function Resolver
           echo ""
           echo "=== Test 31: Testing Dynamic Function Resolver with multiple techniques ==="
-          
+
           echo "Testing EnumCalendar technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_enum.exe -e xor --with-dynamic-function-resolver --technique enum-calendar
           if [ -f "test_dynamic_enum.exe" ] && file test_dynamic_enum.exe | grep -q "PE32+ executable"; then
             echo "✓ EnumCalendar with dynamic resolver works"
           fi
-          
+
           echo "Testing SetTimer technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_timer.exe -e aes --with-dynamic-function-resolver --technique set-timer
           if [ -f "test_dynamic_timer.exe" ] && file test_dynamic_timer.exe | grep -q "PE32+ executable"; then
             echo "✓ SetTimer with dynamic resolver works"
           fi
-          
+
           echo "Testing Syscall technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_syscall.exe -e chacha20 --with-dynamic-function-resolver --technique syscall
           if [ -f "test_dynamic_syscall.exe" ] && file test_dynamic_syscall.exe | grep -q "PE32+ executable"; then
             echo "✓ Syscall with dynamic resolver works"
           fi
-          
+
           echo "Testing Etwp technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_etwp.exe -e blowfish --with-dynamic-function-resolver --technique etwp
           if [ -f "test_dynamic_etwp.exe" ] && file test_dynamic_etwp.exe | grep -q "PE32+ executable"; then
             echo "✓ Etwp with dynamic resolver works"
           fi
-          
+
           echo "Testing NtCreateThreadEx technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_nt.exe -e xor --with-dynamic-function-resolver --technique nt-create-thread-ex
           if [ -f "test_dynamic_nt.exe" ] && file test_dynamic_nt.exe | grep -q "PE32+ executable"; then
             echo "✓ NtCreateThreadEx with dynamic resolver works"
           fi
-          
+
           echo "Testing CRTx technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_crtx.exe -e aes --with-dynamic-function-resolver --technique crtx --process cmd.exe
           if [ -f "test_dynamic_crtx.exe" ] && file test_dynamic_crtx.exe | grep -q "PE32+ executable"; then
             echo "✓ CRTx with dynamic resolver works"
           fi
-          
+
           echo "Testing ProcessHollowing technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_hollowing.exe -e xor --with-dynamic-function-resolver --technique process-hollowing --process notepad.exe
           if [ -f "test_dynamic_hollowing.exe" ] && file test_dynamic_hollowing.exe | grep -q "PE32+ executable"; then
             echo "✓ ProcessHollowing with dynamic resolver works"
           fi
-          
+
           echo "Testing EnumWindows technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_enum_windows.exe -e aes --with-dynamic-function-resolver --technique enum-windows
           if [ -f "test_dynamic_enum_windows.exe" ] && file test_dynamic_enum_windows.exe | grep -q "PE32+ executable"; then
             echo "✓ EnumWindows with dynamic resolver works"
           fi
-          
+
           echo "Testing EnumSystemLocales technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_enum_locales.exe -e chacha20 --with-dynamic-function-resolver --technique enum-system-locales
           if [ -f "test_dynamic_enum_locales.exe" ] && file test_dynamic_enum_locales.exe | grep -q "PE32+ executable"; then
             echo "✓ EnumSystemLocales with dynamic resolver works"
           fi
-          
+
           echo "Testing QueueUserAPC technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_queue_apc.exe -e blowfish --with-dynamic-function-resolver --technique queue-user-apc
           if [ -f "test_dynamic_queue_apc.exe" ] && file test_dynamic_queue_apc.exe | grep -q "PE32+ executable"; then
             echo "✓ QueueUserAPC with dynamic resolver works"
           fi
-          
+
           echo "Testing ImageGetDigestStream technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_image_digest.exe -e xor --with-dynamic-function-resolver --technique image-get-digest-stream
           if [ -f "test_dynamic_image_digest.exe" ] && file test_dynamic_image_digest.exe | grep -q "PE32+ executable"; then
             echo "✓ ImageGetDigestStream with dynamic resolver works"
           fi
-          
+
           # Test 32: Fairy-Law technique (privilege escalation)
           echo ""
           echo "=== Test 32: EXE binary with Fairy-Law technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_fairy_law.exe -e aes --technique fairy-law
-          
+
           if [ ! -f "test_fairy_law.exe" ]; then
             echo "Error: Binary 'test_fairy_law.exe' was not created"
             exit 1
           fi
-          
+
           if file test_fairy_law.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Fairy-Law technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 33: Fairy-Law with ChaCha20 encryption
           echo ""
           echo "=== Test 33: Fairy-Law with ChaCha20 encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_fairy_law_chacha.exe -e chacha20 --technique fairy-law
-          
+
           if [ ! -f "test_fairy_law_chacha.exe" ]; then
             echo "Error: Binary 'test_fairy_law_chacha.exe' was not created"
             exit 1
           fi
-          
+
           if file test_fairy_law_chacha.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Fairy-Law with ChaCha20 binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 34: Fairy-Law with Dynamic Function Resolver
           echo ""
           echo "=== Test 34: Fairy-Law with Dynamic Function Resolver ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_fairy_law_dynamic.exe -e xor --with-dynamic-function-resolver --technique fairy-law
-          
+
           if [ ! -f "test_fairy_law_dynamic.exe" ]; then
             echo "Error: Binary 'test_fairy_law_dynamic.exe' was not created"
             exit 1
           fi
-          
+
           if file test_fairy_law_dynamic.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Fairy-Law with dynamic resolver is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 35: Fairy-Law with AMSI Patch
           echo ""
           echo "=== Test 35: Fairy-Law with AMSI Patch ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_fairy_law_amsi.exe -e blowfish --technique fairy-law --with-amsi-patch
-          
+
           if [ ! -f "test_fairy_law_amsi.exe" ]; then
             echo "Error: Binary 'test_fairy_law_amsi.exe' was not created"
             exit 1
           fi
-          
+
           if file test_fairy_law_amsi.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Fairy-Law with AMSI Patch is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 36: Fairy-Law with combined evasion features
           echo ""
           echo "=== Test 36: Fairy-Law with API Hammering and String Encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_fairy_law_combined.exe -e aes256 --technique fairy-law --with-api-hammering --with-string-encryption
-          
+
           if [ ! -f "test_fairy_law_combined.exe" ]; then
             echo "Error: Binary 'test_fairy_law_combined.exe' was not created"
             exit 1
           fi
-          
+
           if file test_fairy_law_combined.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Fairy-Law with combined features is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 37: Fairy-Law DLL generation
           echo ""
           echo "=== Test 37: DLL binary with Fairy-Law technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_fairy_law.dll -b dll -e twofish --technique fairy-law
-          
+
           if [ ! -f "test_fairy_law.dll" ]; then
             echo "Error: DLL 'test_fairy_law.dll' was not created"
             exit 1
           fi
-          
+
           if file test_fairy_law.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
             echo "✓ Fairy-Law technique DLL is a valid PE32+ DLL"
           else
             echo "Error: File is not a Windows PE DLL"
             exit 1
           fi
-          
+
           echo ""
           echo "Testing Fairy-Law technique..."
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynamic_fairy_law.exe -e camellia --with-dynamic-function-resolver --technique fairy-law
           if [ -f "test_dynamic_fairy_law.exe" ] && file test_dynamic_fairy_law.exe | grep -q "PE32+ executable"; then
             echo "✓ Fairy-Law with dynamic resolver works"
           fi
-          
+
+          # Test: Low-resource mode
+          echo ""
+          echo "=== Test: EXE binary with low-resource mode ==="
+          ../target/release/myph_v2 -s test_shellcode.raw -f test_low_resources.exe -e aes --technique create-fiber --low-resources
+
+          if [ ! -f "test_low_resources.exe" ]; then
+            echo "Error: Binary 'test_low_resources.exe' was not created"
+            exit 1
+          fi
+
+          if file test_low_resources.exe | grep -q "PE32+ executable.*MS Windows"; then
+            echo "✓ Low-resource mode binary is a valid PE32+ executable"
+          else
+            echo "Error: File is not a Windows PE executable"
+            exit 1
+          fi
+
+          # Test: Low-resource mode with DLL
+          echo ""
+          echo "=== Test: DLL binary with low-resource mode ==="
+          ../target/release/myph_v2 -s test_shellcode.raw -f test_low_resources.dll -b dll -e xor --technique crt --process notepad.exe --low-resources
+
+          if [ ! -f "test_low_resources.dll" ]; then
+            echo "Error: DLL 'test_low_resources.dll' was not created"
+            exit 1
+          fi
+
+          if file test_low_resources.dll | grep -q "PE32+ executable.*DLL.*MS Windows"; then
+            echo "✓ Low-resource mode DLL is a valid PE32+ DLL"
+          else
+            echo "Error: File is not a Windows PE DLL"
+            exit 1
+          fi
+
           echo ""
           echo "✓ All end-to-end tests passed!"
-          
+
           # Test 32: Module Stomping technique
           echo ""
           echo "=== Test 32: EXE binary with Module Stomping technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_module_stomping.exe -e aes --technique module-stomping
-          
+
           if [ ! -f "test_module_stomping.exe" ]; then
             echo "Error: Binary 'test_module_stomping.exe' was not created"
             exit 1
           fi
-          
+
           if file test_module_stomping.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Module Stomping technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 33: Thread Hijacking technique
           echo ""
           echo "=== Test 33: EXE binary with Thread Hijacking technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_thread_hijacking.exe -e chacha20 --technique thread-hijacking --process notepad.exe
-          
+
           if [ ! -f "test_thread_hijacking.exe" ]; then
             echo "Error: Binary 'test_thread_hijacking.exe' was not created"
             exit 1
           fi
-          
+
           if file test_thread_hijacking.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Thread Hijacking technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 34: Early Bird APC technique
           echo ""
           echo "=== Test 34: EXE binary with Early Bird APC technique ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_early_bird.exe -e xor --technique early-bird --process cmd.exe
-          
+
           if [ ! -f "test_early_bird.exe" ]; then
             echo "Error: Binary 'test_early_bird.exe' was not created"
             exit 1
           fi
-          
+
           if file test_early_bird.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Early Bird APC technique binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 35: Anti-VM evasion
           echo ""
           echo "=== Test 35: EXE binary with Anti-VM evasion ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_anti_vm.exe -e aes --technique create-fiber --with-anti-vm
-          
+
           if [ ! -f "test_anti_vm.exe" ]; then
             echo "Error: Binary 'test_anti_vm.exe' was not created"
             exit 1
           fi
-          
+
           if file test_anti_vm.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Anti-VM evasion binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 36: Anti-Sandbox evasion
           echo ""
           echo "=== Test 36: EXE binary with Anti-Sandbox evasion ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_anti_sandbox.exe -e chacha20 --technique syscall --with-anti-sandbox
-          
+
           if [ ! -f "test_anti_sandbox.exe" ]; then
             echo "Error: Binary 'test_anti_sandbox.exe' was not created"
             exit 1
           fi
-          
+
           if file test_anti_sandbox.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Anti-Sandbox evasion binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 37: Anti-Debugger evasion
           echo ""
           echo "=== Test 37: EXE binary with Anti-Debugger evasion ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_anti_debugger.exe -e xor --technique enum-calendar --with-anti-debugger
-          
+
           if [ ! -f "test_anti_debugger.exe" ]; then
             echo "Error: Binary 'test_anti_debugger.exe' was not created"
             exit 1
           fi
-          
+
           if file test_anti_debugger.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Anti-Debugger evasion binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 38: Combined evasion features
           echo ""
           echo "=== Test 38: EXE binary with combined evasion features ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_all_evasion.exe -e aes --technique module-stomping \
             --with-anti-vm --with-anti-sandbox --with-anti-debugger --with-amsi-patch --with-string-encryption
-          
+
           if [ ! -f "test_all_evasion.exe" ]; then
             echo "Error: Binary 'test_all_evasion.exe' was not created"
             exit 1
           fi
-          
+
           if file test_all_evasion.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Combined evasion features binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 39: Call stack spoofing alone
           echo ""
           echo "=== Test 39: EXE binary with call stack spoofing ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_callstack_spoofing.exe -e xor --technique create-fiber --with-callstack-spoofing
-          
+
           if [ ! -f "test_callstack_spoofing.exe" ]; then
             echo "Error: Binary 'test_callstack_spoofing.exe' was not created"
             exit 1
           fi
-          
+
           if file test_callstack_spoofing.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Call stack spoofing binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 40: Call stack spoofing with dynamic resolver
           echo ""
           echo "=== Test 40: EXE binary with call stack spoofing and dynamic resolver ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_callstack_dynamic.exe -e aes --technique syscall \
             --with-callstack-spoofing --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_callstack_dynamic.exe" ]; then
             echo "Error: Binary 'test_callstack_dynamic.exe' was not created"
             exit 1
           fi
-          
+
           if file test_callstack_dynamic.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Call stack spoofing with dynamic resolver binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 41: Maximum evasion with call stack spoofing
           echo ""
           echo "=== Test 41: EXE binary with maximum evasion including call stack spoofing ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_max_evasion.exe -e chacha20 --technique early-bird --process cmd.exe \
             --with-callstack-spoofing --with-dynamic-function-resolver --with-amsi-patch \
             --with-anti-vm --with-anti-sandbox --with-anti-debugger
-          
+
           if [ ! -f "test_max_evasion.exe" ]; then
             echo "Error: Binary 'test_max_evasion.exe' was not created"
             exit 1
           fi
-          
+
           if file test_max_evasion.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Maximum evasion with call stack spoofing binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 29: AMSI Patch with String Encryption
           echo ""
           echo "=== Test 29: AMSI Patch with String Encryption ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_amsi_string_enc.exe -e aes --with-amsi-patch --with-string-encryption
-          
+
           if [ ! -f "test_amsi_string_enc.exe" ]; then
             echo "Error: Binary 'test_amsi_string_enc.exe' was not created"
             exit 1
           fi
-          
+
           if file test_amsi_string_enc.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ AMSI Patch with String Encryption binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 30: AMSI Patch with Dynamic Function Resolver
           echo ""
           echo "=== Test 30: AMSI Patch with Dynamic Function Resolver ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_amsi_dynamic.exe -e xor --with-amsi-patch --with-dynamic-function-resolver --technique create-fiber
-          
+
           if [ ! -f "test_amsi_dynamic.exe" ]; then
             echo "Error: Binary 'test_amsi_dynamic.exe' was not created"
             exit 1
           fi
-          
+
           if file test_amsi_dynamic.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ AMSI Patch with Dynamic Function Resolver binary is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 31: AMSI Patch with both String Encryption and Dynamic Function Resolver
           echo ""
           echo "=== Test 31: AMSI Patch with String Encryption and Dynamic Function Resolver ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_amsi_both.exe -e chacha20 --with-amsi-patch --with-string-encryption --with-dynamic-function-resolver --technique syscall
-          
+
           if [ ! -f "test_amsi_both.exe" ]; then
             echo "Error: Binary 'test_amsi_both.exe' was not created"
             exit 1
           fi
-          
+
           if file test_amsi_both.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ AMSI Patch with both String Encryption and Dynamic Function Resolver is a valid PE32+ executable"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           echo ""
           echo "✓ All end-to-end tests passed!"
-          
+
           # Test 39: Dynamic Function Resolver with VirtualAlloc (kernel32.dll)
           echo ""
           echo "=== Test 39: Dynamic Function Resolver with VirtualAlloc ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_virtualalloc.exe -e aes --technique create-fiber --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_dynres_virtualalloc.exe" ]; then
             echo "Error: Binary 'test_dynres_virtualalloc.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_virtualalloc.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with VirtualAlloc (kernel32.dll) works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Verify no static imports for key APIs
           if ! strings test_dynres_virtualalloc.exe | grep -q "VirtualAlloc"; then
             echo "✓ VirtualAlloc not found in static strings (dynamically resolved)"
           else
             echo "⚠ Warning: VirtualAlloc found in binary strings"
           fi
-          
+
           # Test 40: Dynamic Function Resolver with CreateProcess (kernel32.dll)
           echo ""
           echo "=== Test 40: Dynamic Function Resolver with CreateProcess ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_createprocess.exe -e chacha20 --technique thread-hijacking --process notepad.exe --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_dynres_createprocess.exe" ]; then
             echo "Error: Binary 'test_dynres_createprocess.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_createprocess.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with CreateProcess works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 41: Dynamic Function Resolver with QueueUserAPC (kernel32.dll)
           echo ""
           echo "=== Test 41: Dynamic Function Resolver with QueueUserAPC ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_queueapc.exe -e xor --technique queue-user-apc --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_dynres_queueapc.exe" ]; then
             echo "Error: Binary 'test_dynres_queueapc.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_queueapc.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with QueueUserAPC works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 42: Dynamic Function Resolver with NtCreateThreadEx (ntdll.dll)
           echo ""
           echo "=== Test 42: Dynamic Function Resolver with NtCreateThreadEx ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_ntapi.exe -e aes --technique nt-create-thread-ex --process cmd.exe --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_dynres_ntapi.exe" ]; then
             echo "Error: Binary 'test_dynres_ntapi.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_ntapi.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with NtCreateThreadEx (ntdll.dll) works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Test 43: Dynamic Function Resolver + String Encryption + AMSI Patch
           echo ""
           echo "=== Test 43: Dynamic Resolver with String Encryption and AMSI Patch ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_full_evasion.exe -e aes --technique create-fiber \
             --with-dynamic-function-resolver --with-string-encryption --with-amsi-patch
-          
+
           if [ ! -f "test_dynres_full_evasion.exe" ]; then
             echo "Error: Binary 'test_dynres_full_evasion.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_full_evasion.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with full evasion (string encryption + AMSI patch) works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           # Verify encrypted function names
           if ! strings test_dynres_full_evasion.exe | grep -q "AmsiScanBuffer"; then
             echo "✓ AmsiScanBuffer not found in static strings (encrypted)"
           else
             echo "⚠ Warning: AmsiScanBuffer found in binary strings"
           fi
-          
+
           # Test 44: Dynamic Function Resolver with all new techniques
           echo ""
           echo "=== Test 44: Dynamic Resolver with ModuleStomping ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_module_stomping.exe -e xor --technique module-stomping --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_dynres_module_stomping.exe" ]; then
             echo "Error: Binary 'test_dynres_module_stomping.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_module_stomping.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with ModuleStomping works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           echo ""
           echo "=== Test 45: Dynamic Resolver with EarlyBird ==="
           ../target/release/myph_v2 -s test_shellcode.raw -f test_dynres_early_bird.exe -e aes --technique early-bird --process notepad.exe --with-dynamic-function-resolver
-          
+
           if [ ! -f "test_dynres_early_bird.exe" ]; then
             echo "Error: Binary 'test_dynres_early_bird.exe' was not created"
             exit 1
           fi
-          
+
           if file test_dynres_early_bird.exe | grep -q "PE32+ executable.*MS Windows"; then
             echo "✓ Dynamic resolver with EarlyBird works"
           else
             echo "Error: File is not a Windows PE executable"
             exit 1
           fi
-          
+
           echo "✓ Tested 7 encryption algorithms (AES-128, AES-256, ChaCha20, Twofish, Camellia, Blowfish, XOR)"
           echo "✓ Tested 3 binary formats (EXE, DLL, LNK)"
           echo "✓ Tested LNK format with 3 encryption methods (AES, XOR, ChaCha20) on Linux"
@@ -1482,17 +1516,17 @@ jobs:
         shell: pwsh
         run: |
           echo "=== Running Windows End-to-End Tests ==="
-          
+
           # Create test directory
           New-Item -ItemType Directory -Force -Path e2e-test | Out-Null
-          
+
           # Create msf.raw with NOP instructions (8 NOPs + RET)
           $nopShellcode = @(0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0xC3)
           [System.IO.File]::WriteAllBytes("e2e-test\msf.raw", $nopShellcode)
           Write-Host "✓ Created msf.raw with NOP shellcode ($($nopShellcode.Length) bytes)"
-          
+
           Set-Location e2e-test
-          
+
           # Test 1: AES encryption with create-fiber
           Write-Host ""
           Write-Host "=== Test 1: AES encryption with create-fiber ==="
@@ -1511,7 +1545,7 @@ jobs:
             Write-Host "✗ Failed to generate test_aes_fiber.exe"
             exit 1
           }
-          
+
           # Test 2: XOR encryption with enum-calendar
           Write-Host ""
           Write-Host "=== Test 2: XOR encryption with enum-calendar ==="
@@ -1530,7 +1564,7 @@ jobs:
             Write-Host "✗ Failed to generate test_xor_enum.exe"
             exit 1
           }
-          
+
           # Test 3: ChaCha20 encryption with set-timer
           Write-Host ""
           Write-Host "=== Test 3: ChaCha20 encryption with set-timer ==="
@@ -1549,7 +1583,7 @@ jobs:
             Write-Host "✗ Failed to generate test_chacha_timer.exe"
             exit 1
           }
-          
+
           # Test 4: Blowfish encryption with syscall
           Write-Host ""
           Write-Host "=== Test 4: Blowfish encryption with syscall ==="
@@ -1568,7 +1602,7 @@ jobs:
             Write-Host "✗ Failed to generate test_blowfish_syscall.exe"
             exit 1
           }
-          
+
           # Test 5: AES with API hammering
           Write-Host ""
           Write-Host "=== Test 5: AES with API hammering ==="
@@ -1587,7 +1621,7 @@ jobs:
             Write-Host "✗ Failed to generate test_aes_hammer.exe"
             exit 1
           }
-          
+
           # Test 6: XOR with AMSI patch
           Write-Host ""
           Write-Host "=== Test 6: XOR with AMSI patch ==="
@@ -1606,7 +1640,7 @@ jobs:
             Write-Host "✗ Failed to generate test_xor_amsi.exe"
             exit 1
           }
-          
+
           # Test 7: ChaCha20 with string encryption
           Write-Host ""
           Write-Host "=== Test 7: ChaCha20 with string encryption ==="
@@ -1625,7 +1659,7 @@ jobs:
             Write-Host "✗ Failed to generate test_chacha_strenc.exe"
             exit 1
           }
-          
+
           # Test 8: XOR with dynamic function resolver (XOR works with dynamic resolver)
           Write-Host ""
           Write-Host "=== Test 8: XOR with dynamic function resolver ==="
@@ -1644,7 +1678,7 @@ jobs:
             Write-Host "✗ Failed to generate test_xor_dynres.exe"
             exit 1
           }
-          
+
           # Test 9: DLL generation
           Write-Host ""
           Write-Host "=== Test 9: DLL generation ==="
@@ -1655,7 +1689,7 @@ jobs:
             Write-Host "✗ Failed to generate test_output.dll"
             exit 1
           }
-          
+
           # Test 10: Combined features (API hammering + AMSI patch)
           Write-Host ""
           Write-Host "=== Test 10: Combined features (API hammering + AMSI patch) ==="
@@ -1674,7 +1708,7 @@ jobs:
             Write-Host "✗ Failed to generate test_combined.exe"
             exit 1
           }
-          
+
           # Test 11: LNK file generation with AES encryption
           Write-Host ""
           Write-Host "=== Test 11: LNK file with AES encryption ==="
@@ -1687,7 +1721,7 @@ jobs:
             Write-Host "✗ Failed to generate test_output.lnk"
             exit 1
           }
-          
+
           # Test 12: LNK file with XOR encryption
           Write-Host ""
           Write-Host "=== Test 12: LNK file with XOR encryption ==="
@@ -1698,7 +1732,7 @@ jobs:
             Write-Host "✗ Failed to generate test_xor.lnk"
             exit 1
           }
-          
+
           # Test 13: LNK file with ChaCha20 encryption
           Write-Host ""
           Write-Host "=== Test 13: LNK file with ChaCha20 encryption ==="
@@ -1709,7 +1743,26 @@ jobs:
             Write-Host "✗ Failed to generate test_chacha.lnk"
             exit 1
           }
-          
+
+          # Test 14: Low-resource mode
+          Write-Host ""
+          Write-Host "=== Test 14: Low-resource mode ==="
+          ..\target\release\myph_v2.exe -s .\msf.raw -f test_low_resources.exe -e aes -t create-fiber --low-resources
+          if (Test-Path "test_low_resources.exe") {
+            Write-Host "✓ Generated test_low_resources.exe with low-resource mode"
+            $env:RUST_BACKTRACE=1
+            & .\test_low_resources.exe
+            if ($LASTEXITCODE -eq 0) {
+              Write-Host "✓ test_low_resources.exe executed successfully"
+            } else {
+              Write-Host "✗ test_low_resources.exe failed with exit code $LASTEXITCODE"
+              exit 1
+            }
+          } else {
+            Write-Host "✗ Failed to generate test_low_resources.exe"
+            exit 1
+          }
+
           Write-Host ""
           Write-Host "=== All Windows E2E Tests Passed ==="
           Write-Host "✓ Tested 4 encryption methods (AES, XOR, ChaCha20, Blowfish)"
@@ -1729,6 +1782,7 @@ jobs:
           echo "✓ Verified no static API imports (strings check)"
           Write-Host "✓ Tested String Encryption feature"
           Write-Host "✓ Tested Dynamic Function Resolver feature"
+          Write-Host "✓ Tested Low-resource mode"
           Write-Host "✓ Tested DLL generation"
           Write-Host "✓ Tested combined features"
           Write-Host "✓ All generated binaries executed successfully without crashes"
diff --git a/README.md b/README.md
@@ -38,6 +38,7 @@ This tool is designed for **security research and authorized penetration testing
 - [Usage](#usage)
 - [Injection Techniques](#injection-techniques)
 - [Encryption Methods](#encryption-methods)
+- [Low-Resource Build Mode](#low-resource-build-mode)
 - [Development](#development)
 - [CI/CD](#cicd)
 - [Architecture](#architecture)
@@ -204,6 +205,9 @@ Evasion:
   --with-anti-sandbox         Enable anti-sandbox detection checks
   --with-anti-debugger        Enable anti-debugger detection checks
   --with-callstack-spoofing   Enable call stack spoofing (requires NASM)
+
+Build:
+  --low-resources             Use low-resource build profile (for VMs with limited RAM)
 ```
 
 ---
@@ -508,6 +512,41 @@ nasm --version
 
 ---
 
+## Low-Resource Build Mode
+
+When running myph-v2 on VMs or systems with limited RAM, the standard build profile may cause out-of-memory errors due to cargo's aggressive optimization settings. The `--low-resources` flag enables a more memory-efficient build profile.
+
+### Standard vs Low-Resource Profile
+
+| Setting | Standard | Low-Resource |
+|---------|----------|--------------|
+| LTO | Full (`true`) | Thin (`"thin"`) |
+| Codegen Units | 1 | 16 |
+| Opt Level | `"z"` (size) | `"s"` (moderate) |
+| Parallel Jobs | Unlimited | 2 |
+
+### Usage
+
+```bash
+# Enable low-resource mode
+myph_v2 -s payload.bin -f output.exe -e aes -t create-fiber --low-resources
+
+# Combine with other options
+myph_v2 -s payload.bin -f output.exe -e chacha20 -t syscall \
+  --with-string-encryption --low-resources
+```
+
+### Tradeoffs
+
+- **Binary size**: ~10-30% larger than standard profile
+- **Build time**: May be faster due to parallelization
+- **Memory usage**: Significantly reduced during compilation
+- **Runtime performance**: Negligible difference for typical shellcode loaders
+
+Use this flag when building on resource-constrained environments (VMs, CI runners, containers).
+
+---
+
 ## Development
 
 ### Building
diff --git a/src/cli/mod.rs b/src/cli/mod.rs
@@ -140,6 +140,10 @@ pub struct Options {
     /// Check compatibility of technique with selected features and display information
     #[arg(long = "check-compatibility")]
     pub check_compatibility: bool,
+
+    /// Use low-resource build profile (reduced memory/CPU usage, larger binary)
+    #[arg(long = "low-resources")]
+    pub low_resources: bool,
 }
 
 impl Options {
@@ -519,4 +523,18 @@ mod tests {
         let opts = Options::parse_from(args);
         assert!(!opts.with_callstack_spoofing);
     }
+
+    #[test]
+    fn test_with_low_resources_flag() {
+        let args = vec!["myph", "--low-resources"];
+        let opts = Options::parse_from(args);
+        assert!(opts.low_resources);
+    }
+
+    #[test]
+    fn test_without_low_resources_flag() {
+        let args = vec!["myph"];
+        let opts = Options::parse_from(args);
+        assert!(!opts.low_resources);
+    }
 }
diff --git a/src/internals/loader.rs b/src/internals/loader.rs
@@ -61,6 +61,7 @@ pub struct BuildConfig<'a> {
     pub with_anti_sandbox: bool,
     pub with_anti_debugger: bool,
     pub with_callstack_spoofing: bool,
+    pub low_resources: bool,
 }
 
 pub struct BuildEnv<'a> {
@@ -81,6 +82,7 @@ pub struct BuildEnv<'a> {
     with_anti_sandbox: bool,
     with_anti_debugger: bool,
     with_callstack_spoofing: bool,
+    low_resources: bool,
 }
 
 impl<'a> BuildEnv<'a> {
@@ -103,6 +105,7 @@ impl<'a> BuildEnv<'a> {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         }
     }
 
@@ -187,6 +190,11 @@ impl<'a> BuildEnv<'a> {
         self
     }
 
+    pub fn with_low_resources(mut self, enabled: bool) -> Self {
+        self.low_resources = enabled;
+        self
+    }
+
     pub fn build(self) -> io::Result<PathBuf> {
         let project_name = self
             .project_name
@@ -228,6 +236,7 @@ impl<'a> BuildEnv<'a> {
             with_anti_sandbox: self.with_anti_sandbox,
             with_anti_debugger: self.with_anti_debugger,
             with_callstack_spoofing: self.with_callstack_spoofing,
+            low_resources: self.low_resources,
         };
 
         setup_and_build_project(&config)
@@ -257,8 +266,9 @@ fn init_rust_project_with_target(config: &BuildConfig) -> io::Result<()> {
         encryption_type_str,
         config.with_dynamic_function_resolver,
         config.with_callstack_spoofing,
+        config.low_resources,
     )?;
-    write_cargo_config()?;
+    write_cargo_config(config.low_resources)?;
 
     fs::create_dir_all("src")?;
 
@@ -348,7 +358,10 @@ fn write_cargo_toml(
     encryption_type: &str,
     with_dynamic_resolver: bool,
     with_callstack_spoofing: bool,
+    low_resources: bool,
 ) -> io::Result<()> {
+    use super::templates::{BuildProfile, CargoConfigGenerator, DllGenerator, ExeGenerator};
+
     let dependencies = super::dependencies::get_dependencies(
         encryption_type,
         with_dynamic_resolver,
@@ -356,17 +369,36 @@ fn write_cargo_toml(
     )
     .map_err(io::Error::other)?;
 
+    let profile = if low_resources {
+        BuildProfile::LowResource
+    } else {
+        BuildProfile::Standard
+    };
+
     let cargo_toml = match binary_format {
-        BinaryFormat::Exe => super::templates::generate_cargo_toml_exe(project_name, &dependencies),
-        BinaryFormat::Dll => super::templates::generate_cargo_toml_dll(project_name, &dependencies),
-        BinaryFormat::Lnk => return Ok(()), // LNK doesn't need Cargo.toml
+        BinaryFormat::Exe => {
+            ExeGenerator::new(profile).generate_cargo_toml(project_name, &dependencies)
+        }
+        BinaryFormat::Dll => {
+            DllGenerator::new(profile).generate_cargo_toml(project_name, &dependencies)
+        }
+        BinaryFormat::Lnk => return Ok(()),
     };
     fs::write("Cargo.toml", cargo_toml)
 }
 
-fn write_cargo_config() -> io::Result<()> {
+fn write_cargo_config(low_resources: bool) -> io::Result<()> {
+    use super::templates::{BuildProfile, CargoConfigGenerator, ExeGenerator};
+
     fs::create_dir_all(".cargo")?;
-    let cargo_config = super::templates::generate_cargo_config();
+
+    let profile = if low_resources {
+        BuildProfile::LowResource
+    } else {
+        BuildProfile::Standard
+    };
+
+    let cargo_config = ExeGenerator::new(profile).generate_cargo_config();
     fs::write(".cargo/config.toml", cargo_config)
 }
 
@@ -1024,6 +1056,7 @@ fn init_rust_project_for_test(
         encryption_type_str,
         false,
         false,
+        false,
     )?;
 
     fs::create_dir_all("src")?;
@@ -1118,6 +1151,7 @@ mod tests {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         };
 
         let result = init_rust_project(&config);
@@ -1181,6 +1215,7 @@ mod tests {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         };
 
         init_rust_project_with_target(&config).unwrap();
@@ -1355,6 +1390,7 @@ mod tests {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         };
 
         init_rust_project_with_target(&config).unwrap();
@@ -1447,6 +1483,7 @@ mod tests {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         };
 
         init_rust_project_with_target(&config).unwrap();
@@ -1504,6 +1541,7 @@ mod tests {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         };
 
         let result = init_rust_project(&config);
@@ -1564,6 +1602,7 @@ mod tests {
             with_anti_sandbox: false,
             with_anti_debugger: false,
             with_callstack_spoofing: false,
+            low_resources: false,
         };
 
         let result = init_rust_project(&config);
diff --git a/src/internals/templates/cargo_config.rs b/src/internals/templates/cargo_config.rs
@@ -1,49 +1,273 @@
-/// Generate Cargo.toml template for EXE binaries
-pub fn generate_cargo_toml_exe(project_name: &str, dependencies: &str) -> String {
-    format!(
-        r#"[package]
-name = "{}"
+#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
+pub enum BuildProfile {
+    #[default]
+    Standard,
+    LowResource,
+}
+
+impl BuildProfile {
+    pub fn lto_setting(&self) -> &'static str {
+        match self {
+            BuildProfile::Standard => "true",
+            BuildProfile::LowResource => "\"thin\"",
+        }
+    }
+
+    pub fn codegen_units(&self) -> u32 {
+        match self {
+            BuildProfile::Standard => 1,
+            BuildProfile::LowResource => 16,
+        }
+    }
+
+    pub fn opt_level(&self) -> &'static str {
+        match self {
+            BuildProfile::Standard => "\"z\"",
+            BuildProfile::LowResource => "\"s\"",
+        }
+    }
+
+    pub fn parallel_jobs(&self) -> Option<u32> {
+        match self {
+            BuildProfile::Standard => None,
+            BuildProfile::LowResource => Some(2),
+        }
+    }
+}
+
+pub trait CargoConfigGenerator {
+    fn generate_cargo_toml(&self, project_name: &str, dependencies: &str) -> String;
+    fn generate_cargo_config(&self) -> String;
+}
+
+pub struct ExeGenerator {
+    profile: BuildProfile,
+}
+
+impl ExeGenerator {
+    pub fn new(profile: BuildProfile) -> Self {
+        Self { profile }
+    }
+}
+
+impl CargoConfigGenerator for ExeGenerator {
+    fn generate_cargo_toml(&self, project_name: &str, dependencies: &str) -> String {
+        format!(
+            r#"[package]
+name = "{project_name}"
 version = "0.1.0"
 edition = "2021"
 
-[dependencies]{}
+[dependencies]{dependencies}
 
 [profile.release]
 strip = true
-opt-level = "z"
-lto = true
-codegen-units = 1
+opt-level = {opt_level}
+lto = {lto}
+codegen-units = {codegen_units}
 "#,
-        project_name, dependencies
-    )
+            project_name = project_name,
+            dependencies = dependencies,
+            opt_level = self.profile.opt_level(),
+            lto = self.profile.lto_setting(),
+            codegen_units = self.profile.codegen_units(),
+        )
+    }
+
+    fn generate_cargo_config(&self) -> String {
+        match self.profile.parallel_jobs() {
+            Some(jobs) => format!(
+                r#"[build]
+target = "x86_64-pc-windows-gnu"
+jobs = {jobs}
+"#
+            ),
+            None => r#"[build]
+target = "x86_64-pc-windows-gnu"
+"#
+            .to_string(),
+        }
+    }
 }
 
-/// Generate Cargo.toml template for DLL binaries
-pub fn generate_cargo_toml_dll(project_name: &str, dependencies: &str) -> String {
-    format!(
-        r#"[package]
-name = "{}"
+pub struct DllGenerator {
+    profile: BuildProfile,
+}
+
+impl DllGenerator {
+    pub fn new(profile: BuildProfile) -> Self {
+        Self { profile }
+    }
+}
+
+impl CargoConfigGenerator for DllGenerator {
+    fn generate_cargo_toml(&self, project_name: &str, dependencies: &str) -> String {
+        format!(
+            r#"[package]
+name = "{project_name}"
 version = "0.1.0"
 edition = "2021"
 
 [lib]
 crate-type = ["cdylib"]
 
-[dependencies]{}
+[dependencies]{dependencies}
 
 [profile.release]
 strip = true
-opt-level = "z"
-lto = true
-codegen-units = 1
+opt-level = {opt_level}
+lto = {lto}
+codegen-units = {codegen_units}
 "#,
-        project_name, dependencies
-    )
+            project_name = project_name,
+            dependencies = dependencies,
+            opt_level = self.profile.opt_level(),
+            lto = self.profile.lto_setting(),
+            codegen_units = self.profile.codegen_units(),
+        )
+    }
+
+    fn generate_cargo_config(&self) -> String {
+        match self.profile.parallel_jobs() {
+            Some(jobs) => format!(
+                r#"[build]
+target = "x86_64-pc-windows-gnu"
+jobs = {jobs}
+"#
+            ),
+            None => r#"[build]
+target = "x86_64-pc-windows-gnu"
+"#
+            .to_string(),
+        }
+    }
+}
+
+pub fn generate_cargo_toml_exe(project_name: &str, dependencies: &str) -> String {
+    ExeGenerator::new(BuildProfile::Standard).generate_cargo_toml(project_name, dependencies)
+}
+
+pub fn generate_cargo_toml_dll(project_name: &str, dependencies: &str) -> String {
+    DllGenerator::new(BuildProfile::Standard).generate_cargo_toml(project_name, dependencies)
 }
 
-/// Generate .cargo/config.toml template
 pub fn generate_cargo_config() -> &'static str {
     r#"[build]
 target = "x86_64-pc-windows-gnu"
 "#
 }
+
+#[cfg(test)]
+mod tests {
+    use super::*;
+
+    #[test]
+    fn standard_profile_uses_full_lto() {
+        let profile = BuildProfile::Standard;
+        assert_eq!(profile.lto_setting(), "true");
+    }
+
+    #[test]
+    fn standard_profile_uses_single_codegen_unit() {
+        let profile = BuildProfile::Standard;
+        assert_eq!(profile.codegen_units(), 1);
+    }
+
+    #[test]
+    fn standard_profile_uses_size_optimization() {
+        let profile = BuildProfile::Standard;
+        assert_eq!(profile.opt_level(), "\"z\"");
+    }
+
+    #[test]
+    fn standard_profile_has_no_job_limit() {
+        let profile = BuildProfile::Standard;
+        assert_eq!(profile.parallel_jobs(), None);
+    }
+
+    #[test]
+    fn low_resource_profile_uses_thin_lto() {
+        let profile = BuildProfile::LowResource;
+        assert_eq!(profile.lto_setting(), "\"thin\"");
+    }
+
+    #[test]
+    fn low_resource_profile_uses_multiple_codegen_units() {
+        let profile = BuildProfile::LowResource;
+        assert_eq!(profile.codegen_units(), 16);
+    }
+
+    #[test]
+    fn low_resource_profile_uses_moderate_optimization() {
+        let profile = BuildProfile::LowResource;
+        assert_eq!(profile.opt_level(), "\"s\"");
+    }
+
+    #[test]
+    fn low_resource_profile_limits_parallel_jobs() {
+        let profile = BuildProfile::LowResource;
+        assert_eq!(profile.parallel_jobs(), Some(2));
+    }
+
+    #[test]
+    fn exe_generator_includes_profile_settings() {
+        let generator = ExeGenerator::new(BuildProfile::Standard);
+        let toml = generator.generate_cargo_toml("test_project", "");
+
+        assert!(toml.contains("lto = true"));
+        assert!(toml.contains("codegen-units = 1"));
+        assert!(toml.contains("opt-level = \"z\""));
+    }
+
+    #[test]
+    fn exe_generator_low_resource_includes_adjusted_settings() {
+        let generator = ExeGenerator::new(BuildProfile::LowResource);
+        let toml = generator.generate_cargo_toml("test_project", "");
+
+        assert!(toml.contains("lto = \"thin\""));
+        assert!(toml.contains("codegen-units = 16"));
+        assert!(toml.contains("opt-level = \"s\""));
+    }
+
+    #[test]
+    fn dll_generator_includes_cdylib_crate_type() {
+        let generator = DllGenerator::new(BuildProfile::Standard);
+        let toml = generator.generate_cargo_toml("test_dll", "");
+
+        assert!(toml.contains("crate-type = [\"cdylib\"]"));
+    }
+
+    #[test]
+    fn dll_generator_low_resource_includes_adjusted_settings() {
+        let generator = DllGenerator::new(BuildProfile::LowResource);
+        let toml = generator.generate_cargo_toml("test_dll", "");
+
+        assert!(toml.contains("lto = \"thin\""));
+        assert!(toml.contains("codegen-units = 16"));
+    }
+
+    #[test]
+    fn cargo_config_standard_has_no_jobs_limit() {
+        let generator = ExeGenerator::new(BuildProfile::Standard);
+        let config = generator.generate_cargo_config();
+
+        assert!(config.contains("target = \"x86_64-pc-windows-gnu\""));
+        assert!(!config.contains("jobs"));
+    }
+
+    #[test]
+    fn cargo_config_low_resource_has_jobs_limit() {
+        let generator = ExeGenerator::new(BuildProfile::LowResource);
+        let config = generator.generate_cargo_config();
+
+        assert!(config.contains("target = \"x86_64-pc-windows-gnu\""));
+        assert!(config.contains("jobs = 2"));
+    }
+
+    #[test]
+    fn legacy_functions_use_standard_profile() {
+        let toml = generate_cargo_toml_exe("legacy_test", "");
+        assert!(toml.contains("lto = true"));
+        assert!(toml.contains("codegen-units = 1"));
+    }
+}
diff --git a/src/main.rs b/src/main.rs
@@ -246,6 +246,15 @@ fn run() -> io::Result<()> {
         "Encryption key should have been auto-generated if not provided by Options::parse_and_generate()",
     );
 
+    if opts.low_resources {
+        println!("  [!] Low-resource mode enabled:");
+        println!("      • Using thin LTO instead of full LTO");
+        println!("      • Using 16 codegen units instead of 1");
+        println!("      • Limiting parallel jobs to 2");
+        println!("      • Binary will be slightly larger (~10-30%)");
+        println!();
+    }
+
     let build_env = internals::BuildEnv::new()
         .with_project_name("temp_project")
         .with_output_name(&opts.out)
@@ -262,7 +271,8 @@ fn run() -> io::Result<()> {
         .with_anti_vm(opts.with_anti_vm)
         .with_anti_sandbox(opts.with_anti_sandbox)
         .with_anti_debugger(opts.with_anti_debugger)
-        .with_callstack_spoofing(opts.with_callstack_spoofing);
+        .with_callstack_spoofing(opts.with_callstack_spoofing)
+        .with_low_resources(opts.low_resources);
 
     build_env
         .build()