> For the complete documentation index, see [llms.txt](https://securityshark.gitbook.io/oscp-prep/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://securityshark.gitbook.io/oscp-prep/tools-and-techniques/cross-platform-exploit-compilation.md).

# Cross Platform Exploit Compilation

compiling 32 bit application on 64 bit os simply use -m32 flag with gcc

gcc -Wall -m32 -o abcd 9545.c if unable to do and get an error than apt install gcc-multilib for c apt install g++-multilib for c ++

gcc -m32 -Wl,--hash-style=both -o new 9542.c

specific compilaton command can vary for specific exploit; need to research it
