protected internal override Cell ReadCellPayload(DexFile file, UInt32 rowIndex, Column column, Cell[] cells, ref UInt32 offset)
        {
            Cell result;

            switch ((annotation_directory_row.columns)column.Index)
            {
            case annotation_directory_row.columns.field_annotations:
                UInt32   fields_size       = cells[(UInt16)annotation_directory_row.columns.fields_size].RawValue;
                UInt32[] field_annotations = file.GetSectionTable(TableType.field_annotation).ReadInnerSection(file, ref offset, fields_size);
                result = new Cell(column, fields_size, field_annotations);
                break;

            case annotation_directory_row.columns.method_annotations:
                UInt32   annotated_methods_size = cells[(UInt16)annotation_directory_row.columns.annotated_methods_size].RawValue;
                UInt32[] method_annotations     = file.GetSectionTable(TableType.method_annotation).ReadInnerSection(file, ref offset, annotated_methods_size);
                result = new Cell(column, annotated_methods_size, method_annotations);
                break;

            case annotation_directory_row.columns.parameter_annotations:
                UInt32   annotated_parameters_size = cells[(UInt16)annotation_directory_row.columns.annotated_parameters_size].RawValue;
                UInt32[] parameter_annotations     = file.GetSectionTable(TableType.parameter_annotation).ReadInnerSection(file, ref offset, annotated_parameters_size);
                result = new Cell(column, annotated_parameters_size, parameter_annotations);
                break;

            default:
                result = base.ReadCellPayload(file, rowIndex, column, cells, ref offset);
                break;
            }
            return(result);
        }
        protected internal override Cell ReadCellPayload(DexFile file, UInt32 rowIndex, Column column, Cell[] cells, ref UInt32 offset)
        {
            Cell result;

            Tables.encoded_catch_handler_row.columns colIdx = (Tables.encoded_catch_handler_row.columns)column.Index;
            switch (colIdx)
            {
            case Tables.encoded_catch_handler_row.columns.handlers:
                Int32    handler_size = (Int32)cells[(UInt32)Tables.encoded_catch_handler_row.columns.size].Value;
                UInt32[] indexes      = file.GetSectionTable(TableType.encoded_type_addr_pair).ReadInnerSection(file, ref offset, (UInt32)Math.Abs(handler_size));
                result = new Cell(column, (UInt32)indexes.Length, indexes);
                break;

            case Tables.encoded_catch_handler_row.columns.catch_all_addr:
                Int32 handler_size1 = (Int32)cells[(UInt32)Tables.encoded_catch_handler_row.columns.size].Value;
                if (handler_size1 <= 0)
                {
                    Int32 catch_add_addr = file.ReadULeb128(ref offset);
                    result = new Cell(column, (UInt32)catch_add_addr, (UInt32)catch_add_addr);
                }
                else
                {
                    result = new Cell(column, 0, null);
                }
                break;

            default:
                result = base.ReadCellPayload(file, rowIndex, column, cells, ref offset);
                break;
            }

            return(result);
        }
Beispiel #3
0
        protected internal override Cell ReadCellPayload(DexFile file, UInt32 rowIndex, Column column, Cell[] cells, ref uint offset)
        {
            Cell result;

            switch ((code_row.columns)column.Index)
            {
            case code_row.columns.tries:
                UInt32   tries_size = cells[(UInt32)code_row.columns.tries_size].RawValue;
                UInt32[] indexes    = file.GetSectionTable(TableType.try_item).ReadInnerSection(file, ref offset, tries_size);
                result = new Cell(column, tries_size, indexes);
                break;

            case code_row.columns.handlers:
                UInt32 tries_size1 = cells[(UInt32)code_row.columns.tries_size].RawValue;
                if (tries_size1 > 0)
                {
                    Int32    handler_list_size = file.ReadULeb128(ref offset);
                    UInt32[] indexes1          = file.GetSectionTable(TableType.encoded_catch_handler_list).ReadInnerSection(file, ref offset, (UInt32)handler_list_size);

                    UInt32 p       = (UInt32)sizeof(UInt32);
                    UInt32 padding = ((offset) % p) != 0 ? (p - (offset) % p) : 0;
                    offset += padding;

                    result = new Cell(column, tries_size1, indexes1);
                    //throw new NotImplementedException();
                }
                else
                {
                    result = new Cell(column, 0, null);
                }
                break;

            default:
                result = base.ReadCellPayload(file, rowIndex, column, cells, ref offset);
                break;
            }
            return(result);
        }
Beispiel #4
0
        protected internal override Cell ReadCellPayload(DexFile file, UInt32 rowIndex, Column column, Cell[] cells, ref UInt32 offset)
        {
            Cell result;

            switch ((class_data_row.columns)column.Index)
            {
            case class_data_row.columns.static_fields:
                UInt32   static_fields_size = cells[(UInt32)class_data_row.columns.static_fields_size].RawValue;
                UInt32[] static_fields      = file.GetSectionTable(TableType.encoded_field).ReadInnerSection(file, ref offset, static_fields_size);
                result = new Cell(column, static_fields_size, static_fields);
                break;

            case class_data_row.columns.instance_fields:
                UInt32   instance_fields_size = cells[(UInt32)class_data_row.columns.instance_fields_size].RawValue;
                UInt32[] instance_fields      = file.GetSectionTable(TableType.encoded_field).ReadInnerSection(file, ref offset, instance_fields_size);
                result = new Cell(column, instance_fields_size, instance_fields);
                break;

            case class_data_row.columns.direct_methods:
                UInt32   direct_methods_size = cells[(UInt32)class_data_row.columns.direct_methods_size].RawValue;
                UInt32[] direct_methods      = file.GetSectionTable(TableType.encoded_method).ReadInnerSection(file, ref offset, direct_methods_size);
                result = new Cell(column, direct_methods_size, direct_methods);
                break;

            case class_data_row.columns.virtual_methods:
                UInt32   virtual_methods_size = cells[(UInt32)class_data_row.columns.virtual_methods_size].RawValue;
                UInt32[] virtual_methods      = file.GetSectionTable(TableType.encoded_method).ReadInnerSection(file, ref offset, virtual_methods_size);
                result = new Cell(column, virtual_methods_size, virtual_methods);
                break;

            default:
                result = base.ReadCellPayload(file, rowIndex, column, cells, ref offset);
                break;
            }

            return(result);
        }