Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var STORAGE_NONE = 0;
- var STORAGE_HOST = 1;
- var STORAGE_GAMECARD = 2;
- var STORAGE_NANDSYS = 3;
- var STORAGE_NANDUSER = 4;
- var STORAGE_SDCARD = 5;
- var TITLE_STORAGE = STORAGE_SDCARD;
- var tid = '01007EF00011E800';
- var types = ['CMNT','PROG','DATA','ICON','DOC','INFO'];
- for(var ind = 0; ind < 5; ind++){
- //Get NCA ID
- var nca_id = new Uint32Array(4);
- try{
- sc.ipcMsg(5).datau32(TITLE_STORAGE).sendTo('ncm').asResult().andThen(res => {
- sc.withHandle(res.movedHandles[0], function(hnd) {
- var res = sc.ipcMsg(6).datau64(utils.parseAddr(tid)).sendTo(hnd);
- res = sc.ipcMsg(3).datau32(ind, 0, res.data[0], res.data[1], res.data[2], res.data[3]).sendTo(hnd);
- for (var i = 0; i < 4; i++) {
- nca_id[i] = res.data[i];
- }
- });
- });
- }catch(e){
- }
- //Get NCA string for pretty printing.
- var nca_id_str = '';
- for (var i = 0; i < 4; i++) {
- var val = nca_id[i];
- for (var j = 0; j < 4; j++) {
- var b = (val >> (j*8)) & 0xFF;
- nca_id_str += ('00' + b.toString(16)).slice(-2);
- }
- }
- utils.log('NcaId[' + types[ind] + ']: ' + nca_id_str);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement