diff options
Diffstat (limited to 'design/mock/column.py')
| -rw-r--r-- | design/mock/column.py | 41 |
1 files changed, 18 insertions, 23 deletions
diff --git a/design/mock/column.py b/design/mock/column.py index de00e6f..cf0b8d1 100644 --- a/design/mock/column.py +++ b/design/mock/column.py @@ -361,11 +361,10 @@ def beat_call(g): # the touch, in the column: out of the call row's right rule, down the gutter, onto the stack's rule at its word gen.arrow(g, [(944, at[0x4011a8] + 12), (956, at[0x4011a8] + 12), (956, sy[0] + 12), (946, sy[0] + 12)], VERM, 2, r=6, hl=7, hw=8) - say(g, [(at[0x40119c] + 12, [("main puts open's arguments where the convention says: ", "sans"), ('"note"', "mono"), - (" in ", "sans"), ("rdi", "mono"), (", 0 (O_RDONLY) in ", "sans"), ("rsi", "mono"), - (".", "sans")], None), - (at[0x4011a8] + 12, [("The call pushes where to come back to, ", "sans"), ("main+45", "mono"), - (", and goes down to open's stub.", "sans")], None)]) + say(g, [(at[0x40119c] + 12, [("main puts open's arguments in registers: ", "sans"), ('"note"', "mono"), (" in ", "sans"), + ("rdi", "mono"), (", O_RDONLY in ", "sans"), ("rsi", "mono"), (".", "sans")], None), + (at[0x4011a8] + 12, [("The call pushes the way back, ", "sans"), ("main+45", "mono"), + (", and goes down to the stub.", "sans")], None)]) column_clock(g, 7, 46) @@ -406,11 +405,10 @@ def beat_stub(g): stack_panel(g, ys_, n, 38, 0x7fffffffeca8, 0x7fffffffeca8, 0x7fffffffed00, {0x7fffffffeca8: {1: "tick"}}, [("open@plt", 0x7fffffffeca8)], base=("rsp", 0x7fffffffeca8)) C.thread(g, ys, [(at[0x40119c], at[0x4011a8] + ROW)], VELLUM, 2) - say(g, [(at[0x4011a8] + 12, [("The call pushes where to come back to, ", "sans"), ("main+45", "mono"), - (", and goes down to open's stub.", "sans")], None), - (at[0x401070] + 12, [("The stub in the PLT is one jump: it reads ", "sans"), ("open@got", "mono"), - (", where the loader wrote libc's ", "sans"), ("open", "mono"), - (". It pushes nothing.", "sans")], at[0x401070])]) + say(g, [(at[0x4011a8] + 12, [("The call pushes the way back, ", "sans"), ("main+45", "mono"), + (", and goes down to the stub.", "sans")], None), + (at[0x401070] + 12, [("The stub is one jump through ", "sans"), ("open@got", "mono"), + (": it pushes nothing.", "sans")], at[0x401070])]) column_clock(g, 8, 46) @@ -443,10 +441,10 @@ def beat_args(g): "rsi": {0: "tick"}}, QUIET) M.strip(False) C.thread(g, ys, [(at[0x4011a8], at[0x4011a8] + ROW)], VELLUM, 2) - say(g, [(at["open@plt"] + 12, [("The stub in the PLT is one jump. It reads ", "sans"), ("open@got", "mono"), - (", where the loader wrote libc's ", "sans"), ("open", "mono"), (".", "sans")], None), - (at[L + 0x110fb6] + 12, [("Its last three set the kernel's arguments: AT_FDCWD in ", "sans"), ("rdi", "mono"), - (", and 257, openat's number, in ", "sans"), ("rax", "mono"), (".", "sans")], None)]) + say(g, [(at["open@plt"] + 12, [("The stub is one jump through ", "sans"), ("open@got", "mono"), + (": it pushes nothing.", "sans")], None), + (at[L + 0x110fb6] + 12, [("Its last three set the kernel's arguments, and openat's number, 257, in ", "sans"), + ("rax", "mono"), (".", "sans")], None)]) column_clock(g, 31, 46) @@ -482,12 +480,10 @@ def beat_cross(g, bubbles=True): M.strip(False) C.thread(g, ys, [(at[0x4011a8], at[0x4011a8] + ROW)], VELLUM, 2) if bubbles: - say(g, [(at[L + 0x110fb6] + 12, [("Its last three set the kernel's arguments: AT_FDCWD in ", "sans"), - ("rdi", "mono"), (", and 257, openat's number, in ", "sans"), ("rax", "mono"), - (".", "sans")], None), - (at["kernel"] + 12, [("syscall", "mono"), (" crosses down. The kernel opens ", "sans"), ('"note"', "mono"), - (" and answers 3: the file's descriptor, in ", "sans"), ("rax", "mono"), - (".", "sans")], None)]) + say(g, [(at[L + 0x110fb6] + 12, [("Its last three set the kernel's arguments, and openat's number, 257, in ", "sans"), + ("rax", "mono"), (".", "sans")], None), + (at["kernel"] + 12, [("syscall", "mono"), (" crosses down; the kernel opens ", "sans"), ('"note"', "mono"), + (" and answers 3 in ", "sans"), ("rax", "mono"), (".", "sans")], None)]) column_clock(g, 35, 46) return at @@ -514,9 +510,8 @@ def beat_back(g): C.thread(g, ys, [(at[0x40119c], at[0x4011ad] + ROW)]) gen.arrow(g, [(944, at[0x4011ad] + 12), (956, at[0x4011ad] + 12), (956, sy[3] + 12), (946, sy[3] + 12)], VERM, 2, r=6, hl=7, hw=8) - say(g, [(at[0x4011ad] + 12 + 400, [("syscall", "mono"), (" crosses down. The kernel opens ", "sans"), ('"note"', "mono"), - (" and answers 3: the file's descriptor, in ", "sans"), ("rax", "mono"), - (".", "sans")], None), + say(g, [(at[0x4011ad] + 12 + 400, [("syscall", "mono"), (" crosses down; the kernel opens ", "sans"), ('"note"', "mono"), + (" and answers 3 in ", "sans"), ("rax", "mono"), (".", "sans")], None), (at[0x4011a8] + 12, [("open", "mono"), ("'s ", "sans"), ("ret", "mono"), (" comes straight back to main: the stub was a jump, not a call. main keeps the answer in ", "sans"), ("f", "mono"), (".", "sans")], None)]) |
