7

-1640531527 is hexadecimal '0x9e3779b9'. This number is used in boost hash function. The code here in function ub4 hash( k, length, initval) looks similar to yours, at least in the last part. I think that it is a good point to start googling from. As far as I can say it is probably intermediate variant(lookup2) of Jenkins Hash


6

This is quite likely either a botched RIPEMD128 or something very similar, as otus also commented. You wanted to know how to approach such a task so I'll explain what I did. Typically, when trying to identify crypto-related code you rely on spotting constants. In this case, the constants seem to be obfuscated on purpose, so you need to play around with the ...


6

Some more low-level details: What is the purpose of (*(_BYTE *)(content + 7) << 24) isn't a byte only 8 bits, so won't it be 0 every time? In C, shifts implicitly promote the operand to at least an int/unsigned int, so the _BYTE value gets promoted to an unsigned int. This is probably because most processors support shifts on a single word size and ...


6

Your problem seems to be related to what Sibyl aim at doing (https://github.com/cea-sec/Sibyl). It tries based on the side effects of the function (return value, memory writes, ...) to identify a known function. Of course, you will need a kind of database to "learn" the function !


5

This is actually one of the main attributes of Cryptographic Hash Functions. As mentioned in the wiki page, they are designed so they cannot be reversed: It is infeasible to generate a message from its hash value except by trying all possible messages Additionally, the property which dictates a small change in the message will result in a completely ...


5

As explained there for a similar problem, facing an unknown Frame Check Sequence, the first thing should be to determine if it is an affine function of the frame data, for the sense that has in cryptography. This can be defined by the property: For any set with an odd number of frames of equal length, the XOR of the Frame Check Sequences for these frames ...


5

If you have all the possible input and all the expected outputs, and they're not indistinguishable from encrypted/compressed data, you can find more efficient storage mechanisms than just having a large lookup table. Even a simple genetic algorithm can very quickly get you to "use a * b, unless a == 234" (I've actually made a solver specifically for this ...


4

Just a small addition to the previous answers. The following shift construct, asked in 3, is a widely used way to convert a byte stream into a 32-bit integer. (*(_BYTE *)(content + 7) << 24) + (*(_BYTE *)(content + 6) << 16) + (*(_BYTE *)(content + 5) << 8) + *(_BYTE *)(content + 4) 31 24 23 16 15 8 7 0 ...


4

Unless you try all the input possibilities, as you suggested, you can only get an approximation of the function. This is basically one of the basic problems in the machine learning field, so I would look that way instead of trying to generate a lookup table for 2^32 * 2^32 values. You should obviously be careful that you won't have 100% guarantee that the ...


4

The two vertical bars hints towards 3 separate parts of the cookie. It seems that the first part is a base64 encoded json object. For the first part of the cookie no. 1 that would be: eyJ0YWxrX3N0YXRlIjowfQ\075\075 which decoded is: {"talk_state":0} nb: each "\075" is the unicode value for ascii character "K". Post login, the first part becomes: {"...


3

I wanted to give this a try because it seemed interesting but I did not succeed. Still, maybe this will lead you in the right direction for further tests. I started reading some introduction material on CRCs: http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html and this one where someone else was trying to reverse engineer a CRC: https://...


3

you possibly have an extra 0 in the month https://www.freeformatter.com/hmac-generator.html#ad-output 2017727 87gs4 c698c872565f2f1021645993fe29eff6adba41cb1260b7e671fc1752ae8d94a0 it is padded according to format string http://www.fileformat.info/tip/java/simpledateformat.htm !


3

A Lame brute forcer with an arbitrary seed value using the code you provided finds a few collisions under an hour #include <stdio.h> #include <windows.h> int bitXor(int a,int b) { return (a & ~b) | (~a & b); } void hashit( void) { SYSTEMTIME st; unsigned long specialNum=0x4E67C6A7,savedspecialNum=0x4E67C6A7; unsigned int ...


3

Since it is a crackme, I don't want to spoiler the solution, although I try to give some hint, which may help you. The hash function may be MD5 using salt, modified IV or the hash function is used in a different way as you try. However, you neither have to reverse the hash function nor have to find out the exact algorithm. It is because, the crackme ...


3

Not in the long run. Hashing of certain parts of files is still used to push data updates quickly when a new malicious sample shows up in the wild, to get the clients protected as soon as possible. But malware nowadays is very polymorphic so hashing is easy to defeat. Detailed analysis of samples take a lot of time often weeks or months and after that ...


3

This paper shows why it is not the best choice using MD5 for virus signatures. You should avoid SHA-1 also, because practical collision may be possible within years. So, consider using SHA-256 or SHA-3.


3

I took a little Perl program that i'd written a while ago when i had a similar problem, and changed it to match your data. This is supposed to generate all permutations of "test:admin", which any character as the separator, and including all abbreviations (to handle the case that only a few bytes from the username are taken). I got around 50 results ...


2

I would advise you to look for an hash identification software. You can find several freely available on Internet. For example: HashTag (specialized in password hash identification); OnlineHashCrack Hash Identification (supports 250 hash types); hash-identifier; hashID; ... and so on ... I tried your sample with HashTag and it seems to be an MD5 algorithm ...


2

Here are several different approaches to finding the hashing algorithm (and from there, its caller), all of which can be done statically (since you said you were having trouble setting a breakpoint at runtime): Search the disassembly for MD5 constants, such as 67452301, d76aa478, etc. Search the disassembly for the string "MD5" and references to that string....


2

The token for this program is 57 characters long, and is encrypted using a 200KB lookup table. The cipher text is embedded in the application as 57 dword indices. Anti-debugging is implemented as a simple check against IsDebuggerAttached, which chooses between 57 good or 57 bad indices. When the app starts the token is decrypted and then hashed one ...


2

This problem essentially describes the field of sequential analysis coupled with curve fitting. If you are able to make some assumptions about the inputs to the secret function that your model needs to be good for, you can use this to guide your choice of algorithm for generating new values to try as inputs to the function. If you are able to make some ...


1

You could run Yara with a set of crypto signatures. Is something like this what you are looking for?


1

You can usually spot MD5 quite easily by looking for a huge function. It tends to be the biggest function in the whole binary. That's the MD5_Process() (if I recall the name correctly) function which compilers like to unroll completely, thus making it huge. Generally, typical hash functions have 3 distinct functions: An init function setting up the hash ...


1

I actually found the hash function today by reverse-engineering the game's code. Here it is, translated to Python: def hashFunction(data): h = -1 for c in data: if (c - 65) & 0xFFFFFFFF <= 0x19: c |= 0x20 h = (h * 33 + c) & 0xFFFFFFFF return h When run with b'5', b'10', b'25', etc., this function ...


1

From your description, I suspect these are not hashes but just randomly-generated numerical IDs, incremented as new strings were added around the same place to the program (possibly because programmer was too lazy to regenerate a completely new ID). There is a small possibility that the ID depends on the string contents but I doubt it. In any case, if you ...


1

So finally, I used Cycript and attached to the running app process, and consequently intercepted the private key in runtime.


1

No form of hashing, when used alone, is a good way of developing an AV solution. While hashes can be useful for finding instances of a known sample across a network, heuristic and behavioural AV systems are far more likely to protect the host from infection.


1

Unique key names come in handy here. Short search on some of the names suggest that this is coming from the Pankia gaming SDK. Quick review confirms that verifier is SHA1 of some kind of game secret and a UUID.


1

As you mentioned OllyDbg I'm assuming you use windows. A quick search of the Unity Script Reference brings up Windows.Crypto.ComputeMD5Hash(). This function needs to be implemented by the Unity Engine. Either using the Windows Api - so set a breakpoint on CryptCreateHash() and CryptHashData() Or implementing it manually. To find that you can use Jason ...


1

It looks like someone has written code to decrypt these files. You can see the details of the implementation here: bbtucrypt


Only top voted, non community-wiki answers of a minimum length are eligible