![]() |
GMP function
Anybody familiar enough with GMP (Gnu MP big number library) to identify this function?. None of the gmp sigs I have tried recognise any of the library functions but I am certain it is GMP or a derivative. I may have misidentified the 16byte struct type that the parameter points to.
Code:
.text:10001000 ; void __cdecl SUB01(mpf_ptr x) |
I didn't know GMP before, but I tried to find you code in GMP4 and GMP5. I tried finding the "ror" part, since I think it's very unusual.
The source doesn't contain any matching "ror" in the *.asm files. The source doesn't contain any matching pseudo-C "ror" like "(x>>n | x<<32-n)" in any file. The compiled GMP4 and GMP5 libraries don't contain any "ror" instruction. Maybe it's a different GMP version or different compiler settings where used. I think the function doesn't modify a "mpf_ptr" structure, the arithmetic operations don't really fit the structure. |
No, having looked further, I believe the struct is based on the 12 byte mpz_struct type with 4 bytes for another field. I also think it may be a custom random generator. The function that calls it certainly looks like a random seeding procedure. It's also possible that the ror has arisen from compiler optimisation, but of what I don't know.
Thanks for taking the time to look. Git |
Code:
_C = D + A - ROR(B, 5)A "mpz_struct" doesn't fit either. Both structures contain a pointer and XORing pointers isn't the best idea, even if adding or subtracting is sometimes used with pointers. Do you have a link to the code you're analysing? Just this one code fragment doesn't show much. |
Yes, it is some sort of hash function used to return a randomish sequence of numbers. The struct is something like :
struct hash_ctx { ULONG salt; ULONG a0; ULONG a1; ULONG a2; } An initialising function sets salt to an obscure 32 bit constant and a0=a1=a2 to a second parameter and then calls the hash function. The hash function is then called successively returning the value in eax which is the same as field ctx->a2. Git |
| All times are GMT +8. The time now is 13:45. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX