Permalink
Browse files

Backend game downloading WORKS 100%!

  • Loading branch information...
RedDuckss committed Oct 20, 2017
1 parent c709e37 commit 7b6e6c8099825d5474ffff062b2e8846074a60e6
Showing with 19 additions and 7 deletions.
  1. +1 −0 .gitignore
  2. +11 −6 NodeNUSRipper.js
  3. +1 −0 app.js
  4. +5 −0 package-lock.json
  5. +1 −1 package.json
  6. 0 smm.js
  7. BIN uni.cert
View
@@ -1,6 +1,7 @@
node_modules
builds
certs
cdecrypt
*.log
test.js
logo.psd
View
@@ -102,6 +102,10 @@ Main.prototype.decrypt = function(location, cb) {
let self = this;
if (!this._config.cdecrypt_location || this._config.cdecrypt_location.trim() == '' || !fs.pathExistsSync(this._config.cdecrypt_location)) {
self.emit('rom_decryption_missing', location);
if (cb) {
cb();
}
return;
}
self.emit('rom_decryption_started', location);
@@ -158,7 +162,8 @@ Main.prototype.getTIDType = function(TID) {
return TID.toUpperCase().substring(4, 8);
}
Main.prototype.getTIDURL= function(TID) {
Main.prototype.getTIDURL = function(TID) {
TID = this.formatTID(TID);
const TID_TYPE = this.getTIDType(TID);
if (TITLE_TYPES.indexOf(TID_TYPE) > -1) {
URL_BASE = url.resolve(NINTENDO_CCS_URL, TID);
@@ -171,10 +176,10 @@ Main.prototype.parseTMD = function(file, cb) {
var tmd = fs.readFileSync(file);
var tmd_object = {},
tmd_contents_count = struct.unpack('>H', tmd.subarray(0x1DE, 0x1E0))[0],
tmd_contents_count = struct.unpack('>H', new Buffer.from(tmd.subarray(0x1DE, 0x1E0)))[0],
tmd_contents = [],
tid_buffer = tmd.subarray(0x18C, 0x194),
version_buffer = tmd.subarray(0x1DC, 0x1DE),
tid_buffer = new Buffer.from(tmd.subarray(0x18C, 0x194)),
version_buffer = new Buffer.from(tmd.subarray(0x1DC, 0x1DE)),
version = struct.unpack('>H', version_buffer)[0];
for (var i=0;i<tmd_contents_count;i++) {
@@ -183,8 +188,8 @@ Main.prototype.parseTMD = function(file, cb) {
content_id = new Buffer(content_binary, 'ascii').toString('hex');
tmd_contents.push({
type: struct.unpack('>H', tmd.subarray(0xB0A + (0x30 * i), 0xB0A + (0x30 * i) + 0x2))[0],
size: struct.unpack('>Q', tmd.subarray(0xB0C + (0x30 * i), 0xB0C + (0x30 * i) + 0x8))[0].low,
type: struct.unpack('>H', new Buffer.from(tmd.subarray(0xB0A + (0x30 * i), 0xB0A + (0x30 * i) + 0x2)))[0],
size: struct.unpack('>Q', new Buffer.from(tmd.subarray(0xB0C + (0x30 * i), 0xB0C + (0x30 * i) + 0x8)))[0].low,
id: content_id,
});
}
View
1 app.js
@@ -277,6 +277,7 @@ ipcMain.on('init', (event, data) => {
NUSRipper.setTicketCacheLocation(settings_storage.get('ticket_cache_folder').value());
NUSRipper.setTicketVendor(settings_storage.get('ticket_vendor').value());
NUSRipper.setTicketCacheVendor(settings_storage.get('ticket_cache_vendor').value());
NUSRipper.setCDecryptLocation('./cdecrypt/CDecrypt_v2.0b.exe');
NUSRipper.downloadTicketCache((data) => {
//ticket_cache_storage = low(new FileSync(settings_storage.get('ticket_cache_folder').value() + '/_cache.json'));
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -15,7 +15,7 @@
"cemu-smm": "^2.1.4",
"electron-log": "^2.2.9",
"electron-updater": "^2.8.9",
"fs-extra": "^4.0.1",
"fs-extra": "^4.0.2",
"fsmonitor": "^0.2.4",
"fuse.js": "^3.2.0",
"ini": "^1.3.4",
View
0 smm.js
No changes.
View
BIN +2.5 KB uni.cert
Binary file not shown.

0 comments on commit 7b6e6c8

Please sign in to comment.