當前位置: 首頁>>代碼示例>>Java>>正文


Java Input.readBytes方法代碼示例

本文整理匯總了Java中org.jf.dexlib.Util.Input.readBytes方法的典型用法代碼示例。如果您正苦於以下問題:Java Input.readBytes方法的具體用法?Java Input.readBytes怎麽用?Java Input.readBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.jf.dexlib.Util.Input的用法示例。


在下文中一共展示了Input.readBytes方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: OdexHeader

import org.jf.dexlib.Util.Input; //導入方法依賴的package包/類
public OdexHeader(Input in) {
    magic = in.readBytes(8);

    if (Arrays.equals(MAGIC_35, magic)) {
        version = 35;
    } else if (Arrays.equals(MAGIC_36, magic)) {
        version = 36;
    } else {
        throw new RuntimeException("The magic value is not one of the expected values");
    }

    dexOffset = in.readInt();
    dexLength = in.readInt();
    depsOffset = in.readInt();
    depsLength = in.readInt();
    auxOffset = in.readInt();
    auxLength = in.readInt();
    flags = in.readInt();
    in.readInt(); //padding
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:21,代碼來源:OdexHeader.java

示例2: OdexDependencies

import org.jf.dexlib.Util.Input; //導入方法依賴的package包/類
public OdexDependencies (Input in) {
    modificationTime = in.readInt();
    crc = in.readInt();
    dalvikBuild = in.readInt();

    int dependencyCount = in.readInt();

    dependencies = new String[dependencyCount];
    dependencyChecksums = new byte[dependencyCount][];

    for (int i=0; i<dependencyCount; i++) {
        int stringLength = in.readInt();

        try {
            dependencies[i] = new String(in.readBytes(stringLength), 0, stringLength-1, "US-ASCII");
        } catch (UnsupportedEncodingException ex) {
            throw new RuntimeException(ex);
        }
        dependencyChecksums[i] = in.readBytes(20);
    }
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:22,代碼來源:OdexDependencies.java

示例3: OdexHeaderItem

import org.jf.dexlib.Util.Input; //導入方法依賴的package包/類
public OdexHeaderItem(Input in) {
    magic = in.readBytes(8);

    for (int i=0; i<8; i++) {
        if (MAGIC[i] != magic[i]) {
            throw new RuntimeException("The magic value is not the expected value");
        }
    }

    dexOffset = in.readInt();
    dexLength = in.readInt();
    depsOffset = in.readInt();
    depsLength = in.readInt();
    auxOffset = in.readInt();
    auxLength = in.readInt();
    flags = in.readInt();
    in.readInt(); //padding
}
 
開發者ID:Sukelluskello,項目名稱:VectorAttackScanner,代碼行數:19,代碼來源:OdexHeaderItem.java

示例4: readItem

import org.jf.dexlib.Util.Input; //導入方法依賴的package包/類
/** {@inheritDoc} */
protected void readItem(Input in, ReadContext readContext) {
    byte[] readMagic = in.readBytes(8);

    for (int i=0; i<8; i++) {
        if (MAGIC[i] != readMagic[i]) {
            throw new RuntimeException("The magic value is not the expected value");
        }
    }

    in.readBytes(20); //checksum
    in.readInt(); //signature
    in.readInt(); //filesize
    if (in.readInt() != HEADER_SIZE) {
        throw new RuntimeException("The header size is not the expected value (0x70)");
    }

    int endianTag = in.readInt();
    if (endianTag == BIG_ENDIAN) {
        throw new RuntimeException("This dex file is big endian. Only little endian is currently supported.");
    } else if (endianTag != LITTLE_ENDIAN) {
        throw new RuntimeException("The endian tag is not 0x12345678 or 0x78563412");
    }

    //link_size
    if (in.readInt() != 0) {
        throw new RuntimeException("This dex file has a link section, which is not supported");
    }

    //link_off
    if (in.readInt() != 0) {
        throw new RuntimeException("This dex file has a link section, which is not supported");
    }

    int sectionSize;
    int sectionOffset;

    //map_offset
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_MAP_LIST, 1, sectionOffset);

    //string_id_item
    sectionSize = in.readInt();
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_STRING_ID_ITEM, sectionSize, sectionOffset);

    //type_id_item
    sectionSize = in.readInt();
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_TYPE_ID_ITEM, sectionSize, sectionOffset);

    //proto_id_item
    sectionSize = in.readInt();
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_PROTO_ID_ITEM, sectionSize, sectionOffset);

    //field_id_item
    sectionSize = in.readInt();
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_FIELD_ID_ITEM, sectionSize, sectionOffset);

    //method_id_item
    sectionSize = in.readInt();
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_METHOD_ID_ITEM, sectionSize, sectionOffset);

    //class_data_item
    sectionSize = in.readInt();
    sectionOffset = in.readInt();
    readContext.addSection(ItemType.TYPE_CLASS_DEF_ITEM, sectionSize, sectionOffset);

    in.readInt(); //data_size
    in.readInt(); //data_off
}
 
開發者ID:DocGerd,項目名稱:DalvikSSA,代碼行數:75,代碼來源:HeaderItem.java


注:本文中的org.jf.dexlib.Util.Input.readBytes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。