I was tracing my motherboard’s UEFI boot in Ghidra. It starts in 16-bit real mode, then pulls a little magic trick 😅
Enable protected mode. Push a code selector and an address. Execute 66 CB (RETF).
Poof. The next instruction is MOV ESP, 0, and we’re running 32-bit code.
Linking previous post: teapawt.net/webbyVs/status/2124559…
CPU right after reset on my board:
The first thing it does is jump, disable interrupts, clear the POST port, and set up a stack.
Basically the firmware equivalent of:
“Alarm goes off → immediately hit snooze → roll over → mumble ‘five more minutes’ → finally sit up.”
It hasn’t even properly woken up yet, and it’s already trying to go back to sleep.
Not now, Mom.
Webby retweeted
AI is changing the cybersecurity landscape, and not just for the better.💔
Sadly, the same technology helping security researchers uncover vulnerabilities is also the same technology empowering attackers to exploit them faster.💔
💂🏿♂️🛡️
For guys who don't like assembly that much, I have asked an AI to generate C++-like code
void switch_to_32_bit(Cpu& cpu) {
// The preceding CALL left a 16-bit return offset on the stack.
// XOR EAX,EAX + POP AX zero-extends that offset to 32 bits.
const std::uint32_t return_ip = cpu.pop16(); // 0xDBE0
const std::uint32_t entry = return_ip + 0x09FF002B; // 0x09FFDC0B
// Enable protected mode (PE) and set the Monitor Coprocessor bit (MP).
cpu.write_cr0(cpu.read_cr0() | 0x3u);
// Selector 0x18 picks GDT entry 3, the flat data and stack segment.
cpu.load_segment(DS, 0x18);
cpu.load_segment(ES, 0x18);
cpu.load_segment(FS, 0x18);
cpu.load_segment(GS, 0x18);
cpu.load_segment(SS, 0x18);
// Build the far-return frame. The destination goes on top.
cpu.push32(0x10); // CS selector for GDT entry 2
cpu.push32(entry); // Destination EIP
cpu.retf32(); // Loads CS:EIP and transfers to the code below
}
// Execution lands here at 0x09FFDC0B (0000:DC0B in Ghidra).
void after_switch(Cpu& cpu) {
cpu.esp = 0; // MOV ESP, 0
cpu.eip = 0x09FFE0C8; // JMP to 0000:E0C8 in Ghidra
}
10
CPU right after reset on my board:
The first thing it does is jump, disable interrupts, clear the POST port, and set up a stack.
Basically the firmware equivalent of:
“Alarm goes off → immediately hit snooze → roll over → mumble ‘five more minutes’ → finally sit up.”
It hasn’t even properly woken up yet, and it’s already trying to go back to sleep.
Not now, Mom.
651
Webby retweeted
The most popular passwords over the last 10 years:
2026: 123456
2025: 123456
2024: 123456
2023: 123456
2022: password
2021: 123456
2020: 123456
2019: 12345
2018: 123456
2017: 123456
Hackers aren’t even hacking anymore. They’re just logging in💀
We are waiting for the PC version of GTA VI ... Watching gameplay on YouTube and feeling very left out of the action ...
Rockstar, do we deserve this attitude? We are willing to pay for it.
Release it on PC already, before the community does.
#GTAVIPC #GTA6PC #GTAVIONPC #GTA6ONPC
146




















