MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / ReadUnsignedInt

Method ReadUnsignedInt

Bcore/src/main/cpp/dex/dex_file.cc:539–548  ·  view source on GitHub ↗

Read an unsigned integer. "zwidth" is the zero-based byte count, "fill_on_right" indicates which side we want to zero-fill from.

Source from the content-addressed store, hash-verified

537// Read an unsigned integer. "zwidth" is the zero-based byte count,
538// "fill_on_right" indicates which side we want to zero-fill from.
539uint32_t DexFile::ReadUnsignedInt(const uint8_t* ptr, int zwidth, bool fill_on_right) {
540 uint32_t val = 0;
541 for (int i = zwidth; i >= 0; --i) {
542 val = (val >> 8) | (((uint32_t)*ptr++) << 24);
543 }
544 if (!fill_on_right) {
545 val >>= (3 - zwidth) * 8;
546 }
547 return val;
548}
549
550// Read a signed long. "zwidth" is the zero-based byte count.
551int64_t DexFile::ReadSignedLong(const uint8_t* ptr, int zwidth) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected