-
Notifications
You must be signed in to change notification settings - Fork 27
/
openssl_boringssl_android.ts
39 lines (25 loc) · 1.19 KB
/
openssl_boringssl_android.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import {OpenSSL_BoringSSL } from "../ssl_lib/openssl_boringssl.js"
import { socket_library } from "./android_agent.js";
export class OpenSSL_BoringSSL_Android extends OpenSSL_BoringSSL {
constructor(public moduleName:String, public socket_library:String){
super(moduleName,socket_library);
}
execute_hooks(){
this.install_plaintext_read_hook();
this.install_plaintext_write_hook();
this.install_tls_keys_callback_hook();
}
install_tls_keys_callback_hook (){
OpenSSL_BoringSSL.SSL_CTX_set_keylog_callback = ObjC.available ? new NativeFunction(this.addresses["SSL_CTX_set_info_callback"], "void", ["pointer", "pointer"]) : new NativeFunction(this.addresses["SSL_CTX_set_keylog_callback"], "void", ["pointer", "pointer"])
Interceptor.attach(this.addresses["SSL_new"],
{
onEnter: function (args: any) {
OpenSSL_BoringSSL.SSL_CTX_set_keylog_callback(args[0], OpenSSL_BoringSSL.keylog_callback)
}
})
}
}
export function boring_execute(moduleName:String){
var boring_ssl = new OpenSSL_BoringSSL_Android(moduleName,socket_library);
boring_ssl.execute_hooks();
}