void
swap_x86_exception_state(
    x86_exception_state_t *exc,
    enum NXByteOrder target_byte_sex)
{
    x86_state_hdr_t hdr;
    enum NXByteOrder host_byte_sex;

    host_byte_sex = NXHostByteOrder();
    hdr = exc->esh;
    if(target_byte_sex == host_byte_sex)
        swap_x86_state_hdr(&hdr, host_byte_sex);

    swap_x86_state_hdr(&exc->esh, target_byte_sex);

    if(hdr.flavor == x86_EXCEPTION_STATE32)
        swap_i386_exception_state(&exc->ues.es32, target_byte_sex);
    else if(hdr.flavor == x86_EXCEPTION_STATE64)
        swap_x86_exception_state64(&exc->ues.es64, target_byte_sex);
}
示例#2
0
void
swap_x86_exception_state(
x86_exception_state_t *exc,
enum NXByteOrder target_byte_sex)
{
    x86_state_hdr_t hdr;
    enum NXByteOrder host_byte_sex;

	host_byte_sex = NXHostByteOrder();
	hdr = exc->esh;
	if(target_byte_sex == host_byte_sex)
	    swap_x86_state_hdr(&hdr, host_byte_sex);

	swap_x86_state_hdr(&exc->esh, target_byte_sex);

/* current i386 thread states */
#if i386_THREAD_STATE == 1
	if(hdr.flavor == x86_EXCEPTION_STATE32)
	    swap_i386_exception_state(&exc->ues.es32, target_byte_sex);
	else
#endif
	if(hdr.flavor == x86_EXCEPTION_STATE64)
	    swap_x86_exception_state64(&exc->ues.es64, target_byte_sex);
}