mirror of
https://github.com/httptoolkit/frida-interception-and-unpinning.git
synced 2026-10-28 17:52:52 +01:00
fix: update deprecated Module.* APIs for Frida v17
This commit is contained in:
@@ -21,11 +21,15 @@ const PROXY_HOST_IPv4_BYTES = PROXY_HOST.split('.').map(part => parseInt(part, 1
|
||||
const IPv6_MAPPING_PREFIX_BYTES = [0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xff, 0xff];
|
||||
const PROXY_HOST_IPv6_BYTES = IPv6_MAPPING_PREFIX_BYTES.concat(PROXY_HOST_IPv4_BYTES);
|
||||
|
||||
const connectFn = (
|
||||
Module.findExportByName('libc.so', 'connect') ?? // Android
|
||||
Module.findExportByName('libc.so.6', 'connect') ?? // Linux
|
||||
Module.findExportByName('libsystem_kernel.dylib', 'connect') // iOS
|
||||
);
|
||||
let connectFn = null;
|
||||
try {
|
||||
connectFn =
|
||||
Process.getModuleByName('libc.so').findExportByName('connect') ?? //Android
|
||||
Process.getModuleByName('libc.so.6').findExportByName('connect') ?? // Linux
|
||||
Process.getModuleByName('libsystem_kernel.dylib').findExportByName('connect'); //IOS
|
||||
} catch (e) {
|
||||
console.error("Failed to find 'connect' export:", e);
|
||||
}
|
||||
|
||||
if (!connectFn) { // Should always be set, but just in case
|
||||
console.warn('Could not find libc connect() function to hook raw traffic');
|
||||
|
||||
Reference in New Issue
Block a user