I have a basic XOR decoder that functions perfectly in Linux, but when I try to move it over to an exe in windows, it fails. I am leaving this question open for historical reference since the issue persists.here It has been suggested that in the assembly decoder, the .text section is not writeable in windows. How can I make this assembly decoder execute and decode/XOR from the .text section in windows as an exe?
Steps to convert encoder to win 7 64
- nasm -fwin64 Workingwin7messageBoxassembly.nasm -o xorencoder.obj
- Extract shellcode from obj file
- Insert into encoder.nasm
- Assemble encoder nasm -fwin64 encoder.nasm -o xorencoder.obj
- On Windows use golink to create exe. golink \console xorencoder.obj
- run exe and crash.
Tools above have been verified to work to assemble the Workingwin7messageBoxassembly.nasm and create a working exe from golink.
This approach breaks when I include the extracted shellcode from the assembled/linked Workingwin7messageBoxassembly.nasm and try to have the decoder below call and decode the shellcode. The shellcode below in the encoded_shellcode: section is a XORed version of a win 7-64 message box found here. This method has an access violation when trying to XOR the contents of encoded_shellcode:.
I edited the .text section using LordPE to make the .text section in the exe writeable to allow the decoder to read from the .text section to decode. It still fails. How do I get this assembly decoder to decode?