Skip to main content

osom_encoders_x86_64/
constants.rs

1//! This module holds several useful constants.
2
3/// Length of the short jump instruction in bytes.
4pub const JMP_SHORT_LENGTH: usize = 2;
5
6/// Offset of the 8-bit immediate value in the short jump instruction.
7/// Useful for patching `jmp` instructions.
8pub const JMP_SHORT_IMM8_OFFSET: usize = 1;
9
10/// Length of the long jump instruction in bytes.
11pub const JMP_LONG_LENGTH: usize = 5;
12
13/// Offset of the 32-bit immediate value in the long jump instruction.
14/// Useful for patching `jmp` instructions.
15pub const JMP_LONG_IMM32_OFFSET: usize = 1;
16
17/// Length of the short conditional jump instruction in bytes.
18pub const JCC_SHORT_LENGTH: usize = 2;
19
20/// Offset of the 8-bit immediate value in the short conditional jump instruction.
21/// Useful for patching `jcc` instructions.
22pub const JCC_SHORT_IMM8_OFFSET: usize = 1;
23
24/// Length of the long conditional jump instruction in bytes.
25pub const JCC_LONG_LENGTH: usize = 6;
26
27/// Offset of the 32-bit immediate value in the long conditional jump instruction.
28/// Useful for patching `jcc` instructions.
29pub const JCC_LONG_IMM32_OFFSET: usize = 2;