pwnCollege

# 隐藏了~

assembly crash course level 26

.section .text
.global _start

_start:
    cmp $4, %rdi               # Compare rdi with 3
    ja default_case            # If rdi > 3, jump to default case

    # Calculate jump address based on rdi value
    lea (%rsi,%rdi,8), %rax    # rax = rsi + rdi*8 (address in jump table)
    jmp (%rax)                # Indirect jump to the address stored at rax

default_case:
    lea 32(%rsi), %rax    # rax = rsi + rdi*8 (address in jump table)
    jmp (%rax)                    # Jump to the default case address