-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathflutter_ssl_pinning.lua
More file actions
27 lines (22 loc) · 907 Bytes
/
Copy pathflutter_ssl_pinning.lua
File metadata and controls
27 lines (22 loc) · 907 Bytes
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
local TARGET_MODULE = "libflutter.so"
local HOOK_CANDIDATES = {
{ name = "FUN_00bc7a5c", rva = 0xac7a5c, params = 3 }
}
local base = Module.find(TARGET_MODULE)
if not base then
print("[-] Module not found: " .. TARGET_MODULE)
return
end
print("[*] SSL pinning bypass starting (" .. #HOOK_CANDIDATES .. " candidate(s))")
print(string.format("[+] %s found at: 0x%x", TARGET_MODULE, base))
-- ssl_crypto_x509_session_verify_cert_chain returns bool: true (1) = success.
-- Patch the function entry to: MOV X0, #1 ; RET
-- This avoids hook trampoline issues entirely.
-- MOV X0, #1 = \x20\x00\x80\xd2 (ARM64 little-endian)
-- RET = \xc0\x03\x5f\xd6
for _, candidate in ipairs(HOOK_CANDIDATES) do
local addr = base + candidate.rva
Memory.patch(addr, "\x20\x00\x80\xd2\xc0\x03\x5f\xd6")
print(string.format("[+] Patched %s @ 0x%x", candidate.name, addr))
end
print("[+] Done.")