summaryrefslogtreecommitdiff
path: root/pwnlib/shellcraft/templates/i386/freebsd/i386_to_amd64.asm
blob: d14e1cc0c8adfc960e8559a4e27f463def1c6152 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
<% from pwnlib.shellcraft import common %>
<%docstring>Returns code to switch from i386 to amd64 mode.</%docstring>
<% helper, end = common.label("helper"), common.label("end") %>
.code32
    push 0x43 /*  This is the segment we want to go to */
    call $+4
${helper}:
    .byte 0xc0
    add dword ptr [esp], ${end} - ${helper}
    jmp far [esp]
${end}:
.code64