#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Date : 2016-08-12 12:12:06
# @Author : PiaoYun (piaoyunsoft@163.com)
# @Link : http://www.dllhook.com
import re
def char2hex(x):
return x.replace(' ', '').replace('\n', '').decode('hex')
def hex2char(x):
return re.sub(r"(?<=\w)(?=(?:\w\w)+$)", " ", x.encode('hex'))
if __name__ == '__main__':
print char2hex('77 77 77 2e646c6c686f6f6b2e636f6d')
print hex2char('www.dllhook.com')
发表评论