当前位置: 首页>>代码示例>>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;未经允许,请勿转载。