forked from freedom-wy/js-reverse
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6ae6f01
commit 22619d8
Showing
10 changed files
with
244 additions
and
43,657 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# 汽车之家爬虫 | ||
### 仅限学术交流,如有冒犯,请及时联系本人删除 | ||
*** | ||
#### 文件列表: | ||
##### koubei 汽车之家app端口碑css加密字体逆向 | ||
*** | ||
#### bug:dazhuang_python@sina.com |
Empty file.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# 汽车之家app端口碑css加密字体破解 | ||
### 仅限学术交流,如有冒犯,请及时联系本人删除 | ||
*** | ||
#### 文件列表: | ||
##### font_dict 大众点评页面字体对应关系---部分 | ||
*** | ||
#### 破解方法: | ||
##### 1、通过浏览器开发者模式,找到页面中文字所使用的css样式 | ||
##### 2、通过抓包等方法找到加载的css文件,通过正则表达式取出字体文件URL | ||
##### 3、通过[百度字体编辑器解析woff文件](http://fontstore.baidu.com/static/editor/index.html) 可以生成font_list.py文件 | ||
##### 4、使用fontTools处理字体文件,得出对应关系 | ||
##### 5、通过对应关系解析加密字体 | ||
*** | ||
#### bug:dazhuang_python@sina.com |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import requests | ||
import json | ||
from fontTools.ttLib import TTFont | ||
from lxml import etree | ||
import re | ||
|
||
|
||
class AutohomeKoubei(object): | ||
def __init__(self): | ||
self.detail_url = "https://k.m.autohome.com.cn/detail/share_01dmqy8fa168vkae9h60vg0000.html" | ||
self.header = { | ||
'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36' | ||
} | ||
|
||
def handle_font(self): | ||
''' | ||
首先获取ttf字体文件,写入本地 | ||
:return: | ||
''' | ||
response = requests.get(url=self.detail_url,headers=self.header) | ||
# ttf_url_search = re.compile(r"src:url\('//(.*?)'\)\sformat\('woff'\);") | ||
# ttf_url = 'http://'+ttf_url_search.search(response.text).group(1) | ||
# ttf_response = requests.get(url=ttf_url,headers=self.header) | ||
# with open('koubei.ttf','wb') as f: | ||
# f.write(ttf_response.content) | ||
self.detail = response.text | ||
|
||
def handle_detail(self): | ||
font_file = TTFont('koubei.ttf') | ||
# 找出字体和字体文件中编码的对应关系,保存为字典 | ||
# font_dict = json.dumps(dict(zip(font_file.getGlyphOrder(), FONT_LIST))) | ||
print(font_file.getGlyphOrder()) | ||
|
||
|
||
if __name__ == '__main__': | ||
koubei = AutohomeKoubei() | ||
# koubei.handle_font() | ||
koubei.handle_detail() |
Binary file not shown.
Oops, something went wrong.