2026-02-08 3:31 AM
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 Setupin 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".