(data, breakwhenfound = false)
| 92 | @Return (Array) offsets of found magics |
| 93 | */ |
| 94 | function FindMagic(data, breakwhenfound = false) { |
| 95 | var results = []; |
| 96 | for(var byte = 0; byte < (data.length - uint32_t); byte++) { //Read 32-bits at a time until the end of the buffer |
| 97 | var magic = ReadUint32(data, byte); //Read the next 32-bit magic value |
| 98 | if(MAGIC.VALIDATE(magic)) { |
| 99 | results.push(byte); |
| 100 | if(breakwhenfound) { |
| 101 | break; |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | return results; |
| 106 | } |
| 107 | |
| 108 | |
| 109 | /* |
no test coverage detected