fileコマンド
$ file ngrok
ngrok: Mach-O 64-bit executable x86_64
$ file Downloads/odbg201/ollydbg.exe
Downloads/odbg201/ollydbg.exe: PE32 executable (GUI) Intel 80386, for MS Windows
fileコマンドを使うと実行ファイルがどのOS、bit向けか分かる
stringsコマンド
webkaru.net
stringsコマンド使おうとしたらエラーになった
$ strings sishyu.jpeg
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
何事かと思ったら昨晩Mojaveにアップデートしたから、xcodeアップデートしたら治った
xcode-select --install
brew install gdb
試しプログラム
#include <stdio.h>
int main(void) {
printf("test\n");
return 0;
}
コンパイル
gcc -g test.c -o test
動かす、
gdb ./test
(gdb) run
Starting program: /Users/hoge/tmp/test
Unable to find Mach task port for process-id 4465: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
怒られる、、
qiita.com
やった、再起動
ps aux | grep taskgated
sudo kill 1206
署名
codesign -s gdbcert /usr/local/bin/gdb
Unable to find Mach task port for process-id 910: (os/kern) failure (0x5).
(please check gdb is codesigned - see taskgated(8))
まだ動かんなんでや