Changeset 1720 for zzuf/trunk/src/fuzz.c
- Timestamp:
- Jan 27, 2007, 8:05:46 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
zzuf/trunk/src/fuzz.c
r1719 r1720 37 37 #define MAGIC2 0x783bc31f 38 38 39 /* Fuzzing mode */ 40 static enum fuzzing 41 { 42 FUZZING_XOR = 0, FUZZING_SET, FUZZING_UNSET 43 } 44 fuzzing; 45 39 46 /* Per-offset byte protection */ 40 47 static unsigned int *ranges = NULL; … … 47 54 /* Local prototypes */ 48 55 static void readchars(int *, char const *); 56 57 extern void _zz_fuzzing(char const *mode) 58 { 59 if(!strcmp(mode, "xor")) 60 fuzzing = FUZZING_XOR; 61 else if(!strcmp(mode, "set")) 62 fuzzing = FUZZING_SET; 63 else if(!strcmp(mode, "unset")) 64 fuzzing = FUZZING_UNSET; 65 } 49 66 50 67 void _zz_bytes(char const *list) … … 144 161 { 145 162 unsigned int *r; 146 uint8_t byte ;163 uint8_t byte, fuzzbyte; 147 164 148 165 if(!ranges) … … 161 178 continue; 162 179 163 byte ^= fuzz->data[j % CHUNKBYTES]; 180 fuzzbyte = fuzz->data[j % CHUNKBYTES]; 181 182 if(!fuzzbyte) 183 continue; 184 185 switch(fuzzing) 186 { 187 case FUZZING_XOR: 188 byte ^= fuzzbyte; 189 break; 190 case FUZZING_SET: 191 byte |= fuzzbyte; 192 break; 193 case FUZZING_UNSET: 194 byte &= ~fuzzbyte; 195 break; 196 } 164 197 165 198 if(refuse[byte])
Note: See TracChangeset
for help on using the changeset viewer.