How to debug linux program on Windows ?
Lab setup
- Windows: (IP: 192.168.1.105)
- Linux: (IP: 192.168.1.103)
Windows (IDA Pro)
- Install IDA Pro 6.8 on Windows.
- Create a share folder linux in C:\PROGRA~1\IDA6.8
- copy linux_server from dbgsrv to C:\PROGRA~1\IDA6.8\linux
Linux
- Mount windows share to locahost
- copy the program called demo to /mnt/linux
cd /mnt/linux && chmod u+x linux_server && ./linux_server
- Open file on windows, it will show as follow:
- Open menu Debugger >> Remote Linux Debugger.
As you see, you can disassmble the prog code as follow:
int __cdecl main(int argc, const char **argv, const char **envp)
{
int v3; // [email protected]
v3 = add(, );
printf("a + b = %d", v3);
return v3;
}
References
https://www.hex-rays.com/products/ida/index.shtml
http://www.woodmann.com/TiGa/idaseries.html
https://www.hex-rays.com/products/ida/support/freefiles/remotedbg.pdf