Tags: pwn python 

Rating:

[https://rls1004.github.io/2018-07-29-isitdtu-writeup-xoxopwn/](https://rls1004.github.io/2018-07-29-isitdtu-writeup-xoxopwn/)

---

use `co_code` and `co_consts`.

```sh
This is function x()>>> o.func_code.co_code
d}|jd}d}d}xLtt|D]8}|tt||t||t|A7}q4W||krdGHndGHdS
```

```sh
This is function x()>>> o.func_code.co_consts
(None, '392a3d3c2b3a22125d58595733031c0c070a043a071a37081d300b1d1f0b09', 'hex', 'pythonwillhelpyouopenthedoor', '', 'Open the door', 'Close the door')
```

---

code and flag
```python
a = '392a3d3c2b3a22125d58595733031c0c070a043a071a37081d300b1d1f0b09'
b = 'pythonwillhelpyouopenthedoor'
b += b[:len(a)/2-len(b)]

a = int(a,16)
b = int(b.encode('hex'),16)

result = hex(a^b)[2:-1].decode('hex')

print result
```
```
ISITDTU{1412_secret_in_my_door}
```

Original writeup (https://rls1004.github.io/2018-07-29-isitdtu-writeup-xoxopwn/).