cancel
Showing results for 
Search instead for 
Did you mean: 

Start/Reset app with custom bootloader

Wyrm
Associate

Hellow! When i debugging an application with a pre-installed bootloader in the Kali environment, I used the following script:

FUNC void DebugSetup (void) {
// </h>
SP = _RDWORD(0x08040800); // Setup Stack Pointer
PC = _RDWORD(0x08040804); // Setup Program Counter
_WDWORD(0xE000ED08, 0x08040800); // VTOR to Image Base
}

FUNC void OnResetExec(void) {
DebugSetup();
}

DebugSetup(); // Debugger Setup

in vscode plugin i add to launch.json

"preRunCommands": [
"set $sp = *(unsigned int *)0x08018000",
"set $pc = *(unsigned int *)0x08018004",
"set {unsigned int}0xE000ED08 = 0x08018000",
],


And it works fine until I do a reset, is there a way to fix this?
For example, something like "postRestartSessionCommands". 

0 REPLIES 0