(type, data, size, off)
| 120 | } |
| 121 | |
| 122 | function ParseCommand(type, data, size, off) { |
| 123 | var cmd = null; |
| 124 | if(type == LOAD_COMMAND_TYPE.LC_SEGMENT) { |
| 125 | if(data.length < 48) { |
| 126 | // if(process.env.VERBOSE){ console.log('Segment command OOB'); } |
| 127 | return new LoadCommand(type, data, size, off); |
| 128 | } |
| 129 | let name = new Cstr(data.slice(0, (4*uint32_t))); |
| 130 | cmd = new SegmentCommand( |
| 131 | type, |
| 132 | size, |
| 133 | name, |
| 134 | ReadUint32(data, (4*uint32_t)), |
| 135 | ReadUint32(data, (5*uint32_t)), |
| 136 | ReadUint32(data, (6*uint32_t)), |
| 137 | ReadUint32(data, (7*uint32_t)), |
| 138 | ReadUint32(data, (8*uint32_t)), |
| 139 | ReadUint32(data, (9*uint32_t)), |
| 140 | ReadUint32(data, (10*uint32_t)), |
| 141 | ReadUint32(data, (11*uint32_t)) |
| 142 | ); |
| 143 | |
| 144 | function prot(p) { |
| 145 | var res = {read: false, write: false, exec: false}; |
| 146 | return res; |
| 147 | } |
| 148 | |
| 149 | let sectSize = 17 * uint32_t; |
| 150 | var sections = []; |
| 151 | //for(var i = 0, off = 48; i < nsects) |
| 152 | return cmd; |
| 153 | } else { |
| 154 | return new LoadCommand(type, data, size, off); |
| 155 | } |
| 156 | } |
| 157 | |
| 158 | const onloadend = function (e) { |
| 159 |
no test coverage detected