Skip to content

0.3.0-beta.2 #11

New issue

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

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

Already on GitHub? # to your account

Merged
merged 10 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: ci

on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]

env:
CARGO_TERM_COLOR: always

jobs:
build-test:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest ]
steps:
- uses: actions/checkout@v4
with:
submodules: recursive
- name: Build
run: cargo build --verbose
- name: Run tests
run: cargo test --verbose
- name: Run tests in release mode
run: cargo test --verbose --release
- name: Clippy
run: cargo clippy
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ _This changelog documents only changes relevant to users, internal changes might
- `Image.copy()` has been replaced by `Image.extend()`
- `Image.add_cached()` now takes a `Rc<SectionCache>` instead of `&mut SectionCache` to ensure that the cache outlives the `Image`.
- Many packet/event types methods now take a `&self` instead of consuming `self`
- Some simple methods are now `const`

### Removed

Expand Down
9 changes: 6 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
[package]
name = "libipt"
version = "0.3.0-beta.1"
authors = ["sum_catnip <catnip@catnip.fyi>", "Marcondiro <cavenatimarco+libiptrs@gmail.com>"]
version = "0.3.0-beta.2"
authors = [
"sum_catnip <catnip@catnip.fyi>",
"Marcondiro <cavenatimarco+libiptrs@gmail.com>",
]
edition = "2021"
license = "MIT"
description = "The Intel Processor Trace (Intel PT) Decoder Library is Intel's reference implementation for decoding Intel PT."
Expand All @@ -14,6 +17,6 @@ rust-version = "1.82.0"
libipt_master = ["libipt-sys/libipt_master"]

[dependencies]
libipt-sys = "0.2.1-beta.3"
libipt-sys = { version = "0.2.1-beta.3", git = "https://github.com/sum-catnip/libipt-sys.git" }
bitflags = "2.4.1"
num_enum = "0.7.1"
32 changes: 15 additions & 17 deletions src/asid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,26 @@ use libipt_sys::{pt_asid, pt_asid_no_cr3 as NO_CR3, pt_asid_no_vmcs as NO_VMCS};
///
/// This identifies a particular address space when adding file sections or
/// when reading memory.
#[derive(Clone, Copy, Debug)]
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
#[repr(transparent)]
pub struct Asid(pub(crate) pt_asid);
impl Asid {
#[inline]
#[must_use]
pub fn new(cr3: Option<u64>, vmcs: Option<u64>) -> Self {
pub const fn new(cr3: Option<u64>, vmcs: Option<u64>) -> Self {
let cr3_raw = match cr3 {
Some(v) => v,
None => NO_CR3,
};
let vmcs_raw = match vmcs {
Some(v) => v,
None => NO_VMCS,
};

Asid(pt_asid {
size: size_of::<pt_asid>(),
cr3: cr3.unwrap_or(NO_CR3),
vmcs: vmcs.unwrap_or(NO_VMCS),
cr3: cr3_raw,
vmcs: vmcs_raw,
})
}

Expand Down Expand Up @@ -56,18 +66,6 @@ impl Default for Asid {
}
}

impl From<pt_asid> for Asid {
fn from(asid: pt_asid) -> Self {
Asid(asid)
}
}

impl PartialEq for Asid {
fn eq(&self, other: &Self) -> bool {
self.cr3() == other.cr3() && self.vmcs() == other.vmcs()
}
}

#[cfg(test)]
mod test {
use super::*;
Expand Down Expand Up @@ -126,7 +124,7 @@ mod test {
assert_eq!(raw.cr3, NO_CR3);
assert_eq!(raw.vmcs, NO_VMCS);

let mut asid2 = Asid::from(raw);
let mut asid2 = Asid(raw);
asid2.set_cr3(666);

assert_eq!(asid.cr3(), None);
Expand Down
158 changes: 0 additions & 158 deletions src/block/block.rs

This file was deleted.

Loading