2020-11-10 07:46:52 +00:00
|
|
|
#[derive(Debug)]
|
|
|
|
pub enum Error {
|
|
|
|
InvalidCString,
|
|
|
|
LoadLibararyFail,
|
|
|
|
GetProcAddressFail,
|
|
|
|
NtAllocVmErr(i32),
|
|
|
|
NtProtectVmErr(i32),
|
|
|
|
InvalidUtf8String,
|
|
|
|
MismatchedArch,
|
|
|
|
MismatchedLoader,
|
|
|
|
NoEntryPoint,
|
2020-11-13 13:05:55 +00:00
|
|
|
UnsupportedDotNetExecutable,
|
2020-11-25 10:26:36 +00:00
|
|
|
InvalidProcDescString,
|
2020-11-10 07:46:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
pub type Result<T> = std::result::Result<T, Error>;
|
|
|
|
|
|
|
|
impl std::convert::From<std::str::Utf8Error> for Error {
|
|
|
|
fn from(_: std::str::Utf8Error) -> Self {
|
|
|
|
Error::InvalidUtf8String
|
|
|
|
}
|
|
|
|
}
|
2020-11-25 10:26:36 +00:00
|
|
|
|
|
|
|
impl std::convert::From<std::num::ParseIntError> for Error {
|
|
|
|
fn from(_: std::num::ParseIntError) -> Self {
|
|
|
|
Error::InvalidProcDescString
|
|
|
|
}
|
|
|
|
}
|