I am trying to reverse engineer a packet protocol and I was abled to find a subroutine which is likely to be an encryption function. I do not know much about cryptography but it looked like a CBC encryption. Here's the pseudocode I got from IDA: http://pastebin.com/UGYpbthr and here is a part from the original subroutine: http://i.imgur.com/N4jOzlG.png also here's a part from where the subroutine is called: http://i.imgur.com/nBJoROc.png . Is it possible to translate this pseudocode to C code without further reverse engineering ? If so how should I do it ?
This specific pseudocode is actually regular C code because it doesn't access global variables and stack. You'll probably need to add some typedefs for basic types. Please note that this code should be compiled as 32 bit code (or any other where sizeof int is equal to sizeof of pointer for your specific system) to avoid problems with pointer sizes.