Split the frida handler to a separte handler and add a test

This commit is contained in:
Dimitris Zervas
2023-06-03 01:52:10 +03:00
parent 85c4aef520
commit 9180d62d67
12 changed files with 295 additions and 108 deletions

32
src/cs.rs Normal file
View File

@@ -0,0 +1,32 @@
use cs_eval::{EvalContext, EvalError};
fn cs_inject() {
// Define your C# code to be compiled
let csharp_code = r#"
using System;
public class Program
{
public static void Main()
{
Console.WriteLine("Hello, C#!");
}
}
"#;
// Create an evaluation context
let mut context = EvalContext::new();
// Compile and execute the C# code
match context.eval::<()>(csharp_code) {
Ok(_) => {
println!("C# code executed successfully");
}
Err(EvalError::CompilationError(err)) => {
println!("Compilation error: {:?}", err);
}
Err(EvalError::ExecutionError(err)) => {
println!("Execution error: {:?}", err);
}
}
}