资源简介
Sony F828 Raw 文件格式解码
代码片段和文件信息
/*
Completely decrypt a Sony DSC-F828 raw file.
by Dave Coffin 1/4/2004
*/
#include
#include
#include
//#include
typedef unsigned char uchar;
typedef union {
unsigned char uc[4];
unsigned long ul;
} UDWord;
unsigned long
htonl(unsigned long ll)
{
UDWord x;
UDWord y;
x.ul = ll;
y.uc[0] = x.uc[3];
y.uc[1] = x.uc[2];
y.uc[2] = x.uc[1];
y.uc[3] = x.uc[0];
return y.ul;
}
unsigned long
ntohl(unsigned long ll)
{
return htonl(ll);
}
void sony_decrypt (void *buf int len int key)
{
unsigned pad[128] *data=buf;
int i;
for (i=0; i < 4; i++)
pad[i] = key = key * 48828125 + 1;
pad[3] = pad[3] << 1 | (pad[0]^pad[2]) >> 31;
for (i=4; i < 127; i++)
pad[i] = (pad[i-4]^pad[i-2]) << 1 | (pad[i-3]^pad[i-1]) >> 31;
for (i=0; i < 127; i++)
pad[i] = htonl(pad[i]);
for ( ; i < len+127; i++data++)
*data ^= pad[i & 127] = pad[(i+1) & 127] ^ pad[(i+65) & 127];
}
void sony_clear (uchar *buffer int length)
{
unsigned *ip key0 key1=0 key2=0 i;
uchar *cp;
ip = (void *) cp = buffer+200896;
key0 = ntohl(ip[*cp]);
sony_decrypt (buffer+164600 9074 key0);
for (i=4; i--; ) {
key1 = key1 << 8 | buffer[164610+i];
key2 = key2 << 8 | buffer[164622+i];
}
sony_decrypt (buffer+164640 174376 key1);
sony_decrypt (buffer+862144 (length-862144)/4 key2);
}
int main (int argc char **argv)
{
FILE *fp;
char name[512] *buffer;
int arg length;
for (arg=1; arg < argc; arg++) {
fp = fopen (argv[arg] “rb“);
if (!fp) {
perror (argv[arg]);
continue;
}
fseek (fp 0 SEEK_END);
length = ftell (fp);
if (length < 0x100000) {
fprintf (stderr “%s is too small!\n“ argv[arg]);
fclose(fp);
continue;
}
buffer = malloc (length);
if (!buffer) {
fprintf (stderr “%s is too big!\n“ argv[arg]);
fclose(fp);
continue;
}
fseek (fp 0 SEEK_SET);
fread (buffer 1 length fp);
fclose (fp);
sony_clear (buffer length);
strcpy (name argv[arg]);
strcat (name “.clear“);
fp = fopen (name “wb“);
fwrite (buffer 1 length fp);
free (buffer);
fclose(fp);
}
return 0;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2011-07-04 18:10 sony_raw_decrypt\
目录 0 2011-07-04 18:10 sony_raw_decrypt\Debug\
文件 9528 2011-07-04 18:10 sony_raw_decrypt\Debug\BuildLog.htm
文件 60 2011-07-04 18:10 sony_raw_decrypt\Debug\mt.dep
文件 382464 2011-07-04 18:10 sony_raw_decrypt\Debug\sony_clear.exe
文件 381 2011-07-04 18:10 sony_raw_decrypt\Debug\sony_clear.exe.intermediate.manifest
文件 194708 2011-07-04 18:10 sony_raw_decrypt\Debug\sony_clear.ilk
文件 11223 2011-07-04 18:10 sony_raw_decrypt\Debug\sony_clear.obj
文件 1879040 2011-07-04 18:10 sony_raw_decrypt\Debug\sony_clear.pdb
文件 33792 2004-07-14 14:46 sony_raw_decrypt\Debug\vc60.idb
文件 45056 2004-07-14 14:45 sony_raw_decrypt\Debug\vc60.pdb
文件 27648 2011-07-04 18:10 sony_raw_decrypt\Debug\vc90.idb
文件 53248 2011-07-04 18:10 sony_raw_decrypt\Debug\vc90.pdb
文件 242 2004-07-13 19:26 sony_raw_decrypt\readme.txt
文件 2321 2011-07-04 18:10 sony_raw_decrypt\sony_clear.c
文件 3447 2004-07-13 18:45 sony_raw_decrypt\sony_clear.dsp
文件 545 2004-07-13 18:52 sony_raw_decrypt\sony_clear.dsw
文件 584704 2011-07-11 10:40 sony_raw_decrypt\sony_clear.ncb
文件 53760 2008-01-09 12:21 sony_raw_decrypt\sony_clear.opt
文件 1184 2004-07-14 14:45 sony_raw_decrypt\sony_clear.plg
文件 885 2011-07-11 10:40 sony_raw_decrypt\sony_clear.sln
文件 10752 2011-07-11 10:40 sony_raw_decrypt\sony_clear.suo
文件 4004 2007-07-02 15:00 sony_raw_decrypt\sony_clear.vcproj
文件 1421 2011-07-11 10:40 sony_raw_decrypt\sony_clear.vcproj.gaozheyuan-PC.gaozheyuan.user
相关资源
- Qt之实现录音播放及rawpcm转wav格式
- drawcli.zip
- LoRaWAN协议解析--MAC帧分解
- 使用LabVIEW读取DXF文件并显示该图形直
- CListCtrl重绘 Redraw 源码
- Socket Raw实现的IPV4INIPV6 UDP数据包发送
- DrawerLayout去除阴影,阴影部分点击不
- dcraw源代码
- CorelDraw X4面积和周长计算
- SmartDraw 2008 keygen
- SONY VISCA协议控制软件带回显
- edraw v8.4版本破解版.txt
- vmware15+macos10.14+unlocker3.0+darwin
- 在UniGUI中使用百度Echarts作为数据展示
- SONY VISCA协议中文PDF
- 佳能官网的DPP,专用于CR2格式照片编
- Corel.All.Products.Universal.Keygens.by.CORE.v
- sony IMX290 driver (SPI)
- 博客-Windows窗体原理及控件WM_DRAWITEM和
- sony_imx307.7z
- 事故树绘制软件easydraw免费V2.19
- QGraphicsView Draw
- ProDrawCallOptimizer 4.2
- MagicDraw.UML
- ArcGIS js api 4+版本 draw measure legend扩展
- bmp转换成raw格式: bmp2raw
- 画图程序Graphic
- RAW CR2文件完全解析
- Draw2DLine.rar
- OV5647_MIPI_RAW for MTK
评论
共有 条评论