| 147 | } |
| 148 | |
| 149 | uint64_t BinaryReader::ReadLEPointer() |
| 150 | { |
| 151 | uint64_t result; |
| 152 | size_t addressSize = m_view->GetAddressSize(); |
| 153 | switch (addressSize) |
| 154 | { |
| 155 | case 1: |
| 156 | { |
| 157 | uint8_t r; |
| 158 | if (!BNRead8(m_stream, &r)) |
| 159 | throw ReadException(); |
| 160 | result = r; |
| 161 | break; |
| 162 | } |
| 163 | case 2: |
| 164 | { |
| 165 | uint16_t r; |
| 166 | if (!BNReadLE16(m_stream, &r)) |
| 167 | throw ReadException(); |
| 168 | result = r; |
| 169 | break; |
| 170 | } |
| 171 | case 4: |
| 172 | { |
| 173 | uint32_t r; |
| 174 | if (!BNReadLE32(m_stream, &r)) |
| 175 | throw ReadException(); |
| 176 | result = r; |
| 177 | break; |
| 178 | } |
| 179 | case 8: |
| 180 | { |
| 181 | if (!BNReadLE64(m_stream, &result)) |
| 182 | throw ReadException(); |
| 183 | break; |
| 184 | } |
| 185 | default: |
| 186 | { |
| 187 | throw ReadException(); |
| 188 | break; |
| 189 | } |
| 190 | } |
| 191 | return result; |
| 192 | } |
| 193 | |
| 194 | |
| 195 | uint16_t BinaryReader::ReadBE16() |
nothing calls this directly
no test coverage detected