flat assembler
Message board for the users of flat assembler.
Index
> Windows > x64 SEH Jump to label from exception handler |
Author |
|
pro3carp3 25 May 2022, 04:08
I'm adding some exception handling using the example here: https://board.flatassembler.net/topic.php?t=11266.
The example transfers control back to the procedure by setting context.Rip to the point immediately past the errant code: Code: buggy_instruction: div ebx sizeof_buggy_instruction = $ - buggy_instruction ... add [context.Rip],sizeof_buggy_instruction Rather than jump to the code following the error, however, I want to jump to a particular label to handle the exception, similar to a finally block. I'm getting a value out of range error when attempting this: Code: mov [context.Rip], finally_label How do I adjust the context.Rip to jump to the finally label upon exiting the exception handler? Thanks. |
|||
25 May 2022, 04:08 |
|
sinsi 25 May 2022, 09:04
Isn't it better for 64-bit code to use LEA rather than MOV? I thought MOV would give a 64-bit address but LEA would use RIP-relative (and no relocation).
|
|||
25 May 2022, 09:04 |
|
Furs 25 May 2022, 13:24
Code: add [context.Rip], finally_label - buggy_instruction |
|||
25 May 2022, 13:24 |
|
pro3carp3 26 May 2022, 02:42
I should have realized that. Thank you.
|
|||
26 May 2022, 02:42 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.