Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
However I'm also finding more and more of these .dec files that eventually decode but their hex passcodes don't work. I still haven't figured out the pattern why sometimes it works and sometimes it doesn't.
Btw I think part of HackNet is hacking the game itself, metagaming. It looks like some encoded files don't have proper headers (e.g. missing filename component entirely), so I don't think they'd ever decode in game, but so far they can be decoded by hand and it tends to be flavor text.
It sounds like you're saying there are only 35 passcodes in each bin, e.g. 0-1821 has 35 valid codes. I would think modulus 1822 (% 1822) would imply the result you're talking about. I'm not sure why division would limit it that way.
To give a more real example:
given encoded character 171939 and passcode 10875 you get 'F'
for the same character and passcode 10000 you still get 'F'
and again with passcode 11000, still 'F'
You keep getting F all the way down to passcode 9811 and all the way up to passcode 11632
In effect, anything encoded by a passcode between 9811 and 11632 shares passwords. Looking at it from the other side, any password that hashes into a passcode between 9811 and 11632 can unlock this file.
When giving the hash as a password like you described in the first post, only the first and third position seem to matter, so 0xa7ff is the same as 0xa800 (btw, I think you calculated ushort.maxvalue/2 as 32768, when it should be 32767 I think) which is the same as 0_a___. The CSEC_encode_1.dec unlocks with 0_f___ or any permutation thereof. I'm not sure why, since it should be 0xec2a.... So if the algorithm takes 2 positions and one of them can be 0-F but we know that there are only 35 distinct bins, the other must be a binary switch. As a very interesting aside, it turns out you can decrypt files that don't actually require a password with the password F_0___ or any permutation thereof!
EDIT: For CSEC_encode_1.dec 0-9 in the first position works, A-F don't. For files without password protection actually 0-9 in the first position don't work, but A-F do, so maybe the binary switch is just that: either integer or char...
The GetPassCodeFromString() behaves weirdly, so I wonder if the devs will release the source as some point as an Easter Egg :) would be interesting...
private static ushort GetPassCodeFromString(string code)
{
return (ushort)code.GetHashCode();
}
I don't know how the game keep the hash always the same but as I know string.GetHashCode() is not a stable solution for generating a unique hash value.
And yeah you can just decode the passcode from encoded "ENCODED" string (or only 'E') and use that to decode the whole chunk of data.
I checked the numerical equivalent variants for two Passwords:
beepbeep: F_e___e_ , 0_0___4_ , 9_9___3_ and dleatrou: F_e___o_ , 0_2___7_ , 0_6___3_ , 0_9___5_ and 0_9___8_
Especially the last two of the second and the last of the first one are of interest. If it it true, that actually modular arithmetic is used. this would be a nice point to start some further analysis.
I haven't checked the letter variant yet, but I think I will see what I can do.
At this point, it seems that the first letter determines between two different algorithms, which can result in the same number. That is because it just differentiates between number or letter. Also even if no password is used, the ushort passcode is not 0 but in fact 5886. I checked the DECE_TestBould_pdb.dec. The actual calculated number is 158485, but in the file, 'E' is encoded to 164371. So mybe there is something there. Also something which would stand against the GetHashCode() function.
Here[github.com] is the link to my python script!
I also found the source code for the game, and the passcode is generated using the GetHashCode() function as said above (tested using a C# program to generate a password given the password string, and I was able to decrypt all of the files I saw in game that were password protected using the number from that function converted to hexidecimal). It is done this way due to the calculation that the algorithm uses to encrypt the files in the first place (if the output from the Hash Code was different every time, you could never decrypt the file as the password offset would be wrong and spit out garbage.)