> For the complete documentation index, see [llms.txt](https://pwnsec-notes.gitbook.io/ctf-notes/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://pwnsec-notes.gitbook.io/ctf-notes/reverse-engineering/useful-codes.md).

# Useful Codes

To delete the ptrace function from the binary file

```python
from pwn import *


exe = 'split' #CHANGE (file to be patched)

elf =  context.binary = ELF(exe,checksec=False)

elf.asm(elf.symbols.ptrace, 'ret') #changing the ptrace function 


elf.save('patched') #saving the patched file as the name "patched"
```
