Reverse Engineering, Assembly, and Security Testing

Going from Assembly to C++ to Security

• 5 min read


This term, I’ve been diving into CS-410: Software Reverse Engineering—and let me tell you, it has been one of the tougher classes I’ve taken so far. The core of the course has us working with code at the lowest level, starting with binary, converting it to assembly, and then rebuilding that into something more recognizable like C++.


On paper, that doesn’t sound too bad. We’re only talking about small programs—maybe 2, 3, or 4 methods. But the challenge isn’t the size of the programs, it’s the complexity of understanding what’s happening in assembly language. That’s where I often get stuck.


Take this snippet, for example:

                
                    push   %rbp
                    mov    %rsp, %rbp
                    sub    $0x10, %rsp
                    mov    %edi, -0x4(%rbp)
                    mov    -0x4(%rbp), %eax
                    add    $0x5, %eax
                    mov    %eax, -0x8(%rbp)
                    mov    -0x8(%rbp), %eax
                    leaveq
                    retq
                
            

Equivalent C++ Code

                
                    int addFive(int x) {
                        int result = x + 5;
                        return result;
                    }
                
            

When you see them side by side, it kind of makes sense. The assembly is just the step-by-step breakdown of what the compiler does for a simple C++ function:



It’s not fun work, but mapping assembly back to C++ gives me a better appreciation for what’s happening behind the curtain every time I write a line of code.


From Reverse Engineering to Security

This week, our focus shifted toward how reverse engineering ties into software security. It’s not just an academic exercise—it’s a real-world tool. Reverse engineering is how security researchers:



For example, by looking at assembly, you can sometimes spot things like buffer overflows—areas where a program fails to check input properly, leaving the door wide open for exploits. Or you can see where memory isn’t being managed securely, which could lead to leaks or unauthorized access.


I also decided to test the security of my own portfolio website using OWASP ZAP (Zed Attack Proxy). It’s a tool often used by penetration testers to scan for vulnerabilities. Running ZAP against my site was an eye-opening experience, even though my site is deployed through GitHub Pages and doesn’t have a backend server to exploit. Because of that, there weren’t many real vulnerabilities to worry about—the static hosting environment limits attack surfaces. Still, ZAP flagged a few things like missing security headers and cookie settings that I normally wouldn’t have thought about. Even though I couldn’t “patch” much due to the limitations of GitHub Pages, it gave me a good sense of what attackers look for and how security testing works in practice.


Beyond ZAP, I’ve also had some exposure to static analysis tools while working on Java projects. Tools like SonarLint integrate into an IDE and scan through code to highlight common security issues (like unchecked input, potential null pointer risks, or SQL injection patterns). While they don’t attack your site like ZAP, they provide a proactive way to catch vulnerabilities before code is deployed. Pairing that with unit testing adds an extra safety net—ensuring both functionality and security get checked.


So while I may not “enjoy” translating assembly to C++ line by line, I’m beginning to see the value. Reverse engineering forces you to look under the hood, and once you do, you start to appreciate how fragile software can be—and why secure coding practices are so important.


Final Thoughts

CS-410 has been a grind for me. I won’t sugarcoat it—there are moments where I feel completely lost staring at lines of assembly code. But slowly, bit by bit, I’m getting through it. And in the process, I’m learning not just about how programs are built, but how they can be broken.


If nothing else, this course has reminded me that software security isn’t just about writing new code carefully. It’s also about being able to take software apart, analyze it, and understand the risks hiding beneath the surface. And now, thanks to both classwork and hands-on testing with tools like ZAP and static analysis, I have a deeper appreciation for why security needs to be built in from the ground up.


I’m curious—what tools do you like to use to sniff out security vulnerabilities in your own projects?




← Back to blog