Esempio n. 1
0
/*
 * Get the full size information for a class and its members.
 */
static void GetClassSize(ILSizeInfo *info, ILClass *classInfo)
{
	ILImage *image = ILProgramItem_Image(classInfo);
	ILImplements *impl;
	ILClassLayout *layout;
	ILMember *member;
	int hasEvents, hasProperties;
	ILFieldLayout *fieldLayout;
	ILFieldRVA *fieldRVA;
	ILConstant *constant;
	ILUInt32 type;

	/* Get the size information for the class itself */
	GetMetadataSizeWithAttrs(info, ILToProgramItem(classInfo));

	/* Collect up size information for the interface declarations */
	impl = 0;
	while((impl = ILClassNextImplements(classInfo, impl)) != 0)
	{
		GetMetadataSize(info, ILToProgramItem(impl));
	}

	/* Account for class layout information */
	layout = ILClassLayoutGetFromOwner(classInfo);
	if(layout)
	{
		GetMetadataSize(info, ILToProgramItem(layout));
	}

	/* Account for the nested class declaration */
	if(ILClass_NestedParent(classInfo) != 0)
	{
		info->meta += image->tokenSize[IL_META_TOKEN_NESTED_CLASS >> 24];
		info->loadedMeta += sizeof(ILNestedInfo);
	}
Esempio n. 2
0
/*
 * Get metadata size information for an item, plus all of its attributes.
 */
static void GetMetadataSizeWithAttrs(ILSizeInfo *info, ILProgramItem *item)
{
	ILAttribute *attr;
	ILDeclSecurity *decl;

	/* Get the basic size information for the item */
	GetMetadataSize(info, item);

	/* Collect up size information for the attributes */
	attr = 0;
	while((attr = ILProgramItemNextAttribute(item, attr)) != 0)
	{
		GetMetadataSize(info, ILToProgramItem(attr));
	}

	/* Account for the security declaration if there is one */
	decl = 0;
	while((decl = ILProgramItemNextDeclSecurity(item, decl)) != 0)
	{
		GetMetadataSize(info, ILToProgramItem(decl));
	}
}
Esempio n. 3
0
void CIAContainer::Print() const {
    LOG_DEBUG(Service_FS, "Type:               %u", static_cast<u32>(cia_header.type));
    LOG_DEBUG(Service_FS, "Version:            %u\n", static_cast<u32>(cia_header.version));

    LOG_DEBUG(Service_FS, "Certificate Size: 0x%08x bytes", GetCertificateSize());
    LOG_DEBUG(Service_FS, "Ticket Size:      0x%08x bytes", GetTicketSize());
    LOG_DEBUG(Service_FS, "TMD Size:         0x%08x bytes", GetTitleMetadataSize());
    LOG_DEBUG(Service_FS, "Meta Size:        0x%08x bytes", GetMetadataSize());
    LOG_DEBUG(Service_FS, "Content Size:     0x%08" PRIx64 " bytes\n", GetTotalContentSize());

    LOG_DEBUG(Service_FS, "Certificate Offset: 0x%08" PRIx64 " bytes", GetCertificateOffset());
    LOG_DEBUG(Service_FS, "Ticket Offset:      0x%08" PRIx64 " bytes", GetTicketOffset());
    LOG_DEBUG(Service_FS, "TMD Offset:         0x%08" PRIx64 " bytes", GetTitleMetadataOffset());
    LOG_DEBUG(Service_FS, "Meta Offset:        0x%08" PRIx64 " bytes", GetMetadataOffset());
    for (u16 i = 0; i < cia_tmd.GetContentCount(); i++) {
        LOG_DEBUG(Service_FS, "Content %x Offset:   0x%08" PRIx64 " bytes", i, GetContentOffset(i));
    }
}