Javascript code debugger

This commit is contained in:
techmetx11 2024-07-03 17:38:46 +01:00
parent 062de1e172
commit 4cb6b0a609
No known key found for this signature in database
GPG Key ID: E60B63635FF4E062
2 changed files with 16 additions and 10 deletions

View File

@ -170,6 +170,7 @@ pub async fn process_decrypt_n_signature<W>(
} else {
println!("JavaScript interpreter error (nsig code): {}", n);
}
println!("Code: {}", player_info.nsig_function_code.clone());
writer = cloned_writer.lock().await;
writer.send(OpcodeResponse {
opcode: JobOpcode::DecryptNSignature,
@ -193,7 +194,7 @@ pub async fn process_decrypt_n_signature<W>(
call_string += &sig.replace("\"", "\\\"");
call_string += "\")";
let decrypted_string = match ctx.eval::<String,String>(call_string) {
let decrypted_string = match ctx.eval::<String,String>(call_string.clone()) {
Ok(x) => x,
Err(n) => {
if n.is_exception() {
@ -201,6 +202,7 @@ pub async fn process_decrypt_n_signature<W>(
} else {
println!("JavaScript interpreter error (nsig code): {}", n);
}
println!("Code: {}", call_string.clone());
writer = cloned_writer.lock().await;
writer.send(OpcodeResponse {
opcode: JobOpcode::DecryptNSignature,
@ -258,6 +260,7 @@ pub async fn process_decrypt_signature<W>(
} else {
println!("JavaScript interpreter error (sig code): {}", n);
}
println!("Code: {}", player_info.sig_function_code.clone());
writer = cloned_writer.lock().await;
writer.send(OpcodeResponse {
opcode: JobOpcode::DecryptSignature,
@ -284,7 +287,7 @@ pub async fn process_decrypt_signature<W>(
drop(player_info);
let decrypted_string = match ctx.eval::<String,String>(call_string) {
let decrypted_string = match ctx.eval::<String,String>(call_string.clone()) {
Ok(x) => x,
Err(n) => {
if n.is_exception() {
@ -292,6 +295,7 @@ pub async fn process_decrypt_signature<W>(
} else {
println!("JavaScript interpreter error (sig code): {}", n);
}
println!("Code: {}", call_string.clone());
writer = cloned_writer.lock().await;
writer.send(OpcodeResponse {
opcode: JobOpcode::DecryptSignature,

View File

@ -157,6 +157,8 @@ pub async fn fetch_update(state: Arc<GlobalState>) -> Result<(), FetchUpdateStat
sig_code += helper_object_body;
sig_code += sig_function_body;
println!("{}", sig_code);
// Get signature timestamp
let signature_timestamp: u64 = REGEX_SIGNATURE_TIMESTAMP
.captures(&player_javascript)