- *((u32 *) & buf[0x18]) = 0;
- unsigned long sum0 = *((u32 *) & buf[0x18]);
- unsigned long sum1 = *((u32 *) & buf[0x4]);
- *((u32 *) & buf[0x4]) = 0x0L;
- for (i = 0; i < 0x100; i++)
- b[i] = buf[i];
- for (i = 0; i < 0x100; i++)
- b[0x100 + i] = buf[(l0 >> 1) + i];
- for (i = 0; i < 0x200; i++)
- b[0x200 + i] = buf[l0 - 0x200 + i];
- *((u32 *) & b[0x18]) = 0x0L;
+ *((uint32_t *) & buf[0x18]) = 0;
+ unsigned long sum0 = buf[0x18] | ((uint32_t)buf[0x19] << 8) | ((uint32_t)buf[0x1a] << 16) | ((uint32_t)buf[0x1b] << 24);
+ unsigned long sum1 = buf[0x4] | ((uint32_t)buf[0x5] << 8) | ((uint32_t)buf[0x6] << 16) | ((uint32_t)buf[0x7] << 24);
+ *((uint32_t *) & buf[0x4]) = 0x0L;
+ memcpy(b, buf, 0x100);
+ memcpy(b + 0x100, buf + ((l0 >> 1) - ((l0 & 0x6) >> 1)), 0x100);
+ memcpy(b + 0x200, buf + (l0 - 0x200), 0x200);
+ *((uint32_t *) & b[0x18]) = 0x0L;