티스토리 뷰
소스코드
1 2 3 4 5 6 | def hexdump(string): for line in range(0, ((len(string)/16)+1), 1): print '%04x: ' % line + ' '.join(x.encode('hex') for x in string[(line*16):((line*16)+16)]) #print ' '.join(x.encode('hex') for x in string) hexdump("A"*100+"B"*100) | cs |
결과
사용방법 : 소스코드의 6번째 줄처럼
socket이나 페이로드를 구현할 때 쓸만할거 같아서 작성했다. 4번째 줄처럼 바로 보는 방법도 있지만, 보기 불편하므로...
ps. hexdump 모듈이 있는거 같지만 따로 설치해야 하는거 같다.
'Programming > Python' 카테고리의 다른 글
mipsHex (0) | 2018.06.20 |
---|---|
python errno 사용 (0) | 2018.01.20 |
Python Network Fuzzer 기본 코드 (0) | 2017.10.17 |
Windows python 모듈 설치 정리 (0) | 2017.10.01 |
Windows Python 환경 변수 등록 및 pip 설치 (0) | 2017.10.01 |
댓글