Timeline for Trying to reverse encypter to decrytper in C. Can't figure out what I'm missing
Current License: CC BY-SA 4.0
12 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Sep 2, 2023 at 23:57 | comment | added | Rolf Rolles | I added my comment as an explicit answer to the question, such that if you accept it, you can mark the question closed. It makes the site nicer overall, you know? | |
Sep 2, 2023 at 23:56 | answer | added | Rolf Rolles | timeline score: 1 | |
Sep 2, 2023 at 23:53 | comment | added | Brandon Gregory | Fixed it, I changed the environment to perform under GLIBC2.2.5 and it worked perfectly. Thank you so very much. | |
Sep 2, 2023 at 8:18 | history | edited | sudhackar | CC BY-SA 4.0 |
fix formatting
|
Sep 1, 2023 at 1:08 | comment | added | Brandon Gregory | Thank you, I didn't think to compare the standards and libraries. That could be the problem. I'll try out that validation process and compare and fix any libraries. I'll let you know how it goes. | |
Aug 31, 2023 at 22:03 | comment | added | Rolf Rolles |
So the problem is you don't get what you expect when your decryptor runs? I'd recommend putting debug prints at each iteration in your decryption loop, and then stepping through the original program in a debugger and comparing the values along the way. The problem might be that the C standard library you're using implements rand (and srand ) differently from the binary's version. The validation process I outlined will let you hone in on the problem very quickly.
|
|
Aug 31, 2023 at 17:29 | history | edited | Brandon Gregory | CC BY-SA 4.0 |
deleted 5 characters in body
|
Aug 31, 2023 at 17:25 | comment | added | Brandon Gregory | Yes, I was initially trying something with the original program and comparing it. I have it fixed to the first 4 bytes of the file now. I'll edit the post to reflect that. | |
Aug 31, 2023 at 16:20 | comment | added | Rolf Rolles |
Previous comment is correct. The decompilation shows that the seed for the random number generator is the first 4 bytes in the .enc file. You're using a hard-coded seed, though. You need to read the first 4 bytes and use that as your seed instead of using a fixed value. You appear to have realized that, and then commented the code out and used a fixed seed anyway.
|
|
Aug 31, 2023 at 15:30 | comment | added | w s | It looks like you're initializing srand with a constant in your decriptor, while in encryptor it is initialized with something else. Are you sure that it should be so? | |
S Aug 31, 2023 at 13:59 | review | First questions | |||
Sep 3, 2023 at 22:15 | |||||
S Aug 31, 2023 at 13:59 | history | asked | Brandon Gregory | CC BY-SA 4.0 |