Skip to content

Commit

Permalink
Add access to gs_base register
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorian Eikenberg authored and rageagainsthepc committed Jul 19, 2023
1 parent ada5e6c commit 19cae96
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions vmicore/src/include/vmicore/vmi/events/IRegisterReadable.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ namespace VmiCore

[[nodiscard]] virtual uint64_t getCr3() const = 0;

[[nodiscard]] virtual uint64_t getGs() const = 0;

protected:
IRegisterReadable() = default;
};
Expand Down
5 changes: 5 additions & 0 deletions vmicore/src/lib/vmi/Event.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ namespace VmiCore
return libvmiEvent->x86_regs->cr3;
}

uint64_t Event::getGs() const
{
return libvmiEvent->x86_regs->gs_base;
}

addr_t Event::getGla() const
{
switch (libvmiEvent->type)
Expand Down
2 changes: 2 additions & 0 deletions vmicore/src/lib/vmi/Event.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace VmiCore

[[nodiscard]] uint64_t getCr3() const override;

[[nodiscard]] uint64_t getGs() const override;

[[nodiscard]] addr_t getGla() const override;

[[nodiscard]] addr_t getGfn() const override;
Expand Down
2 changes: 2 additions & 0 deletions vmicore/test/include/vmicore_test/vmi/mock_InterruptEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ namespace VmiCore

MOCK_METHOD(uint64_t, getCr3, (), (const override));

MOCK_METHOD(uint64_t, getGs, (), (const override));

MOCK_METHOD(addr_t, getGla, (), (const override));

MOCK_METHOD(addr_t, getGfn, (), (const override));
Expand Down

0 comments on commit 19cae96

Please sign in to comment.