I am trying to find a hex value that will produce a result of 419326735, given the code below.
I know that a hex value of "0x2cd79929" produces a result of 697947948, although I am still trying to determine how.
This (code below) is part of a function that validates a firmware image given a hex value in the header.
I am relatively new to C, but have experience with C# and other OO languages, although I have no experience with bitwise operations.
#include <stdio.h>
char *hex_string;
unsigned int initial_val;
unsigned int final_val;
int main()
{
hex_string = "0x2cd79929";
sscanf(hex_string,"%x",&initial_val);
final_val = initial_val << 0x18 |
initial_val >> 0x18 |
initial_val >> 8 & 0xff00 |
(initial_val & 0xff00) << 8;
initial_val = final_val;
printf("value is %d",final_val);
return 0;
}