Attaching by PID: Using JavaScript Hooking ChannelTest.exe The output: 0xfffffffb is 1111 1111 1111 1111 1111 1111 1111 1011 and SO_LINGER is 0x0080 that is 1000 0000. The same result with ldp.exe: frida -p 413100 -l hook_setsockopt.js Sample Program in C++