pub struct BrainfuckInterpreter;
Expand description
The Brainfuck interpreter, call:
let brainfuck_interpreter = Decoder::<BrainfuckInterpreter>::new()
to create a new instance
And then call:
result = brainfuck_interpreter.crack(input)
to interpret a Brainfuck program
The struct generated by new() comes from interface.rs
use ares::decoders::brainfuck_interpreter::{BrainfuckInterpreter};
use ares::decoders::interface::{Crack, Decoder};
use ares::checkers::{athena::Athena, CheckerTypes, checker_type::{Check, Checker}};
let brainfuck_interpreter = Decoder::<BrainfuckInterpreter>::new();
let athena_checker = Checker::<Athena>::new();
let checker = CheckerTypes::CheckAthena(athena_checker);
let result = brainfuck_interpreter.crack(">++++++++[<+++++++++>-]<.>++++[<+++++++>-]<+.+++++++..+++.>>++++++[<+++++++>-]<++.------------.>++++++[<+++++++++>-]<+.<.+++.------.--------.>>>++++[<++++++++>-]<+.", &checker).unencrypted_text;
assert!(result.is_some());
assert_eq!(result.unwrap()[0], "Hello, World!");
Auto Trait Implementations§
impl Freeze for BrainfuckInterpreter
impl RefUnwindSafe for BrainfuckInterpreter
impl Send for BrainfuckInterpreter
impl Sync for BrainfuckInterpreter
impl Unpin for BrainfuckInterpreter
impl UnwindSafe for BrainfuckInterpreter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more