Vintage Erotica Forums

Vintage Erotica Forums (http://vintage-erotica-forum.com/index.php)
-   Tutorials (http://vintage-erotica-forum.com/forumdisplay.php?f=27)
-   -   Decoding Digital Red AVI Files (http://vintage-erotica-forum.com/showthread.php?t=183480)

Firebringer November 11th, 2011 01:44 AM

Decoding Digital Red AVI Files
 
In my quest (some might say obsession) to find new Veronica Vanoza material, I stumbled across her in a Strip Poker game from a company called Digital Red. The name of the game is "All Star Strip Poker - Girls at Work". I downloaded the DVD image hoping to be able to pull content from the disc.

Luckily for me, I found some neatly packaged AVI files in a data directory!! Unluckily, they didn't seem to play on a standard media player (WMP). Figuring that there might be some special codec used to play them, I installed the game on a virtual machine.

The game installed fine and I was able to play it, but I still couldn't play the AVI files outside the game. Decided to take a look at the raw binaries, expecting to see the standard AVI header: RIFFxxxxAVI (where xxxx is the length of the data). Noticed that instead I found (in hex) 0xad 0xb6 0xb9 0xb9 ... Looks like "RIFF" with some kind of simple bytewise encoding scheme -- obfuscation instead of encryption. Took a guess that an XOR scheme was probably used and XORed 0xad with 0xff -- low and behold: "R". Did the same for the next three bytes and "RIFF" emerged from the confusion!!!

So, a quick piece of c code later and I had a binary to de-obfuscate the AVI files. I present, in it's entirety, my simple source used to decode Digital Red AVI files.

Code:

#include <stdio.h>

void main() {
  int i;

  i = getchar();
  while(i != EOF) {
    printf("%c", (i ^ 255) & 255);
    i = getchar();
  }
}

Compile with any c compiler (I used gcc under Linux). Pipe the file into the binary (a.out) and pipe the result to the new file and voila!!!

Example: a.out < e01.avi > e01_fixed.avi


There are several other sexy babes out on these games, so if you run across them, please decode away!!!

firebringer

bladess December 26th, 2016 08:19 PM

Hi Firebringer,

Nice discovery!

I've been trying to use your code to extract a few Digital Red avi s myself, but it only starts to decode the file, and after 20-50 kB of data it terminates (I have avi files ranging from 5MB to 100 MB).

Did you come across this kind of a problem?
(I was compiling your code under Win with minGW and also with Visual Studio 2015 without success, and I've started to wonder if the EOF is interpreted differently here than in Linux. )

Any help is appreciated,
Thank you!

Firebringer January 5th, 2017 07:38 PM

Quote:

Originally Posted by bladess (Post 3888087)
Hi Firebringer,

Did you come across this kind of a problem?
(I was compiling your code under Win with minGW and also with Visual Studio 2015 without success, and I've started to wonder if the EOF is interpreted differently here than in Linux. )

I was able to decrypt all the Veronica material without problem. Using STDIN, the EOFs shouldn't be a problem with windows. I'd suggest you change the "%c" to a "%d" and look for common values when the file ends -- obviously just let it print to the screen rather than redirecting to a file. That should help you determine if it's an input problem, a character problem, or an output problem.

You can also look up any kind of Windows xor program. I know that they are commonly used to evaluate potential malware, so shouldn't be too hard to come by.

Good luck! Glad to see this old code still providing some kind of value to the community!

retroanalyst January 6th, 2017 03:24 PM

Quote:

Originally Posted by bladess (Post 3888087)
I've been trying to use your code to extract a few Digital Red avi s myself, but it only starts to decode the file, and after 20-50 kB of data it terminates (I have avi files ranging from 5MB to 100 MB).

Did you come across this kind of a problem?
(I was compiling your code under Win with minGW and also with Visual Studio 2015 without success, and I've started to wonder if the EOF is interpreted differently here than in Linux. )

Indeed, this is the problem. By default, the stdio functions in Windows compilers convert "\n" to "\r\n" on write, since the latter (carriage return + linefeed) is what Windows uses to separate lines in text files.

Of course this treatment corrupts binary files, but there is a solution: you can force binary I/O with the _setmode() function in MinGW, like so:

Code:

#include <fcntl.h>
_setmode(_fileno(stdin),_O_BINARY);
_setmode(_fileno(stdout),_O_BINARY);

See http://www.willus.com/mingw/_binary.shtml.

bobthefish2 October 11th, 2023 07:40 AM

Apologies, but as a non-coder person is there a way to easily extract these video files from the digital red games anymore? It seems to no longer display video even on older emulation machines for some reason.

Jazz67 October 11th, 2023 11:05 AM

there's a query on the same issue here,
http://vintage-erotica-forum.com/t44...next-door.html

I'll probably merge these at some point

bobthefish2 October 22nd, 2023 08:51 AM

Alright so I found a python script from MyAbandonware that lets me rewrite the hex code:

import os

# Specify the XOR key
xor_key = 0xff # Replace with your XOR key in hexadecimal format
# Get the current directory
current_directory = os.getcwd()
# Create a 'decrypted' folder if it doesn't exist
output_directory = os.path.join(current_directory, 'decrypted')
os.makedirs(output_directory, exist_ok=True)

# Define the XOR decryption function
def xor_decrypt(input_file, output_file, key):
if filename.endswith('.avi'):
with open(input_file, 'rb') as encrypted_file:
encrypted_data = encrypted_file.read()
decrypted_data = bytes([byte ^ key for byte in encrypted_data])
with open(output_file, 'wb') as decrypted_file:
decrypted_file.write(decrypted_data)

# List all files in the current directory
for filename in os.listdir(current_directory):
# Check if the file is an AVI file (you can modify this check if needed)
if filename.endswith('.avi'):
# Construct the input and output file paths
input_file = os.path.join(current_directory, filename)
output_file = os.path.join(output_directory, filename)

# Decrypt the file
xor_decrypt(input_file, output_file, xor_key)
print(f'Decrypted {filename} and saved as {os.path.basename(output_file)} in the "decrypted" folder')

However, I am unable to run this automatically because it appears to stop for whatever reason and my python skills are terrible so all I can do is run this manually and it will convert one file at a time.

In the process I did discover that @firebringer is probably missing a video of Veronica Venoza because it turns out the Polish version of girls at work contains additional scenes not available in the german/russian version that's been going around.

If someone can help me figure out why this python code won't loop I would appreciate it. Also, if someone has the original polish version of girls next door as well as the original I would appreciate it, as I believe they both have additional hardcore scenes not available in the german version.

https://thumbs2.imgbox.com/a4/c1/PYftLVAo_t.png

bobthefish2 October 23rd, 2023 08:07 AM

Alright so I figured out the code loop issue. turns out python really, really enforces spacing between lines of code. I've uploaded an image of my final code for future people to find. Feel free to change the directory to the one you plan on using. And remember, spacing AND indentation matters.

Finally, for Firebringer, I just want him to know that between the German/Russian version of Girls at Work vs the Polish version there are 397 video clips vs 434 video clips so about 37 more clips of all the girls, i think there's another dozen or so clips of veronica alone. :-P

Happy hunting. :-)

https://thumbs2.imgbox.com/15/d6/Of4SSNYt_t.png

danyro85 January 16th, 2024 05:09 PM

Hi everyone, as also a non-coder its hard for me to follow understand what exactly needs to be done to get the avi-files encoded / encrypted.
I also tried to get the game to work on different VMS, but black screen on win98, winxp and so on.

Can somebody post a quick tutorial (what software is needed and weher to put the code) if not asked to much on how to use the code (the last picture from the post, sadly doesnt open anymore) to at least see the videos if the game is unplayable?

Thank you guys! :thumbsup:

+ pic is working, probs just imgbox being glitchy

Firebringer January 25th, 2024 08:29 PM

Quote:

Originally Posted by danyro85 (Post 7055564)
Can somebody post a quick tutorial (what software is needed and weher to put the code) if not asked to much on how to use the code (the last picture from the post, sadly doesnt open anymore) to at least see the videos if the game is unplayable?

I'm amazed to see this thread still gets traffic after all these years!!

Do you guys know about Powershell? Try the three liner below:
- open a powershell window
- navigate to your user directory on C:
- copy the file you need switched to the same directory (below, I used "a01.avi")
- run the three lines -- replace "a01.avi" and "a01-fixed.avi" with appropriate values. "a01.avi" is the encoded file you copied, "a01-fixed.avi" is the name you want it to have after it is decoded
- takes a few seconds and produces a working AVI file with no additional software needed for Windows 7+. Powershell is also available for mac and linux

Good luck!!

Code:

$bytes = [System.IO.File]::ReadAllBytes("a01.avi");
for ($i = 0; $i -lt $bytes.length; $i++) { $bytes[$i] = [Int]$bytes[$i] -bxor 0xff; }
[System.IO.File]::WriteAllBytes("a01-fixed.avi", $bytes);

If this works for you and you want a version that will automagically do every file in a given directory on your local drive, let me know and I'll post (it's a 5 liner instead of a 3 liner!)

firebringer


All times are GMT. The time now is 01:18 PM.



vBulletin Optimisation provided by vB Optimise v2.6.1 (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.