Socket
Socket
Sign inDemoInstall

@pretendonetwork/ctr-tools

Package Overview
Dependencies
55
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pretendonetwork/ctr-tools

TypeScript library for interacting with several Nintendo 3DS file types


Version published
Maintainers
1
Created

Readme

Source

ctr-tools

TypeScript library for interacting with several Nintendo 3DS file types. Mainly used to process CIA files for the Pretendo eShop

Installation

npm i @pretendonetwork/ctr-tools

Supported files

  • CIA. Does not decrypt contents
  • Certificates. Signature verification works, just not on illegitimate signatures (homebrew, forged tickets, etc)
  • SMDH. All data is extracted, but some pieces (like several sections of Application Settings) are left as Buffer blobs
  • TMD
  • Ticket. Does not decrypt title key

Example

import fs from 'node:fs';
import { CIA } from '@pretendonetwork/ctr-tools/cia';

const cia = new CIA(`${__dirname}/nimbus.cia`);

console.log(cia.CACertificate.verifySignature(cia.TMDCertificate)); // true. Certificates are signed by Nintendo, and should always pass
console.log(cia.CACertificate.verifySignature(cia.ticketCertificate)); // true. Certificates are signed by Nintendo, and should always pass
console.log(cia.TMDCertificate.verifySignature(cia.TMD)); // false. Example Nimbus is a homebrew title, not signed by Nintendo. Nintendo signatures return true
console.log(cia.ticketCertificate.verifySignature(cia.ticket)); // false. Example Nimbus is a homebrew title, not signed by Nintendo. Nintendo signatures return true

if (cia.meta) {
	const largeIconData = cia.meta.iconData.exportLargeImage();
	fs.writeFileSync('./icon-large.png', largeIconData); // 48x48px SMDH icon from the CIA meta section

	console.log(cia.meta.iconData.getEnglishApplicationTitle());
	//{
	//	descriptionShort: 'Nimbus',
	//	descriptionLong: 'Nimbus',
	//	publisher: 'Zaksabeast, shutterbug2000'
	//}
}

FAQs

Last updated on 22 Sep 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc