GSerg писал(а):"Не существует способа узнать EIP, кроме как выполнить jmp (call) и прочитать верхушку стека".
typedef struct _CONTEXT {
DWORD FltF0;
DWORD FltF1;
DWORD FltF2;
DWORD FltF3;
DWORD FltF4;
DWORD FltF5;
DWORD FltF6;
DWORD FltF7;
DWORD FltF8;
DWORD FltF9;
DWORD FltF10;
DWORD FltF11;
DWORD FltF12;
DWORD FltF13;
DWORD FltF14;
DWORD FltF15;
DWORD FltF16;
DWORD FltF17;
DWORD FltF18;
DWORD FltF19;
DWORD FltF20;
DWORD FltF21;
DWORD FltF22;
DWORD FltF23;
DWORD FltF24;
DWORD FltF25;
DWORD FltF26;
DWORD FltF27;
DWORD FltF28;
DWORD FltF29;
DWORD FltF30;
DWORD FltF31;
DWORD IntV0; // $0: return value register, v0
DWORD IntT0; // $1: temporary registers, t0 - t7
DWORD IntT1; // $2:
DWORD IntT2; // $3:
DWORD IntT3; // $4:
DWORD IntT4; // $5:
DWORD IntT5; // $6:
DWORD IntT6; // $7:
DWORD IntT7; // $8:
DWORD IntS0; // $9: nonvolatile registers, s0 - s5
DWORD IntS1; // $10:
DWORD IntS2; // $11:
DWORD IntS3; // $12:
DWORD IntS4; // $13:
DWORD IntS5; // $14:
DWORD IntFp; // $15: frame pointer register, fp/s6
DWORD IntA0; // $16: argument registers, a0 - a5
DWORD IntA1; // $17:
DWORD IntA2; // $18:
DWORD IntA3; // $19:
DWORD IntA4; // $20:
DWORD IntA5; // $21:
DWORD IntT8; // $22: temporary registers, t8 - t11
DWORD IntT9; // $23:
DWORD IntT10; // $24:
DWORD IntT11; // $25:
DWORD IntRa; // $26: return address register, ra
DWORD IntT12; // $27: temporary register, t12
DWORD IntAt; // $28: assembler temp register, at
DWORD IntGp; // $29: global pointer register, gp
DWORD IntSp; // $30: stack pointer register, sp
DWORD IntZero; // $31: zero register, zero
DWORD Fpcr; // floating point control register
DWORD SoftFpcr; // software extension to FPCR
DWORD Fir; // (fault instruction) continuation address
DWORD Psr; // processor status
DWORD ContextFlags;
//
// Beginning of the "second half".
// The name "High" parallels the HighPart of a LargeInteger.
//
DWORD HighFltF0;
DWORD HighFltF1;
DWORD HighFltF2;
DWORD HighFltF3;
DWORD HighFltF4;
DWORD HighFltF5;
DWORD HighFltF6;
DWORD HighFltF7;
DWORD HighFltF8;
DWORD HighFltF9;
DWORD HighFltF10;
DWORD HighFltF11;
DWORD HighFltF12;
DWORD HighFltF13;
DWORD HighFltF14;
DWORD HighFltF15;
DWORD HighFltF16;
DWORD HighFltF17;
DWORD HighFltF18;
DWORD HighFltF19;
DWORD HighFltF20;
DWORD HighFltF21;
DWORD HighFltF22;
DWORD HighFltF23;
DWORD HighFltF24;
DWORD HighFltF25;
DWORD HighFltF26;
DWORD HighFltF27;
DWORD HighFltF28;
DWORD HighFltF29;
DWORD HighFltF30;
DWORD HighFltF31;
DWORD HighIntV0; // $0: return value register, v0
DWORD HighIntT0; // $1: temporary registers, t0 - t7
DWORD HighIntT1; // $2:
DWORD HighIntT2; // $3:
DWORD HighIntT3; // $4:
DWORD HighIntT4; // $5:
DWORD HighIntT5; // $6:
DWORD HighIntT6; // $7:
DWORD HighIntT7; // $8:
DWORD HighIntS0; // $9: nonvolatile registers, s0 - s5
DWORD HighIntS1; // $10:
DWORD HighIntS2; // $11:
DWORD HighIntS3; // $12:
DWORD HighIntS4; // $13:
DWORD HighIntS5; // $14:
DWORD HighIntFp; // $15: frame pointer register, fp/s6
DWORD HighIntA0; // $16: argument registers, a0 - a5
DWORD HighIntA1; // $17:
DWORD HighIntA2; // $18:
DWORD HighIntA3; // $19:
DWORD HighIntA4; // $20:
DWORD HighIntA5; // $21:
DWORD HighIntT8; // $22: temporary registers, t8 - t11
DWORD HighIntT9; // $23:
DWORD HighIntT10; // $24:
DWORD HighIntT11; // $25:
DWORD HighIntRa; // $26: return address register, ra
DWORD HighIntT12; // $27: temporary register, t12
DWORD HighIntAt; // $28: assembler temp register, at
DWORD HighIntGp; // $29: global pointer register, gp
DWORD HighIntSp; // $30: stack pointer register, sp
DWORD HighIntZero; // $31: zero register, zero
DWORD HighFpcr; // floating point control register
DWORD HighSoftFpcr; // software extension to FPCR
DWORD HighFir; // processor status
double DoNotUseThisField; // to force quadword structure alignment
DWORD HighFill[2]; // padding for 16-byte stack frame alignment
} CONTEXT, *PCONTEXT;
winnt.h писал(а):
- Код: Выделить всё
//
// 32-bit Context Frame
//
// This alternate version of the _Alpha_context_structure_ parallels that
// of MIPS and IX86 in style for the first 64 entries: 32-bit machines
...
typedef struct _CONTEXT {
DWORD FltF0;
DWORD FltF1;
DWORD FltF2;
...
double DoNotUseThisField; // to force quadword structure alignment
DWORD HighFill[2]; // padding for 16-byte stack frame alignment
} CONTEXT, *PCONTEXT;
...
#ifdef _X86_
...
typedef struct _CONTEXT {
DWORD ContextFlags;
DWORD Dr0;
DWORD Dr1;
DWORD Dr2;
DWORD Dr3;
DWORD Dr6;
DWORD Dr7;
FLOATING_SAVE_AREA FloatSave;
DWORD SegGs;
DWORD SegFs;
DWORD SegEs;
DWORD SegDs;
DWORD Edi;
DWORD Esi;
DWORD Ebx;
DWORD Edx;
DWORD Ecx;
DWORD Eax;
DWORD Ebp;
DWORD Eip;
DWORD SegCs; // MUST BE SANITIZED
DWORD EFlags; // MUST BE SANITIZED
DWORD Esp;
DWORD SegSs;
BYTE ExtendedRegisters[MAXIMUM_SUPPORTED_EXTENSION];
} CONTEXT;
typedef CONTEXT *PCONTEXT;
#endif //_X86_
tyomitch писал(а):Как вариант - вызвать GetThreadTimes два раза подряд и сравнить.
Сейчас этот форум просматривают: нет зарегистрированных пользователей и гости: 162