Skip to content

Commit

Permalink
Replaces afcfj with afsj
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio committed May 18, 2022
1 parent eea3555 commit 47ee9f1
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions libdec/rzutil.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@
}

function merge_arrays(input) {
input = input.split('\n').map(function(x) {
return x.length > 2 ? x.trim().substr(1, x.length).substr(0, x.length - 2) : '';
});
var array = '[' + input.filter(Boolean).join(',') + ']';
input = input.replace(/\n/g, ',');
var array = '[' + input + ']';
return array;
}

Expand Down Expand Up @@ -99,7 +97,7 @@
var farguments = rz_sanitize(rzpipe.string('afvj', true), '{"sp":[],"bp":[],"reg":[]}');
var arch = rz_sanitize(rzpipe.string('e asm.arch'), '');
var archbits = rz_sanitize(rzpipe.string('e asm.bits'), '32');
var database = rz_sanitize(rzpipe.custom('afcfj @@i', /^\[\]\n/g, merge_arrays), '[]');
var database = rz_sanitize(rzpipe.custom('afsj @@i', null, merge_arrays), '[]');
console.log('{"name":"issue_' + (new Date()).getTime() +
'","arch":"' + arch +
'","archbits":' + archbits +
Expand Down Expand Up @@ -293,7 +291,7 @@
}))
};
this.graph = rzpipe.json64('agj', []);
this.argdb = rzpipe.custom('afcfj @@i', /^\[\]\n/g, merge_arrays_json);
this.argdb = rzpipe.custom('afsj @@i', null, merge_arrays_json);
},
sanitize: function(enable, evars) {
if (!evars) {
Expand All @@ -311,7 +309,11 @@
debug: function(evars, exception) {
rzutil.sanitize(false, evars);
if (!evars || evars.extra.debug) {
return 'Exception: ' + exception.stack;
if (exception.stack) {
return 'Exception: ' + exception.stack;
}
var msg = exception.name + ' ' + exception.message + ' line:' + exception.at;
return 'Exception: ' + msg + '\n' + exception.text;
} else {
return '\n\njsdec has crashed (info: ' + rzpipe.string('i~^file[1:0]') + ' @ ' + rzpipe.string('s') + ').\n' +
'Please report the bug at https://github.com/rizinorg/jsdec/issues\n' +
Expand Down

0 comments on commit 47ee9f1

Please sign in to comment.