Quote
Originally posted by andrew:
**Any specific questions, ask away.
**
Wow. Um. I was kinda hoping you'd point me to a well annotated piece of C or some documentation, but ok, here goes....
Just so you know what I'm trying to do: I want to make an applescript that dumps pilot file info to a tab deliminated text file for use with spreadsheets (similar to the applescripts I made that do the same thing for EV plugs and data files). Yes, the pilot file has lots of data, but that's ok. I wouldn't need to export all of it at once.
Anyway, the only example of SimpleCrypt I've seen in action is the the EVDeEncryptor C source(http://www.ambrosias...tor10d1.sit.hqx). I don't know C, but can vaguely see what is going on in the crucial part, but don't entirely understand it. I'm afraid I only know some scripting languages, so please forgive me if I use terms incorrectly
I was going to paste the crucial chunk here, but ftp.ambrosiasw.com isn't cooperating. From memory:
theResource= the resource, I'm assuming in hex
resSize= the resource size. What does this mean? # characters? Number bits?
magicNumb=0xABCD1234. Fine. It's a hex number. I think it = -1412623820
*vPtr=*theResource. I know it's a pointer, but am not sure what's going on.
for (i=resSize/4; i<0; i--) I grock.
*(vPtr++)^=magicNumb Huh? The pointer is adding one to itself, and then doing a bitwise exclusive OR, but I don't understant what the pointer is actually pointing to. The whole resource? The first four bits of the resource? I suspect that it's pointing to the first four bits in the file (ABCD1234) at the start of the loop, but during n+1 times through the loop, is it comparing the next block of 4 bits to magicNumb? I'm confused.
magicNumb=magicNumb+0xDEADBEEF Fine. No problems
magicNumb^=0xDEADBEEF Again, I understand.
Here's where my memory breaks down. I know there is a right bitshift (>>24) and then a left bitshift (<<8), but don't remember clearly.
Anyway, the first part, as I said, makes sense to me looking at the starting hex in a pilot file:
startVal=0xABCD1234 when looking at a virgin pilot file
magicNumb=0xABCD1234
therefore
startVal^=magicNumb would be all zeros.
magicNumb=magicNumb+0xDEADBEEF would equal 0xDEADBEEF
magicNumb^=0xDEADBEEF would equall all zeros.
This is why the start of the pilot file = ABCD1234 and the decrypted values are 00, 00, 00, 00
Beyond understand this, I'm lost. Sorry this is kind of random. I know so little that I don't even know the questions to ask :frown:
-STH
------------------