Chromium Code Reviews| Index: src/processor/exploitability_win.cc |
| =================================================================== |
| --- src/processor/exploitability_win.cc (revision 1466) |
| +++ src/processor/exploitability_win.cc (working copy) |
| @@ -106,20 +106,17 @@ |
| uint64_t stack_ptr = 0; |
| uint64_t instruction_ptr = 0; |
| - switch (context->GetContextCPU()) { |
| - case MD_CONTEXT_X86: |
| - stack_ptr = context->GetContextX86()->esp; |
| - instruction_ptr = context->GetContextX86()->eip; |
| - break; |
| - case MD_CONTEXT_AMD64: |
| - stack_ptr = context->GetContextAMD64()->rsp; |
| - instruction_ptr = context->GetContextAMD64()->rip; |
| - break; |
| - default: |
| - BPLOG(INFO) << "Unsupported architecture."; |
| - return EXPLOITABILITY_ERR_PROCESSING; |
| + // Getting the instruction pointer. |
| + if (!context->GetInstructionPointer(&instruction_ptr)) { |
| + return EXPLOITABILITY_ERR_PROCESSING; |
| } |
| + // Getting the stack pointer. |
| + // TODO(liuandrew): get the stack ptr |
|
ivanpe
2015/06/30 23:17:09
Is this TODO still relevant?
liuandrew
2015/06/30 23:20:51
Nope. Removed.
|
| + if (!context->GetStackPointer(&stack_ptr)) { |
| + return EXPLOITABILITY_ERR_PROCESSING; |
| + } |
| + |
| // Check if we are executing on the stack. |
| if (instruction_ptr <= (stack_ptr + kProbableStackOffset) && |
| instruction_ptr >= (stack_ptr - kProbableStackOffset)) |