PE process creation error
Posted: Sun Mar 01, 2015 12:30 pm
Hi!
I've loaded a PE image into memory, and tried to execute it but failed. The entry point is found and is correct, but when I jump there it triple faults. I've looked at the PE file and at the entry point there are a bunch of zeros (and I have no idea why).
So the code I compiled:
And I don't know what could be wrong (maybe I compiled wrong?). Here is the compiled thing:
https://www.mediafire.com/?xd6y7v31ux198y6
I'm not sure about the compiled file, I use linux and I compiled this on a windows laptop.
Does anyone have an idea what could be the problem?
I've loaded a PE image into memory, and tried to execute it but failed. The entry point is found and is correct, but when I jump there it triple faults. I've looked at the PE file and at the entry point there are a bunch of zeros (and I have no idea why).
So the code I compiled:
Code: Select all
int main(void){
char *msg = "Hello process!\n";
__asm__ __volatile__(
".intel_syntax noprefix\n"
"mov ebx, %0;\n"
"xor eax, eax;\n"
"int 0x66;\n"
".att_syntax\n"
:
: "r"(msg)
: "eax", "ebx"
);
for(;;);
return 0;
}
https://www.mediafire.com/?xd6y7v31ux198y6
I'm not sure about the compiled file, I use linux and I compiled this on a windows laptop.
Does anyone have an idea what could be the problem?