Skip to content

Commit

Permalink
Bug fixes for#125 and radareorg#124
Browse files Browse the repository at this point in the history
  • Loading branch information
Nischay-Pro committed Mar 30, 2017
1 parent 90bceb4 commit 7befc67
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 9 deletions.
6 changes: 5 additions & 1 deletion www/m/js/core/R2Wrapper.js
Expand Up @@ -82,7 +82,9 @@ const SettingItems = {
ANAL_NON_CODE: 'analNonCode',
COLORS: 'colors',
USE_TTS: 'useTTS',
THEME: 'theme'
THEME: 'theme',
ASMEMU: 'asmemu',
ASMEMUSTR: 'asmemustr'
};


Expand All @@ -95,6 +97,8 @@ r2Conf[SettingItems.UCASE] = { name: 'ucase', defVal: 'false', apply: function(p
r2Conf[SettingItems.DESCRIBE] = { name: 'describe', defVal: 'false', apply: function(p) { r2.cmd('e asm.describe=' + p); } };
r2Conf[SettingItems.BYTES] = { name: 'bytes', defVal: 'false', apply: function(p) { r2.cmd('e asm.bytes=' + p); } };
r2Conf[SettingItems.OS] = { name: 'os', defVal: 'Linux', apply: function(p) { console.log('OS is now: ' + p); } }; // missing
r2Conf[SettingItems.ASMEMU] = { name: 'asmemu', defVal: 'false', apply: function(p) { r2.cmd('e asm.emu=' + p); } };
r2Conf[SettingItems.ASMEMUSTR] = { name: 'asmemustr', defVal: 'false', apply: function(p) { r2.cmd('e asm.emustr=' + p); } };
r2Conf[SettingItems.SIZE] = { name: 'size', defVal: 'S', apply: function(p) {
switch (p) {
case 'S':
Expand Down
2 changes: 1 addition & 1 deletion www/m/js/core/UIContext.js
@@ -1,5 +1,5 @@
import {Layouts} from '../layout/Layouts';
import {Ruler} from '../layout/ruler';
import {Ruler} from '../layout/Ruler';

// Determine maximum widget displayable at same time
const MAX_WIDGETS = 2;
Expand Down
2 changes: 1 addition & 1 deletion www/m/js/layout/RadareInfiniteBlock.js
@@ -1,5 +1,5 @@
import {NavigatorDirection} from '../core/NavigatorDirection';
import {InfiniteScrolling} from '../helpers/InfiniteScrolling';
import {InfiniteScrolling} from '../helpers/infiniteScrolling';

/** How many screen we want to retrieve in one round-trip with r2 */
export const defaultHeightProvisioning = 3;
Expand Down
12 changes: 11 additions & 1 deletion www/m/js/modules/disasm/Disassembly.js
@@ -1,6 +1,6 @@
import {DisassemblyNavigator} from './DisassemblyNavigator';
import {RadareInfiniteBlock} from '../../layout/RadareInfiniteBlock';
import {FlexContainer} from '../../layout/FlexContainer';
import {FlexContainer} from '../../layout/flexContainer';

import {uiContext} from '../../core/UIContext';
import {Widgets} from '../../widgets/Widgets';
Expand Down Expand Up @@ -152,6 +152,16 @@ export class Disassembly extends RadareInfiniteBlock {
r2.cmd('e anal.calls=false');
}
}
},{
name: 'Analyse reference',
ugly: 'ref',
active: false,
action: function(active) {
if (!active) {
return;
}
r2.cmd('aar');
}
},{
name: 'Emulate code',
ugly: 'code',
Expand Down
2 changes: 1 addition & 1 deletion www/m/js/modules/disasm/DisassemblyNavigator.js
@@ -1,4 +1,4 @@
import {BlockNavigator} from '../../core/BlockNavigator';
import {BlockNavigator} from '../../core/blocknavigator';
import {ChunkStatus} from '../../core/ChunkStatus';

// Should refactor with HexPairNav and go/get methods
Expand Down
4 changes: 2 additions & 2 deletions www/m/js/modules/hexdump/hexdump.js
@@ -1,7 +1,7 @@
import {HexPairNavigator} from './HexPairNavigator';
import {HexPairNavigator} from './hexpairnavigator';
import {NavigatorDirection} from '../../core/NavigatorDirection';
import {RadareInfiniteBlock} from '../../layout/RadareInfiniteBlock';
import {FlexContainer} from '../../layout/FlexContainer';
import {FlexContainer} from '../../layout/flexContainer';
import {WordSizes} from './WordSizes';

import {uiContext} from '../../core/UIContext';
Expand Down
2 changes: 1 addition & 1 deletion www/m/js/modules/hexdump/hexpairnavigator.js
@@ -1,4 +1,4 @@
import {BlockNavigator} from '../../core/BlockNavigator';
import {BlockNavigator} from '../../core/blocknavigator';
import {NavigatorDirection} from '../../core/NavigatorDirection';

/**
Expand Down
1 change: 1 addition & 0 deletions www/m/js/modules/overview/AnalysisCard.js
Expand Up @@ -6,6 +6,7 @@ export class AnalysisCard {
constructor() {
this.analysisMethods = [
{ id: 'symbols', name: 'Analyse symbols', cmd: 'aa' },
{ id: 'ref', name: 'Analyse References', cmd: 'aar' },
{ id: 'calls', name: 'Analyse calls', cmd: 'e anal.calls=true;aac', disabledCmd: 'e anal.calls=false' },
{ id: 'emu', name: 'Emulate code', cmd: 'e asm.emu=1;aae;e asm.emu=0', disabledCmd: 'e asm.emu=false' },
{ id: 'prelude', name: 'Find preludes', cmd: 'aap' },
Expand Down
2 changes: 1 addition & 1 deletion www/m/js/widgets/HexdumpWidget.js
@@ -1,5 +1,5 @@
import {BaseWidget} from './BaseWidget';
import {Hexdump} from '../modules/hexdump/Hexdump';
import {Hexdump} from '../modules/hexdump/hexdump';
import {r2Wrapper, R2Actions} from '../core/R2Wrapper';

export class HexdumpWidget extends BaseWidget {
Expand Down
10 changes: 10 additions & 0 deletions www/m/js/widgets/SettingsWidget.js
Expand Up @@ -28,6 +28,7 @@ export class SettingsWidget extends BaseWidget {
this.addGrid('Colors', (dom) => this.drawColors(dom));
this.addGrid('TTS', (dom) => this.drawTTS(dom));
this.addGrid('Reset configuration', (dom) => this.drawReset(dom));
this.addGrid('Emulator', (dom) => this.drawEmulator(dom));

componentHandler.upgradeDom();
}
Expand Down Expand Up @@ -75,6 +76,15 @@ export class SettingsWidget extends BaseWidget {
});
}

drawEmulator(dom){
uiSwitch(dom, 'Enable ESIL', r2Settings.getItem(r2Settings.keys.ASMEMU), function(param, state) {
r2Settings.setItem(r2Settings.keys.ASMEMU, state);
});
uiSwitch(dom, 'Enable ESIL (Lesser Verbose)', r2Settings.getItem(r2Settings.keys.ASMEMUSTR), function(param, state) {
r2Settings.setItem(r2Settings.keys.ASMEMUSTR, state);
});
}

drawCoreIO(dom) {
var mode = ['PA', 'VA', 'Debug'];
uiSelect(dom, 'Mode', mode, mode.indexOf(r2Settings.getItem(r2Settings.keys.MODE)), function(item) {
Expand Down

0 comments on commit 7befc67

Please sign in to comment.