ElectronApp

Struct ElectronApp 

Source
pub struct ElectronApp<'a> { /* private fields */ }
Expand description

An Electron application binary.

Implementations§

Source§

impl<'a> ElectronApp<'a>

Source

pub fn from_bytes( application_bytes: &'a mut [u8], ) -> Result<ElectronApp<'a>, PatcherError>

Constructs a new electron app and verifies that the bytes came from a packaged Electron app binary file.

§Errors

This function returns an error if the bytes couldn’t be validated to contain an Electron application.

Source

pub fn get_fuse_status(&self, fuse: Fuse) -> Result<FuseStatus, PatcherError>

Parses and returns this fuse type’s status in the provided binary.

§Return

Returns the current fuse status. This will not return a modification result.

§Errors

This function will return an error if an invalid binary is provided or one that is not an Electron application.

Source

pub fn set_fuse_status( &mut self, fuse: Fuse, enabled: bool, ) -> Result<FuseStatus, PatcherError>

Toggles a fuse in the application binary based off the provided value.

§Return

Returns the result of the operation if it succeeded.

§Errors

This function will return an error if a fuse wire couldn’t be found in the provided binary or if a modification of a removed fuse was attempted.

Source§

impl ElectronApp<'_>

Source

pub fn patch_option<P: Patchable>( &mut self, to_disable: P, ) -> Result<(), PatcherError>

Disables the ability to use this command line flag in the application.

After being disabled, the flag will no longer be processed by the application. The removal is a best-effort attempt. See the crate documentation on effectiveness.

Auto Trait Implementations§

§

impl<'a> Freeze for ElectronApp<'a>

§

impl<'a> RefUnwindSafe for ElectronApp<'a>

§

impl<'a> Send for ElectronApp<'a>

§

impl<'a> Sync for ElectronApp<'a>

§

impl<'a> Unpin for ElectronApp<'a>

§

impl<'a> !UnwindSafe for ElectronApp<'a>

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, 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, 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.