Newbie question, how can you perform the inverse of a "FILEXOR" command?

Programming related discussions related to game research
GarryOlsen
Posts: 11
Joined: Sun May 02, 2021 5:45 am

Newbie question, how can you perform the inverse of a "FILEXOR" command?

Post by GarryOlsen »

Hey all,

I've been looking at the Quake 3 engine PK3 decoder QuickBMS script and was wondering how I would go about performing the inverse of the given "FILEXOR" command, to effectively encrypt a given ".PK3" file that had already been decrypted with the previously mentioned script. I don't really understand how the "FILEXOR" command works, I understand the basics of XOR gates but thats about it.
spiritovod
Posts: 719
Joined: Sat Sep 28, 2019 7:00 pm

Re: Newbie question, how can you perform the inverse of a "FILEXOR" command?

Post by spiritovod »

@GarryOlsen: XOR is reversible operation, so you can actually use the same script to encrypt modified zip file back. It's just output folder should be different from input folder, otherwise it'll try to rewrite zip -> zip (or you can edit script and change "zip" to pk3 or something).