All Projects → JustasMasiulis → vmutils

JustasMasiulis / vmutils

Licence: Apache-2.0 license
cross platform library to manipulate and extract information of memory regions

Programming Languages

C++
36643 projects - #6 most used programming language
CMake
9771 projects

Projects that are alternatives of or similar to vmutils

Saws
A supercharged AWS command line interface (CLI).
Stars: ✭ 4,886 (+22109.09%)
Mutual labels:  utility, utilities
Util
A collection of useful utility functions
Stars: ✭ 201 (+813.64%)
Mutual labels:  utility, utilities
Utils
A collection of useful PHP functions, mini classes and snippets that you need and can use every day.
Stars: ✭ 750 (+3309.09%)
Mutual labels:  utility, utilities
proxy-pants
Secured and reliable Proxy based utilities for more or less common tasks.
Stars: ✭ 36 (+63.64%)
Mutual labels:  utility, utilities
gut
🍱 yet another collection of go utilities & tools
Stars: ✭ 24 (+9.09%)
Mutual labels:  utility, utilities
Haxor News
Browse Hacker News like a haxor: A Hacker News command line interface (CLI).
Stars: ✭ 3,342 (+15090.91%)
Mutual labels:  utility, utilities
Sharlayan
Visit us on Discord! https://discord.gg/aCzSANp
Stars: ✭ 91 (+313.64%)
Mutual labels:  utility, memory
Schematics Utilities
🛠️ Useful exported utilities for working with Schematics
Stars: ✭ 73 (+231.82%)
Mutual labels:  utility, utilities
ios
CoThings's iOS application. CoThings is a realtime counter for shared things.
Stars: ✭ 13 (-40.91%)
Mutual labels:  utility, utilities
memory signature
A small wrapper class providing an unified interface to search for various memory signatures
Stars: ✭ 69 (+213.64%)
Mutual labels:  modern, memory
bat
Battery management utility for Linux laptops.
Stars: ✭ 107 (+386.36%)
Mutual labels:  utility, utilities
youtube-unofficial
Access parts of your account unavailable through normal YouTube API access.
Stars: ✭ 33 (+50%)
Mutual labels:  utility, utilities
Spectre
Spectre.css - A Lightweight, Responsive and Modern CSS Framework
Stars: ✭ 10,938 (+49618.18%)
Mutual labels:  modern, utilities
Lodash Php
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP
Stars: ✭ 412 (+1772.73%)
Mutual labels:  utility, utilities
Opensource
Delivering delightful digital solutions. Open Source packages with combined ~85M/month downloads, semantically versioned following @conventional-commits. Fully powered by Jest, @Babel TypeScript, @Airbnb @ESLint + @Prettier, @YarnPKG + @Lerna independent versioning, GH @Actions & automated dep updates with @RenovateBot.
Stars: ✭ 459 (+1986.36%)
Mutual labels:  modern, utilities
Gitlab Cli
Create a merge request from command line in gitlab
Stars: ✭ 224 (+918.18%)
Mutual labels:  utility, utilities
timestampy
🕒 Bunch of utilities useful when working with UNIX timestamps
Stars: ✭ 21 (-4.55%)
Mutual labels:  utility, utilities
assign-one-project-github-action
Automatically add an issue or pull request to specific GitHub Project(s) when you create and/or label them.
Stars: ✭ 140 (+536.36%)
Mutual labels:  utility, utilities
cond-flow
Elixir style cond for easy javascript control flow
Stars: ✭ 37 (+68.18%)
Mutual labels:  utilities
tov-template
vite + vue3 + ts 开箱即用现代开发模板
Stars: ✭ 251 (+1040.91%)
Mutual labels:  modern

vmutils Build Status Build status

cross platform virtual memory utilities library.

small example

// address can be unsinged integer or pointer
const auto region = vmu::query(address);
if(region && region.protection().accessible()) {
    const auto new_flags = vmu::access::read_write_exec;
    vmu::protection_guard guard(address, new_flags);
    // do something
} // protection will be restored on scope exit

quick reference

basic_region<Address>

Provides information about a memory region. Can be obtained using query or query_region.

function return type explanation
begin Address beginning of region
end Address one past the end of region
size uint big enough to store Address size of region
protection protection_t the protection of page
guarded bool whether the region is guarded
shared bool whether the region is shared
operator bool bool whether the region is used

protection_t

Wrapper class around protection flags.

function return type
accessible bool
readable bool
writable bool
executable bool
native native_protection_t
to_flags access

access enumeration

  • read
  • write
  • exec
  • read_write
  • read_exec
  • write_exec
  • read_write_exec

region query functions

Arguments in [] are not required - overloaded functions are present.

basic_region<RegionAddress> query([native_handle_t], Address, [std::error_code&])

Returns information about a region that the given address is in.

std::vector<basic_region<RegionAddress>> query_range([native_handle_t], Address, Address, [std::error_code&])

Returns information about regions that the given range of addresses are in.

The default for RegionAddress is std::uintptr_t or if the first function argument is of type native_handle_t - std::uint64_t.

region protection

protection_guard

RAII based memory region protection and query class that protects a region of memory and restores it upon destruction.

If adopt_protection_t tag type is given constructor performs no actions and destructor sets the given protection instead.

In critical code it is recommended to manually call restore or define VMU_HANDLE_PG_DESTRUCTOR_FAILURE macro that will handle errors in destructor, because by default on error memory regions is left unrestored.

constructor overloads:

  • protection_guard(Address, protection_t)
  • protection_guard(Address, Address, protection_t)
  • protection_guard(Range, protection_t)
  • protection_guard(Address, protection_t, adopt_protection_t)
  • protection_guard(Address, Address, protection_t, adopt_protection_t)
  • protection_guard(Range, protection_t, adopt_protection_t)
function explanation
restore([std::error_code&]) restores protection to its original state
release "releases" protection so it does not get restored on object destruction

void protect(Address, protection_t, [std::error_code&])

Changes protection of a single page that the address is in.

void protect(Address, Address, protection_t, [std::error_code&])

Changes protections of pages that range of addresses are in.

Address types

In library addresses are 32bit or 64bit unsigned integers or pointers. Conversions are applied automatically. By default every address that can cause an overflow / underflow is checked and an std::overflow_error is thrown if the target address type cannot represent the source address type.

An example of this would be if you called vmu::query<std::uint32_t>(std::numeric_limits<std::uint32_t>::max() * 2) it's pretty obvious that this regions end will definetly overflow the requested 32 bit integer.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].