diff --git a/libr/core/cmd.c b/libr/core/cmd.c index 33fbe252a6..89fb990e9c 100644 --- a/libr/core/cmd.c +++ b/libr/core/cmd.c @@ -1086,7 +1086,7 @@ R_API int r_core_cmd(RCore *core, const char *cstr, int log) { R_API int r_core_cmd_file(RCore *core, const char *file) { int ret = R_TRUE; char *nl, *data, *odata = r_file_slurp (file, NULL); - if (!odata) return -2; + if (!odata) return R_FALSE; nl = strchr (odata, '\n'); if (nl) { data = odata; @@ -1108,7 +1108,7 @@ R_API int r_core_cmd_file(RCore *core, const char *file) { } while ((nl = strchr (data, '\n'))); } free (odata); - return ret; + return R_TRUE; } R_API int r_core_cmd_command(RCore *core, const char *command) { diff --git a/libr/include/r_util.h b/libr/include/r_util.h index ea23f152c7..8ef38c5242 100644 --- a/libr/include/r_util.h +++ b/libr/include/r_util.h @@ -102,7 +102,7 @@ typedef struct r_prof_t { } RProfile; /* numbers */ -#define R_NUMCALC_STRSZ 128 +#define R_NUMCALC_STRSZ 4096 typedef struct { double d; diff --git a/libr/util/calc.c b/libr/util/calc.c index e054edaf1e..5526ec256e 100644 --- a/libr/util/calc.c +++ b/libr/util/calc.c @@ -140,7 +140,7 @@ static int cin_get(RNum *num, RNumCalc *nc, char *c) { static int cin_get_num(RNum *num, RNumCalc *nc, RNumCalcValue *n) { double d; - char str[128]; + char str[R_NUMCALC_STRSZ]; int i = 0; char c; str[0] = 0; diff --git a/shlr/arm/omap3430_registers b/shlr/arm/omap3430_registers index 352a233c0a..d8e3065cc3 100644 --- a/shlr/arm/omap3430_registers +++ b/shlr/arm/omap3430_registers @@ -282,11 +282,11 @@ f OMAP3430_reg_CONTROL_PROT_ERR_STATUS 4 @OMAP3430_SCM_BASE+0x2E4 Protection Err f OMAP3430_reg_CONTROL_PROT_ERR_STATUS_DEBUG 4 @OMAP3430_SCM_BASE+0x2E8 Protection Error Status Debug Register f OMAP3430_reg_CONTROL_STATUS 4 @OMAP3430_SCM_BASE+0x2F0 Control Module Status register: latches system information at reset time f OMAP3430_reg_CONTROL_GENERAL_PURPOSE_STATUS 4 @OMAP3430_SCM_BASE+0x2F4 -f OMAP3430_reg_CONTROL_RPUB_KEY_H_0 4 @OMAP3430_SCM_BASE+0x300 Root public key hash; B-field -f OMAP3430_reg_CONTROL_RPUB_KEY_H_1 4 @OMAP3430_SCM_BASE+0x304 Root public key hash; B-field -f OMAP3430_reg_CONTROL_RPUB_KEY_H_2 4 @OMAP3430_SCM_BASE+0x308 Root public key hash; B-field -f OMAP3430_reg_CONTROL_RPUB_KEY_H_3 4 @OMAP3430_SCM_BASE+0x30C Root public key hash; B-field -f OMAP3430_reg_CONTROL_RPUB_KEY_H_4 4 @OMAP3430_SCM_BASE+0x310 Root public key hash; B-field +f OMAP3430_reg_CONTROL_RPUB_KEY_H_0 4 @OMAP3430_SCM_BASE+0x300 Root public key hash: B-field +f OMAP3430_reg_CONTROL_RPUB_KEY_H_1 4 @OMAP3430_SCM_BASE+0x304 Root public key hash: B-field +f OMAP3430_reg_CONTROL_RPUB_KEY_H_2 4 @OMAP3430_SCM_BASE+0x308 Root public key hash: B-field +f OMAP3430_reg_CONTROL_RPUB_KEY_H_3 4 @OMAP3430_SCM_BASE+0x30C Root public key hash: B-field +f OMAP3430_reg_CONTROL_RPUB_KEY_H_4 4 @OMAP3430_SCM_BASE+0x310 Root public key hash: B-field f OMAP3430_reg_CONTROL_USB_CONF_0 4 @OMAP3430_SCM_BASE+0x370 USB Fuse conf [31:0], USB Product ID [31:16], Vendor ID [15:0] f OMAP3430_reg_CONTROL_USB_CONF_1 4 @OMAP3430_SCM_BASE+0x374 USB Fuse conf 1, SEQ_DISADAPTCLK[1], USB PHY detection mode [0] f OMAP3430_reg_CONTROL_FUSE_OPP1_VDD1 4 @OMAP3430_SCM_BASE+0x380 Standard Fuse OPP1 VDD1 @@ -541,7 +541,7 @@ f OMAP3430_reg_PRM_CLKSETUP 4 @OMAP3430_PRM_BASE+0x1298 This register allows set f OMAP3430_reg_PRM_POLCTRL 4 @OMAP3430_PRM_BASE+0x129C This register allows setting the polarity of device outputs control signals f OMAP3430_reg_PRM_VOLTSETUP2 4 @OMAP3430_PRM_BASE+0x12A0 This register allows setting the overall setup time of VDD1 and VDD2 regulators. This register is used when exiting OFF mode and when the Power IC manages the sequencing of the voltages regulation steps -// Here is an Secret Register Array. All information about them not available in public domain +# Here is an Secret Register Array. All information about them not available in public domain f OMAP3430_reg_RM_RSTST_NEON 4 @OMAP3430_PRM_BASE+0x1358 This register logs the different reset sources of the NEON domain. Each bit is set upon release of the domain reset signal. Must be cleared by software f OMAP3430_reg_PM_WKDEP_NEON 4 @OMAP3430_PRM_BASE+0x13C8 This register allows enabling or disabling the wake-up of the NEON domain upon another domain diff --git a/shlr/www/index.html b/shlr/www/index.html index f76a5f0377..0ad27d58ab 100644 --- a/shlr/www/index.html +++ b/shlr/www/index.html @@ -129,11 +129,6 @@ function show_popup_about () { "asm.pseudo
"+ "asm.bytes
"+ "cfg.bigendian
"+ -/* -asm.arch -asm.bits -a -*/ " "+ "
"+ "Actions"+ @@ -266,7 +261,6 @@ function filter_asm(x) { } } else hasmore (true); - x = x.replace (/0x([a-zA-Z0-9]*)/g, "0x$1"); function haveDisasm(x) { if (x[0]=='p' && x[1]=='d') return true; if (x.indexOf (";pd") != -1) return true; @@ -275,16 +269,17 @@ function filter_asm(x) { if (haveDisasm (display)) { x = x.replace (/;(\s+)/g, ";"); x = x.replace (/;(.*)/g, "// $1"); - x = x.replace (/(fcn|imp|loc).(.*)/g, "$1.$2"); x = x.replace (/(bl|call)/g, "call"); - x = x.replace (/(jmp|jnz|jg|je|jl|jz|jb|ja|jne)/g, "$1"); + x = x.replace (/(jmp|bne|beq|jnz|jg|je|jl|jz|jb|ja|jne)/g, "$1"); x = x.replace (/(leave|ret)/g, "$1"); x = x.replace (/(add|sub|mul|div|shl|shr|and|not|xor|inc|dec|sar|sal)/g, "$1"); x = x.replace (/(push|pop)/g, "$1"); x = x.replace (/(mov|lea)/g, "$1"); x = x.replace (/(test|cmp)/g, "$1"); x = x.replace (/nop/g, "nop"); + x = x.replace (/(sym|fcn|imp|loc).(.*)/g, "$1.$2"); } + x = x.replace (/0x([a-zA-Z0-9]*)/g, "0x$1"); if (backward) { prev_curoff = curoff; prev_lastoff = lastoff; @@ -361,11 +356,13 @@ function popup_show (title, body) { t.innerHTML = title; if (body) { var top = document.body.scrollTop+10; + var left = document.body.scrollLeft+10; c.innerHTML = body; p.style.visibility = b.style.visibility = "visible"; //c.style.top = top; /* XXX doesnt works */ css ('.popup', 'top', top+"px"); //'220px'); + css ('.popup', 'left', left+"px"); //'220px'); } b.height = 100; } @@ -388,18 +385,41 @@ function toggle_editor() { var em = document.getElementById('editor_menu'); if (et.style.visibility=="hidden") { e.style.width = 300; - et.style.visibility="visible"; - em.style.visibility="visible"; + et.style.visibility=em.style.visibility="visible"; x.innerHTML = "x"; } else { e.style.width = 16; - et.style.visibility="hidden"; - em.style.visibility="hidden"; + et.style.visibility=em.style.visibility="hidden"; x.innerHTML = "<"; } } +function notepad_run() { + var t = document.getElementById ('editor_textarea').value; + cmd (t.replace (/\n/g, ';'), function (out) { + document.getElementById ('editor_textarea').value = out; + }); +} + +function notepad_assemble () { + var t = document.getElementById ('editor_textarea').value; + cmd ("\"pa "+t.replace (/\n/g, ';')+"\"", function (out) { + document.getElementById ('editor_textarea').value = out; + }); +} + +function notepad_disassemble () { + var t = document.getElementById ('editor_textarea').value; + cmd ("pi@b:"+t.replace (/\n/g, ''), function (out) { + document.getElementById ('editor_textarea').value = out; + }); +} + +function notepad_clear() { + document.getElementById ('editor_textarea').value = ''; +} + function init() { var input = document.getElementById ('input'); input.addEventListener ("activate", function (x) { @@ -424,7 +444,6 @@ var r2 = { 'config_get': function (x,y) { cmd ('e '+x, y); }, 'config_set': function (x) { runcmd ('s entry0'); } } - @@ -435,7 +454,7 @@ var r2 = { pc | entry -analyze +a | break step @@ -449,9 +468,10 @@ var r2 = { <
-run -asm -dis +run +asm +dis +clr