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: StringImplementations§
Source§impl DSAPI
impl DSAPI
Sourcepub fn new(game_id: &str) -> Self
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.
Sourcepub fn download_content(&mut self) -> Result<(), String>
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.
Sourcepub fn get_member_offset(
&self,
class_name: &str,
member_name: &str,
) -> Option<OffsetInfo>
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>.
Sourcepub fn get_class_size(&self, class_name: &str) -> Option<i32>
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.
Sourcepub fn get_enum_name(&self, enum_name: &str, enum_value: i64) -> Option<String>
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.
Sourcepub fn get_offset(&self, offset_name: &str) -> Option<u64>
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.
Sourcepub fn get_member_offset_unchecked(
&self,
class_name: &str,
member_name: &str,
) -> usize
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.