Notice
Recent Posts
Recent Comments
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | 31 |
Tags
- commandline
- ecma
- data distribution
- idapython
- ida pro
- Injection
- Analysis
- svn update
- h5py.File
- Ransomware
- ida
- NumPy Unicode Error
- idb2pat
- malware
- TensorFlow
- x64
- pytest
- debugging
- error
- why error
- idapro
- mock.patch
- 포인터 매핑
- javascript
- error fix
- open office xml
- Python
- Rat
- MySQL
- hex-rays
Archives
- Today
- Total
13 Security Lab
python bug - pycurl lose string data of callback return 본문
Computer Science/Programming
python bug - pycurl lose string data of callback return
Maj0r Tom 2017. 7. 14. 01:25
"""i used this code for get http data from web using pycurl
but, when i use bellow code "before" it get code loss partially(front of data).
I think when use undefined variable it makes data lose
then, use object "StringIO" it covered range of buffer to get data from web"""
Import
|
1
2
|
from StringIO import StringIO
import pycurl
|
before:
|
1
2
3
4
5
6
7
|
def http_body_callback(buf):
contents = buf;
curl_handle.setopt(curl_handle.WRITEFUNCTION, self.http_body_callback);
curl_handle.perform();
print contents;
|
modify to:
|
1
2
3
4
5
|
storage = StringIO()
curl_handle.setopt(curl_handle.WRITEFUNCTION, storage.write);
curl_handle.perform();
print storage.getvalue()
|
Comments