Skip to content

Commit

Permalink
更新代码添加提示
Browse files Browse the repository at this point in the history
  • Loading branch information
Seraphli committed Jun 23, 2017
1 parent 65246d9 commit db803be
Show file tree
Hide file tree
Showing 75 changed files with 86 additions and 66 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
build
.idea
__pycache__
wic.spec
20 changes: 6 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@

## 注意

1. 如果使用代码运行的话需要使用Python运行,且需要binascii包,推荐装一个winPython或是anaconda.
如果使用的是编译后的exe运行则不需要Python,可以直接运行.
1. 如果使用代码运行的话需要使用Python运行,且需要binascii包,推荐装一个winPython或是anaconda. 如果使用的是编译后的exe运行则不需要Python,可以直接运行.

2. 不要外传,以免算法失效

Expand All @@ -19,23 +18,17 @@

1. 根据修改时间

2. 在电脑端的微信上找到那张图片的前后图片,
然后右键保存,从弹出的保存窗口中复制默认的文件名,
然后在文件夹中搜索文件名,会找到一个和此保存的文件名相似的dat文件,
然后查找前后.
2. 在电脑端的微信上找到那张图片的前后图片, 然后右键保存,从弹出的保存窗口中复制默认的文件名, 然后在文件夹中搜索文件名,会找到一个和此保存的文件名相似的dat文件, 然后查找前后.

### 操作步骤(两种方法选一种)

1. 首先确认系统是否打开显示文件扩展名的选项.没有的话请谷歌或百度.

2. 方法中所提到的"通过在电脑端发送color_sheet.jpg文件,得到dat文件",
指的是将color_sheet.jpg文件发送到文件传输助手或是任意一位好友.
主要目的是为了得到对应的dat文件.通过此文件明文与密文的对应关系来解码需要恢复的dat文件.
2. 方法中所提到的"通过在电脑端发送color_sheet.jpg文件,得到dat文件", 指的是将color_sheet.jpg文件发送到文件传输助手或是任意一位好友. 主要目的是为了得到对应的dat文件.通过此文件明文与密文的对应关系来解码需要恢复的dat文件.

#### 第一种方法

1. 通过在电脑端发送color_sheet.jpg文件,得到dat文件,
复制到代码文件夹,更名为color_trans.dat
1. 通过在电脑端发送color_sheet.jpg文件,得到dat文件, 复制到代码文件夹,更名为color_trans.dat

2. 把需要转换的文件复制进代码文件夹,更名为in.dat

Expand All @@ -45,10 +38,9 @@

#### 第二种方法

