Skip to content

Commit

Permalink
tweaked bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
robalb committed Jul 18, 2024
1 parent 2e86c63 commit 034b658
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion astro-website/src/components/EndiannessEmbed.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ function init(){
data = Array(14*8).fill(0)
let text = "Example text"
text.split("").forEach((c,i) => data[i] = c.charCodeAt(0))
imm = "0xfeedc0de12345678"
imm = "0xcafebabe11"
error = ""
}
init();
Expand Down
5 changes: 4 additions & 1 deletion astro-website/src/components/StackEmbed.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import GdbEmbed from './GdbEmbed.svelte'
let data = [0, 0, 0, 0, 0xca, 0xfe, 0xba, 0xbe];
let startAddress = 0x7fffff00;
let endAddress = 0x7fffffd8;
let options = [
{move: -8, name: "push"},
Expand All @@ -21,7 +22,7 @@ let registers = [
{color: "blue", name: "rax", bytes: [0,0,0,0,0,0,0,0], preview: "hex_int"},
]
let selected = options[0];
let selected = options[1];
let color_regions = {}
let rsp_ptr_size = 8;
Expand Down Expand Up @@ -71,6 +72,7 @@ function run(){
if(selected.name == "push"){
//decrease rsp_ptr
let rsp_val = bytesLEToInt(rsp.bytes)
if(rsp_val <= startAddress) return
rsp_val -= rsp_ptr_size
rsp.bytes = intToBytesLE(rsp_val);
//set rax to hardcoded code value
Expand All @@ -81,6 +83,7 @@ function run(){
}
}else{
let rsp_val = bytesLEToInt(rsp.bytes)
if(rsp_val >= endAddress) return
//put pointed bytes into rax
for(let i=0; i< rsp_ptr_size; i++){
rax.bytes[i] = data[rsp_val + i - startAddress]
Expand Down

0 comments on commit 034b658

Please sign in to comment.