Javascript code debugger
This commit is contained in:
parent
062de1e172
commit
4cb6b0a609
2 changed files with 16 additions and 10 deletions
24
src/jobs.rs
24
src/jobs.rs
|
@ -170,6 +170,7 @@ pub async fn process_decrypt_n_signature<W>(
|
||||||
} else {
|
} else {
|
||||||
println!("JavaScript interpreter error (nsig code): {}", n);
|
println!("JavaScript interpreter error (nsig code): {}", n);
|
||||||
}
|
}
|
||||||
|
println!("Code: {}", player_info.nsig_function_code.clone());
|
||||||
writer = cloned_writer.lock().await;
|
writer = cloned_writer.lock().await;
|
||||||
writer.send(OpcodeResponse {
|
writer.send(OpcodeResponse {
|
||||||
opcode: JobOpcode::DecryptNSignature,
|
opcode: JobOpcode::DecryptNSignature,
|
||||||
|
@ -177,8 +178,8 @@ pub async fn process_decrypt_n_signature<W>(
|
||||||
update_status: Ok(Default::default()),
|
update_status: Ok(Default::default()),
|
||||||
signature: String::new(),
|
signature: String::new(),
|
||||||
signature_timestamp: Default::default(),
|
signature_timestamp: Default::default(),
|
||||||
has_player: Default::default(),
|
has_player: Default::default(),
|
||||||
player_id: Default::default(),
|
player_id: Default::default(),
|
||||||
}).await;
|
}).await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -193,7 +194,7 @@ pub async fn process_decrypt_n_signature<W>(
|
||||||
call_string += &sig.replace("\"", "\\\"");
|
call_string += &sig.replace("\"", "\\\"");
|
||||||
call_string += "\")";
|
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,
|
Ok(x) => x,
|
||||||
Err(n) => {
|
Err(n) => {
|
||||||
if n.is_exception() {
|
if n.is_exception() {
|
||||||
|
@ -201,6 +202,7 @@ pub async fn process_decrypt_n_signature<W>(
|
||||||
} else {
|
} else {
|
||||||
println!("JavaScript interpreter error (nsig code): {}", n);
|
println!("JavaScript interpreter error (nsig code): {}", n);
|
||||||
}
|
}
|
||||||
|
println!("Code: {}", call_string.clone());
|
||||||
writer = cloned_writer.lock().await;
|
writer = cloned_writer.lock().await;
|
||||||
writer.send(OpcodeResponse {
|
writer.send(OpcodeResponse {
|
||||||
opcode: JobOpcode::DecryptNSignature,
|
opcode: JobOpcode::DecryptNSignature,
|
||||||
|
@ -208,8 +210,8 @@ pub async fn process_decrypt_n_signature<W>(
|
||||||
update_status: Ok(Default::default()),
|
update_status: Ok(Default::default()),
|
||||||
signature: String::new(),
|
signature: String::new(),
|
||||||
signature_timestamp: Default::default(),
|
signature_timestamp: Default::default(),
|
||||||
has_player: Default::default(),
|
has_player: Default::default(),
|
||||||
player_id: Default::default(),
|
player_id: Default::default(),
|
||||||
}).await;
|
}).await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -258,6 +260,7 @@ pub async fn process_decrypt_signature<W>(
|
||||||
} else {
|
} else {
|
||||||
println!("JavaScript interpreter error (sig code): {}", n);
|
println!("JavaScript interpreter error (sig code): {}", n);
|
||||||
}
|
}
|
||||||
|
println!("Code: {}", player_info.sig_function_code.clone());
|
||||||
writer = cloned_writer.lock().await;
|
writer = cloned_writer.lock().await;
|
||||||
writer.send(OpcodeResponse {
|
writer.send(OpcodeResponse {
|
||||||
opcode: JobOpcode::DecryptSignature,
|
opcode: JobOpcode::DecryptSignature,
|
||||||
|
@ -265,8 +268,8 @@ pub async fn process_decrypt_signature<W>(
|
||||||
update_status: Ok(Default::default()),
|
update_status: Ok(Default::default()),
|
||||||
signature: String::new(),
|
signature: String::new(),
|
||||||
signature_timestamp: Default::default(),
|
signature_timestamp: Default::default(),
|
||||||
has_player: Default::default(),
|
has_player: Default::default(),
|
||||||
player_id: Default::default(),
|
player_id: Default::default(),
|
||||||
}).await;
|
}).await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -284,7 +287,7 @@ pub async fn process_decrypt_signature<W>(
|
||||||
|
|
||||||
drop(player_info);
|
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,
|
Ok(x) => x,
|
||||||
Err(n) => {
|
Err(n) => {
|
||||||
if n.is_exception() {
|
if n.is_exception() {
|
||||||
|
@ -292,6 +295,7 @@ pub async fn process_decrypt_signature<W>(
|
||||||
} else {
|
} else {
|
||||||
println!("JavaScript interpreter error (sig code): {}", n);
|
println!("JavaScript interpreter error (sig code): {}", n);
|
||||||
}
|
}
|
||||||
|
println!("Code: {}", call_string.clone());
|
||||||
writer = cloned_writer.lock().await;
|
writer = cloned_writer.lock().await;
|
||||||
writer.send(OpcodeResponse {
|
writer.send(OpcodeResponse {
|
||||||
opcode: JobOpcode::DecryptSignature,
|
opcode: JobOpcode::DecryptSignature,
|
||||||
|
@ -299,8 +303,8 @@ pub async fn process_decrypt_signature<W>(
|
||||||
update_status: Ok(Default::default()),
|
update_status: Ok(Default::default()),
|
||||||
signature: String::new(),
|
signature: String::new(),
|
||||||
signature_timestamp: Default::default(),
|
signature_timestamp: Default::default(),
|
||||||
has_player: Default::default(),
|
has_player: Default::default(),
|
||||||
player_id: Default::default(),
|
player_id: Default::default(),
|
||||||
}).await;
|
}).await;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,6 +157,8 @@ pub async fn fetch_update(state: Arc<GlobalState>) -> Result<(), FetchUpdateStat
|
||||||
sig_code += helper_object_body;
|
sig_code += helper_object_body;
|
||||||
sig_code += sig_function_body;
|
sig_code += sig_function_body;
|
||||||
|
|
||||||
|
println!("{}", sig_code);
|
||||||
|
|
||||||
// Get signature timestamp
|
// Get signature timestamp
|
||||||
let signature_timestamp: u64 = REGEX_SIGNATURE_TIMESTAMP
|
let signature_timestamp: u64 = REGEX_SIGNATURE_TIMESTAMP
|
||||||
.captures(&player_javascript)
|
.captures(&player_javascript)
|
||||||
|
|
Loading…
Add table
Reference in a new issue