Page 1 sur 1

Dead Or Alive: Dimensions Photo Decrypter

MessagePosté: Ven 17 Juin 2011 15:28
par sniper3d
Dead Or Alive: Dimensions Photo Decrypter est un programme intéressant par jiggle/doadphdec, qui permet de décrypter les photos faites avec le jeu Dead Or Alive: Dimensions.
C'est intéressant car cela exploite le même défaut que celui utilisé par 3dsavetool pour décrypter les sauvegardes.


Pour fonctionner, vous devrez prendre des photos totalement noires, histoire de connaître la valeur à un endroit donné de l'image.
En fait, chaque numéro de photo possède sa propre clé, et le fait de faire des photos avec le même numéro que les photos à décrypter permet à chaque fois de décrypter la paire de photos, utilisant la même clé.


Voici le code source :
/*********************************************
* Dead Or Alive: Dimensions Photo Decrypter *
*********************************************
* instructions: *
* - make photos in showcase mode if you *
* haven't *
* - find your dead or alive folder in *
* extdata on SD card. if you made photos *
* it should have folder 00000000 with *
* files with size of 400416B inside. EU *
* version is 0000038a *
* - move it off the sd card to your pc *
* - disable wireless switch on 3ds so no *
* DLC is received while you screw around *
* - check how many files there are in *
* the folder you put on your pc *
* - start the game, create new SD data *
* - go to showcase mode, set stage to *
* training stage and choose crouching *
* hayabusa figure *
* - make as many completely black pictures *
* of the background, as you have files in *
* the folder on your pc, with 3d switched *
* on. it is important that only black is *
* on your pictures!! *
* - switch off 3ds and remove SD card *
* - move the new folder to your pc, but do *
* NOT overwrite the original *
* - copy original back to the SD card *
* - you can switch wifi back on and play *
* - now you can decrypt. take picture files *
* with the same filename from both *
* folders. pictures are 400416B *
* - in cmd.exe, call: *
* doadpd.exe blackfile originalfile *
* - if black file was black and both files *
* have the same number, you should have *
* originalfile.l.tga and *
* originalfile.r.tga in same folder now *
* - you can open tga with GIMP to convert *
* to PNG or JPEG *
* https://www.gimp.org/ *
* - if you want, you can even make MPO file *
* with software called StereoPhoto Maker *
* so you can view in 3D: *
* https://stereo.jpn.org/eng/stphmkr/ *
* - if you can code, feel free to make *
* better program *
* no warranty, if you screw up and lose DLC *
* it's on you *
*********************************************
* _ _ _____ _____ _ _____ *
* / |/ \/ __// __// \ / __/ *
* | || || | _| | _| | | \ *
* /\_| || || |_//| |_//| |_/\| / *
* \____/\_/\____\\____\\____/\____\ *
* let's rock *
*********************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int
main (int argc, char *argv[])
{
unsigned short t[240][400];
unsigned int z[240][400];
unsigned short *i = malloc (384000);
unsigned short c[192000];
unsigned short b[8][8];
char *f[2];
int x, y, k, j, l;
FILE *hnd;
if (argc != 3)
{
printf ("needs two filenames");
return (0);
}
hnd = fopen (argv[1], "rb");
fseek (hnd, 16416, 0);
fread (c, 1, 384000, hnd);
fclose (hnd);
hnd = fopen (argv[2], "rb");
fseek (hnd, 16416, 0);
fread (i, 1, 384000, hnd);
fclose (hnd);
for (j = 0; j < 192000; j++)
{
i[j] = i[j] ^ c[j];
}
l = strlen (argv[2]);
f[0] = malloc (l + 7);
f[1] = malloc (l + 7);
strncpy (f[0], argv[2], l);
strncpy (f[1], argv[2], l);
strncpy (f[0] + l, ".l.tga", 7);
strncpy (f[1] + l, ".r.tga", 7);
for (k = 0; k < 2; k++)
{
for (x = 0; x < 400; x += 8)
{
for (y = 0; y < 240; y += 8)
{
for (j = 0; j < 8; j += 4)
{
t[y][x + j] = *i++;
t[y + 1][x + j] = *i++;
t[y][x + j + 1] = *i++;
t[y + 1][x + j + 1] = *i++;
t[y + 2][x + j] = *i++;
t[y + 3][x + j] = *i++;
t[y + 2][x + j + 1] = *i++;
t[y + 3][x + j + 1] = *i++;

t[y][x + j + 2] = *i++;
t[y + 1][x + j + 2] = *i++;
t[y][x + j + 3] = *i++;
t[y + 1][x + j + 3] = *i++;
t[y + 2][x + j + 2] = *i++;
t[y + 3][x + j + 2] = *i++;
t[y + 2][x + j + 3] = *i++;
t[y + 3][x + j + 3] = *i++;

t[y + 4][x + j] = *i++;
t[y + 5][x + j] = *i++;
t[y + 4][x + j + 1] = *i++;
t[y + 5][x + j + 1] = *i++;
t[y + 6][x + j] = *i++;
t[y + 7][x + j] = *i++;
t[y + 6][x + j + 1] = *i++;
t[y + 7][x + j + 1] = *i++;

t[y + 4][x + j + 2] = *i++;
t[y + 5][x + j + 2] = *i++;
t[y + 4][x + j + 3] = *i++;
t[y + 5][x + j + 3] = *i++;
t[y + 6][x + j + 2] = *i++;
t[y + 7][x + j + 2] = *i++;
t[y + 6][x + j + 3] = *i++;
t[y + 7][x + j + 3] = *i++;
}
}
}
hnd = fopen (f[k], "wb");
fwrite ("\0\0\2\0\0\0\0\020\0\0\0\0\220\01\360\0\40\0", 1, 18, hnd);
for (x = 0; x < 400; x++)
{
for (y = 0; y < 240; y++)
{
z[y][x] =
(t[y][x] & 0x1F) << 3 | (t[y][x] & 0x7E0) << 5 | (t[y][x] &
0xF800) << 8
| 0xFF000000;
}
}
fwrite (z, 4, 96000, hnd);
fclose (hnd);
}
return (0);
}


Téléchargement
Téléchargement


Source