14 September 2025

Hiding a shellcode in an image file or PDF file is a classic steganographic technique used to bypass EDRs. the goal to make the malicious file appear as harmless file like image, so it can be delivered to a target system without any suspicious.
also modern AV/EDR scan memory regions disk artifacts and process behaviors for known signatures. one evasion method is to hide our payload in images png,jpg.
first function ReadFile it does the following:
function encrypts or decrypts data using a simple but effective method called a repeating XOR cipher. The beauty of XOR is that the same operation reverses itself.
function takes a host file (like an image), encrypts your payload, and hides it inside.
the most important function does the reverse of the injection: it finds the hidden payload within a file, extracts it, and decrypts it.
This function is the final step: it extracts the hidden shellcode from a file and runs it directly in memory.
This main function is the "brain" of your program. It reads the commands you type in the terminal and decides what to do.

as we can see this is the malicious image, no EDR was able to detect it, because it is encrypted with XOR.