1.[百度云盘](http://pan.baidu.com/s/1o8IOSyA) 密码: 8d31 下载WinEXE.zip文件,解压到文件夹
1.[百度云盘](http://pan.baidu.com/s/1c4bxMY) 密码: 2j9h 下载WinEXE.zip文件,解压到文件夹

2. 通过在电脑端发送color_sheet.jpg文件,得到dat文件,
复制到程序文件夹,更名为color_trans.dat
2. 通过在电脑端发送color_sheet.jpg文件,得到dat文件, 复制到程序文件夹,更名为color_trans.dat

3. 把需要转换的文件复制进程序文件夹,更名为in.dat

Expand Down
Binary file removed dist/_ctypes.pyd
Binary file not shown.
Binary file removed dist/_hashlib.pyd
Binary file not shown.
Binary file removed dist/_socket.pyd
Binary file not shown.
Binary file removed dist/_ssl.pyd
Binary file not shown.
Binary file removed dist/bz2.pyd
Binary file not shown.
Binary file removed dist/color_trans.dat
Binary file not shown.
Binary file removed dist/in.dat
Binary file not shown.
Binary file removed dist/library.zip
Binary file not shown.
Binary file removed dist/out.jpg
Binary file not shown.
Binary file removed dist/python27.dll
Binary file not shown.
Binary file removed dist/pywintypes27.dll
Binary file not shown.
Binary file removed dist/select.pyd
Binary file not shown.
Binary file removed dist/unicodedata.pyd
Binary file not shown.
Binary file removed dist/w9xpopen.exe
Binary file not shown.
Binary file removed dist/wic.exe
Binary file not shown.
Binary file added dist/wic.zip
Binary file not shown.
Binary file added dist/wic/VCRUNTIME140.dll
Binary file not shown.
Binary file added dist/wic/_bz2.pyd
Binary file not shown.
Binary file added dist/wic/_ctypes.pyd
Binary file not shown.
Binary file added dist/wic/_hashlib.pyd
Binary file not shown.
Binary file added dist/wic/_lzma.pyd
Binary file not shown.
Binary file added dist/wic/_socket.pyd
Binary file not shown.
Binary file added dist/wic/_ssl.pyd
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-console-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-datetime-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-debug-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-errorhandling-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-file-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-file-l1-2-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-file-l2-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-handle-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-heap-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-interlocked-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-libraryloader-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-localization-l1-2-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-memory-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-namedpipe-l1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-profile-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-rtlsupport-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-string-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-synch-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-synch-l1-2-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-sysinfo-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-timezone-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-core-util-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-conio-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-convert-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-environment-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-filesystem-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-heap-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-locale-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-math-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-process-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-runtime-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-stdio-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-string-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-time-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/api-ms-win-crt-utility-l1-1-0.dll
Binary file not shown.
Binary file added dist/wic/base_library.zip
Binary file not shown.
File renamed without changes
Binary file added dist/wic/pyexpat.pyd
Binary file not shown.
Binary file added dist/wic/python35.dll
Binary file not shown.
Binary file added dist/wic/select.pyd
Binary file not shown.
Binary file added dist/wic/ucrtbase.dll
Binary file not shown.
Binary file added dist/wic/unicodedata.pyd
Binary file not shown.
Binary file added dist/wic/wic.exe
Binary file not shown.
13 changes: 13 additions & 0 deletions dist/wic/wic.exe.manifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity name="wic" processorArchitecture="amd64" type="win32" version="1.0.0.0"/>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
</application>
</compatibility>
</assembly>
Binary file removed dist/win32api.pyd
Binary file not shown.
Binary file removed dist/win32evtlog.pyd
Binary file not shown.
116 changes: 64 additions & 52 deletions wic.py
Original file line number Diff line number Diff line change
@@ -1,52 +1,64 @@
# wechat image convert
import binascii

# first need two file to find rule
trans = 'color_trans.dat'
sheet = 'color_sheet.jpg'

binfile = open(trans,'rb')
a = binfile.read()
hex_trans = binascii.b2a_hex(a)

binfile = open(sheet,'rb')
a = binfile.read()
hex_sheet = binascii.b2a_hex(a)

rule = [0] * 256
flag = [False] * 256
for i in range(len(hex_trans)/2):
hex_t = hex_trans[2*i:2*(i+1)]
hex_s = hex_sheet[2*i:2*(i+1)]
int_t = int(hex_t,16)
int_s = int(hex_s,16)
if flag[int_t] == False:
rule[int_t] = int_s
flag[int_t] = True
if flag.count(True) == 256:
break

# second convert dat file
in_file = 'in.dat'
out_file = 'out.jpg'

binfile = open(in_file, 'rb')
a = binfile.read()
binfile.close()
hex_in = binascii.b2a_hex(a)

out_ret = ''
for i in range(len(hex_in)/2):
hex_t = hex_in[2*i:2*(i+1)]
int_t = int(hex_t,16)
int_ret = rule[int_t]
if int_ret>15:
hex_ret = hex(int_ret)[2:]
else:
hex_ret = '0' + hex(int_ret)[2:]
out_ret += hex_ret
hex_file = out_ret.decode('hex')

binfile = open(out_file, 'wb')
binfile.write(hex_file)
binfile.close()
import traceback

try:
# wechat image convert
import binascii

# first need two file to find rule
trans = 'color_trans.dat'
sheet = 'color_sheet.jpg'

binfile = open(trans, 'rb')
a = binfile.read()
hex_trans = binascii.b2a_hex(a)

binfile = open(sheet, 'rb')
a = binfile.read()
hex_sheet = binascii.b2a_hex(a)

rule = [0] * 256
flag = [False] * 256
for i in range(len(hex_trans) // 2):
hex_t = hex_trans[2 * i:2 * (i + 1)]
hex_s = hex_sheet[2 * i:2 * (i + 1)]
int_t = int(hex_t, 16)
int_s = int(hex_s, 16)
if flag[int_t] == False:
rule[int_t] = int_s
flag[int_t] = True
if flag.count(True) == 256:
break

# second convert dat file
in_file = 'in.dat'
out_file = 'out.jpg'

binfile = open(in_file, 'rb')
a = binfile.read()
binfile.close()
hex_in = binascii.b2a_hex(a)

out_ret = ''
for i in range(len(hex_in) // 2):
hex_t = hex_in[2 * i:2 * (i + 1)]
int_t = int(hex_t, 16)
int_ret = rule[int_t]
if int_ret > 15:
hex_ret = hex(int_ret)[2:]
else:
hex_ret = '0' + hex(int_ret)[2:]
out_ret += hex_ret
hex_file = bytes.fromhex(out_ret)

binfile = open(out_file, 'wb')
binfile.write(hex_file)
binfile.close()
print(u'转换成功')
except Exception as e:
print('Exception Info')
print('-' * 10)
print('traceback.format_exc():')
print(traceback.format_exc())
print('-' * 10)

input(u'按任意键退出\n')

0 comments on commit db803be

Please sign in to comment.