Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use fm's new matching features for x86 register matching. #1311

Merged
merged 1 commit into from
Jul 24, 2024

Commits on Jul 24, 2024

  1. Use fm's new matching features for x86 register matching.

    Instead of using concrete register names, one can refer to a class of
    registers e.g. `r.8` is all 8-bit registers. To match a register name
    but ignore its value uses `r.8._`: to match a register name use `r.8.x`.
    Suffixes: must be unique (i.e. `r.8.x` and `r.8.y` must refer to
    different registers); and they refer to the "underlying" register (e.g.
    `r.8.x` and `r.64.x` might match `al` and `RAX` which is considered the
    same register, but will fail to match against `al` and `RBX`).
    
    To make this concrete these `assert`s all succeed:
    
    ```rust
    let fmm = fmatcher("r.8.x r.8.y r.64.x");
    assert!(fmm.matches("al bl rax").is_ok());
    assert!(fmm.matches("al al rax").is_err());
    assert!(fmm.matches("al bl rbx").is_err());
    assert!(fmm.matches("al bl eax").is_err());
    ```
    ltratt committed Jul 24, 2024
    Configuration menu
    Copy the full SHA
    adb82e8 View commit details
    Browse the repository at this point in the history