]>
cvs.zerfleddert.de Git - rsbs2/blob - rsb-crc.c
1 #define POLY 0x04c11db7
3 /* Theory of operation:
4 * (arm-elf-objdump -b binary -m arm -M reg-names-raw -D RSB_S2_SINGLE.bin)
6 * 440: push {r4, r5, r6, r7, r8, r9, r10, r11, r14}
10 * 450: mov r6, #0 ; 0x0
12 * 458: add r3, r6, r10
14 * 460: lsl r3, r3, #24
15 * 464: eor r11, r11, r3
16 * 468: mov r5, #8 ; 0x8
17 * 46c: and r3, r11, #-2147483648 ; 0x80000000
18 * 470: cmp r3, #0 ; 0x0
20 * 478: lsl r3, r11, #1
21 * 47c: ldr r12, [pc, #64] ; 0x4c4
22 * 480: eor r0, r3, r12
25 * 48c: lsl r11, r11, #1
26 * 490: sub r5, r5, #1 ; 0x1
27 * 494: cmp r5, #0 ; 0x0
29 * 49c: add r6, r6, #1 ; 0x1
33 * 4ac: pop {r4, r5, r6, r7, r8, r9, r10, r11, r15}
34 * 4c4: DATA: 0x04c11db7
37 unsigned int rsb_crc(unsigned int r11
, unsigned char *r10
, unsigned int r14
) {
43 r3
= (*(r6
+r10
)) << 24;
49 r3
= r11
& 0x80000000;