Struct DSAPI

Source
pub struct DSAPI {
    pub engine: String,
    pub location: String,
    /* private fields */
}
Expand description

The main struct for the Dumpspace API, which provides methods to interact with the Dumpspace data. It must be initialized with a specific game ID (hash) and then must call download_content to fetch and parse the data.

§Example:

use dumpspace_api::DSAPI;
let game_id = "6b77eceb"; // Example game ID, replace with actual game hash
let mut dsapi = DSAPI::new(game_id);
dsapi.download_content().unwrap(); // Download and parse the content (if this fails you're screwed anyways so might as well unwrap)
println!("{:?}", dsapi.get_member_offset("UWorld", "OwningGameInstance"));
println!("{:?}", dsapi.get_enum_name("EFortRarity", 4));
println!("0x{:x?}", dsapi.get_class_size("AActor").unwrap());
println!("0x{:x?}", dsapi.get_offset("OFFSET_GWORLD").unwrap());

Fields§

§engine: String§location: String

Implementations§

Source§

impl DSAPI

Source

pub fn new(game_id: &str) -> Self

Creates a new instance of DSAPI for a specific game identified by its hash. This function initializes the game list and sets the engine and location based on the provided game ID. Game ID can be found in the url of a dumpspace game page, and will be a query argument called hash.

Source

pub fn download_content(&mut self) -> Result<(), String>

Downloads and parses the content from the dumpspace API. This function fetches various JSON blobs containing class, struct, enum, and function information, and populates the internal maps with this data.

Source

pub fn get_member_offset( &self, class_name: &str, member_name: &str, ) -> Option<OffsetInfo>

Returns the offset info for a class member as an Option<OffsetInfo>.

Source

pub fn get_class_size(&self, class_name: &str) -> Option<i32>

Returns the size of a class as an Option<i32>. Returns None if the class is not found.

Source

pub fn get_enum_name(&self, enum_name: &str, enum_value: i64) -> Option<String>

Returns the name of an enum value as an Option<String>. Returns None if the enum name or value is not found.

Source

pub fn get_offset(&self, offset_name: &str) -> Option<u64>

Returns the offset of a specific offset name as an Option<u64>. Returns None if the offset name is not found.

Source

pub fn get_member_offset_unchecked( &self, class_name: &str, member_name: &str, ) -> usize

Returns the offset info for a class member with an .unwrap() and cast to usize. This function will panic if the member is not found.

§Safety: This function assumes that the member exists and will panic if it does not.

This should be fine to use in practice, as the code should only panic if the member is misspelled or does not exist.

Trait Implementations§

Source§

impl Debug for DSAPI

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for DSAPI

§

impl RefUnwindSafe for DSAPI

§

impl Send for DSAPI

§

impl Sync for DSAPI

§

impl Unpin for DSAPI

§

impl UnwindSafe for DSAPI

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,