如何使用DeRez从iTunes.rsrc获取图像?

Dav*_*vid 11 itunes

如何使用DeRez从iTunes.rsrc获取图像?我只想要png或标准图像文件.谢谢.

Nic*_*ley 11

这有效:

DeRez -only 'PNG ' /Applications/iTunes.app/Contents/Resources/Images.rsrc -useDF > iTunes.png
Run Code Online (Sandbox Code Playgroud)

然后在Python 2.x中运行此脚本(我尝试使用它之间的位/* ... */以避免解码,但它不起作用).

for l in file('iTunes.png'):
    if not l[0] == '\t':
        if l.startswith('data '):
            res_id = l[l.rindex('(') + 1:l.rindex(')')]
            out = file(res_id + '.png', 'wb')
        continue
    out.write(l[l.index('"') + 1:l.index('" ')].replace(' ', '').decode('hex'))
Run Code Online (Sandbox Code Playgroud)

您应该为每个资源ID获取一个PNG文件.