jitcor / frida-ios-cipher

Intercept all cryptography-related functions on iOS with Frida Api.
MIT License
199 stars 46 forks source link

print_arg error: TypeError: cannot read property 'toString' of undefined #1

Closed Resolvit-Tech closed 1 month ago

Resolvit-Tech commented 1 year ago

Hello sir,

First I want to say thank you for frida-ios-cipher.

error

error message: print_arg error: TypeError: cannot read property 'toString' of undefined at t (frida/runtime/hexdump.js:20) at M (agent/index.ts:240) at onEnter (agent/index.ts:381)

Do you have discord or line? your gmail does not work.

eyJhb commented 11 months ago

Typically happens, when trying to read from a address that is not possible, ie. 0x0.

yml2213 commented 10 months ago

me too

wevve commented 3 months ago

一样的问题, frida 16.4.5 frida-tools 12.5.0

cz43608970 commented 2 months ago

Same. How to fix it?

eyJhb commented 2 months ago

Check if addr is 0x0, ie. https://github.com/jitcor/frida-ios-cipher/blob/2e11a06e082ac7ed956d9528d0fc19cc92629205/agent/index.ts#L199

function print_arg(addr,len=240) {
    try {
        if(addr==null)return "\n";
        if(addr==0x0)return "\n";
        return "\n"+(hexdump(addr,{length:len})) + "\n";
    } catch (e) {
        if(e instanceof Error){
            console.error("print_arg error:",e.stack);
        }
        return addr + "\n";
    }
}
jitcor commented 1 month ago

This is normal and will not affect other print data. It can be ignored for now.