Force self to sub/add rsp before/after push/pop (instead of after/before push/pop) -- prevents popping wrong values, eventually (in callee, like what printf does)
This commit is contained in:
@@ -168,10 +168,10 @@ printf:
|
||||
.d_fromStack:
|
||||
mov rsi, [rbp + RBP_OFFSET_CALLER + ((rdx-5) * SIZE_QWORD)]
|
||||
.checkINTorUINT:
|
||||
sub rsp, SIZE_QWORD
|
||||
push rax
|
||||
push rdx
|
||||
push rdi
|
||||
sub rsp, SIZE_QWORD
|
||||
cmp byte [rdi + 1], 'u'
|
||||
je .callUINT2STR
|
||||
mov rdi, rsi
|
||||
@@ -182,10 +182,10 @@ printf:
|
||||
call udec2str
|
||||
.loadConvertedStr:
|
||||
mov rsi, rax
|
||||
add rsp, SIZE_QWORD
|
||||
pop rdi
|
||||
pop rdx
|
||||
pop rax
|
||||
add rsp, SIZE_QWORD
|
||||
jmp .insertString
|
||||
|
||||
;--- '%x' / '%X' ---;
|
||||
|
Reference in New Issue
Block a user