core/win32/callback.c
/* creates an exception record for a forged exception */
/* Access violations on read:
   ff 12 call dword ptr [edx]
        PC 0x00401124 tried to read address 0x00baddaa
   Access violations on execution:
   ff d2 call edx
        PC 0xdeadbeef tried to read address 0xdeadbeef
*/
creates an exception record for a forged exception
Access violations on read:
ff 12 call dword ptr [edx]
PC 0x00401124 tried to read address 0x00baddaa
Access violations on execution:
ff d2 call edx
PC 0xdeadbeef tried to read address 0xdeadbeef
creates an exception record for a forged exception Access violations on read : ff 12 call dword ptr [ edx ] PC 0x00401124 tried to read address 0x00baddaa Access violations on execution : ff d2 call edx PC 0xdeadbeef tried to read address 0xdeadbeef
static void
initialize_exception_record(EXCEPTION_RECORD* rec, app_pc exception_address,
                             uint exception_code)
{
    rec->ExceptionFlags = 0;
    rec->ExceptionRecord = NULL;
    rec->ExceptionAddress = exception_address;
    rec->NumberParameters = 0;
    switch (exception_code) {
    case UNREADABLE_MEMORY_EXECUTION_EXCEPTION:
        rec->ExceptionCode = EXCEPTION_ACCESS_VIOLATION;
        rec->NumberParameters = 2;
        rec->ExceptionInformation[0]=0 ;
        rec->ExceptionInformation[1]=(ptr_uint_t)exception_address;
        break;
    case IN_PAGE_ERROR_EXCEPTION:
        rec->ExceptionCode = EXCEPTION_IN_PAGE_ERROR;
        rec->NumberParameters = 2;
        rec->ExceptionInformation[0]=0 ;
        rec->ExceptionInformation[1]=(ptr_uint_t)exception_address;
        break;
    case ILLEGAL_INSTRUCTION_EXCEPTION:
        rec->ExceptionCode = EXCEPTION_ILLEGAL_INSTRUCTION;
        break;
    default:
        ASSERT_NOT_REACHED();
    }
}
static void initialize_exception_record ( EXCEPTION_RECORD * rec , app_pc exception_address , uint exception_code ) { rec -> ExceptionFlags = 0 ; rec -> ExceptionRecord = NULL ; rec -> ExceptionAddress = exception_address ; rec -> NumberParameters = 0 ; switch ( exception_code ) { case UNREADABLE_MEMORY_EXECUTION_EXCEPTION : rec -> ExceptionCode = EXCEPTION_ACCESS_VIOLATION ; rec -> NumberParameters = 2 ; rec -> ExceptionInformation [ 0 ] = 0 ; rec -> ExceptionInformation [ 1 ] = ( ptr_uint_t ) exception_address ; break ; case IN_PAGE_ERROR_EXCEPTION : rec -> ExceptionCode = EXCEPTION_IN_PAGE_ERROR ; rec -> NumberParameters = 2 ; rec -> ExceptionInformation [ 0 ] = 0 ; rec -> ExceptionInformation [ 1 ] = ( ptr_uint_t ) exception_address ; break ; case ILLEGAL_INSTRUCTION_EXCEPTION : rec -> ExceptionCode = EXCEPTION_ILLEGAL_INSTRUCTION ; break ; default : ASSERT_NOT_REACHED ( ) ; } }
creates an exception record for a forged exception
Access violations on read:
ff 12 call dword ptr [edx]
PC 0x00401124 tried to read address 0x00baddaa
Access violations on execution:
ff d2 call edx
PC 0xdeadbeef tried to read address 0xdeadbeef
creates an exception record for a forged exception Access violations on read : ff 12 call dword ptr [ edx ] PC 0x00401124 tried to read address 0x00baddaa Access violations on execution : ff d2 call edx PC 0xdeadbeef tried to read address 0xdeadbeef
/* read/execute */ /* read/execute */