Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
strncpyライブラリ呼び出しに渡される引数を監視するインターポーザーを作成できることは知っていますが、これはDTraceで簡単に実行できるはずです。
動作するバリアントは次のとおりです (Mac でのみテスト済み)。
#!/usr/sbin/dtrace -s pid$target::strncpy:entry { printf( "%s( %X, %s, %lld )\n", probefunc, arg0, copyinstr(arg1), arg2 ); }
copyinstr文字列はユーザーランドからカーネルに入るために必要です。
copyinstr