Skip to content

Commit

Permalink
Merge pull request ioncodes#9 from Plutoberth/saveOnExecute
Browse files Browse the repository at this point in the history
Save files on execution with a config setting
  • Loading branch information
ioncodes committed Jul 4, 2020
2 parents f0e64b0 975ac74 commit 15b9672
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 7 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 66,5 @@ It is also important that attaching a debugger will create a new debugger instan

## Contributors
* [mrexodia](https://github.com/mrexodia)
* [MeitarR](https://github.com/MeitarR)
* [MeitarR](https://github.com/MeitarR)
* [Plutoberth](https://github.com/Plutoberth)
2 changes: 1 addition & 1 deletion ida/idacode_utils/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 10,7 @@
import idacode_utils.settings as settings
from idacode_utils.socket_handler import SocketHandler

VERSION = "0.1.3"
VERSION = "0.1.4"
initialized = False

def setup_patches():
Expand Down
6 changes: 5 additions & 1 deletion idacode/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 17,8 @@

### 0.1.3

- Added support for Python 2
- Added support for Python 2

### 0.1.4

- Added "Save on execute" support in settings
6 changes: 5 additions & 1 deletion idacode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 54,8 @@ IDACode doesn't support host to VM communication unless the VM uses a shared vol

### 0.1.3

- Added support for Python 2
- Added support for Python 2

### 0.1.4

- Added "Save on execute" support in settings
2 changes: 1 addition & 1 deletion idacode/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion idacode/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 3,7 @@
"displayName": "IDACode",
"description": "Run and debug your IDA scripts from VS Code",
"icon": "images/icon.png",
"version": "0.1.3",
"version": "0.1.4",
"publisher": "Layle",
"license": "SEE LICENSE IN LICENSE.md",
"preview": true,
Expand Down Expand Up @@ -71,6 71,11 @@
"type": "integer",
"default": 7066,
"description": "The port the IDA debug server is listening on."
},
"IDACode.saveOnExecute": {
"type": "boolean",
"default": true,
"description": "Save all open editors when executing."
}
}
}
Expand Down
10 changes: 9 additions & 1 deletion idacode/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 15,7 @@ function getCurrentDocument(): string {
return vscode.window.activeTextEditor?.document.uri.fsPath as string;
}

function executeScript() {
function executeScriptInIDA() {
const currentDocument = getCurrentDocument();
const name = path.parse(currentDocument).base;
socket.send({
Expand All @@ -25,6 25,14 @@ function executeScript() {
vscode.window.showInformationMessage(`Sent ${name} to IDA`);
}

function executeScript() {
if (getConfig<boolean>('saveOnExecute')) {
vscode.workspace.saveAll().then(executeScriptInIDA);
} else {
executeScriptInIDA();
}
}

function connectToIDA() {
return new Promise((resolve, reject) => {
const host = getConfig<string>('host');
Expand Down

0 comments on commit 15b9672

Please sign in to comment.