Consejo: Usar ASM INLINE para pruebas y luego sacas los opcodes y lo conviertes a shellcode. /****************************************************************************** * Interfaz para prueba de "shellcodes", haciendo una conversión de un: * * "char shellcode[]" a una función y ejecutarla. * * *******************************************************************************/ int main( void ) { char* shellcode = "\x90\x90\x90"; (( void(*)() ) shellcode)(); return 0; } /****************************************************************************** * EOF * *******************************************************************************/ /****************************************************************************** * Interfaz para prueba de "shellcodes", sobreescribiendo la dirección de * * retorno de la función "main" con el valor del buffer "shellcode[]". * * *******************************************************************************/ #define DISTANCIA_DESDE_PTR_A_RETORNO 0x10 int main( void ) { int* ptr; char shellcode[] = "\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90\x90"; ptr = (int *) &ptr; *ptr += DISTANCIA_DESDE_PTR_A_RETORNO; *ptr = (int) shellcode; return 0; } /****************************************************************************** * EOF * *******************************************************************************/