ReverseEngineering – Telegram
ReverseEngineering
1.24K subscribers
40 photos
10 videos
55 files
666 links
Download Telegram
پچ داینامیک با hook (Frida)


آنالیز و مانیتور یک فانکشن در زمان اجرا روی نمونه مجاز بدون تغییر فایل


ابزار
Frida

برای پیدا کردن آدرس نام تابع Ghidra IDA

روش

ادرس یا نام تابع هدف رو داخل IDA/Ghidra پیدا کنید


با Frida به پروسس attach یا اونو اجرا کنید


تابع رو hook کنید و پارامترهاشو مقدار بازگشتیشون رو لاگ کنید


لاگ‌ها رو بررسی و منطق تابع رو مستندسازی کنید

دستور اجرا

frida -f "C:\path\sample.exe" -l hook.js --no-pause



Dynamic Patching with Hooking Using Frida


Analyze and monitor a function at runtime on a legitimate sample without modifying the file itself

Tools:

Frida for hooking and runtime inspection

IDA or Ghidra for locating function addresses or names

Workflow

Identify the target function
Use IDA or Ghidra to find the address or name of the function you want to monitor


Attach or launch the process with Frida

You can attach to a running process or start it under Frida’s control


Hook the function
Use Frida to intercept the function call capture its parameters and log its return value


Analyze the logs
Check the captured input and output to understand the functions behavior and document its logic



Example Frida command:

frida -f "C:\path\sample.exe" -l hook.js --no-pause
3
پچ ایمن برای باینری با checksum

درک کار checksum یا integrity در یک برنامه آموزشی بدون اینکه قانون نقض بشه

ابزار:
IDA یا Ghidra
دیباگر مثل x64dbg یا WinDbg ابزار ثبت لاگ

روش:

فانکشن یا نقطه ای که checksum محاسبه میشه پیدا کنید

بررسی کنید چه ورودی هایی روی محاسبه تاثیر دارن و زمان محاسبه کیه
جریان داده ها رو مستندسازی کنید و رفتار برنامه وقتی checksum اشتباه باشه رو ثبت کنید

تمرین:

یک باینری نمونه بسازید که checksum داخلی داشته باشه مسیر محاسبه اون رو تحلیل و در یک جدول کوچیک گزارش کنید


Safe patch Analysis of Binaries with Checksum


Understand how a checksum or integrity mechanism works in an educational binary without violating any rules

Tools:

IDA or Ghidra for static analysis
Debugger like x64dbg or WinDbg for runtime observation
Logging tools for recording program behavior

Workflow:

Locate the checksum function or the point where checksum is calculated


Examine which inputs affect the checksum and when the calculation occurs


Track data flow and document program behavior when checksum verification fails



Exercise:

Create a sample binary with an internal checksum Analyze the calculation path and report it in a small table
4
IMG_1905.JPG
1.6 MB
ARM 32 Bit Assembly Basics Cheat Sheet
5
Media is too big
VIEW IN TELEGRAM
ساخت بدافزار FUD با استفاده از زبان C

How To Make FUD Malware Using C Language
10
Packt.Ghidra.Software.Reverse-Engineering.for.Beginners.pdf
74.7 MB
👾 Ghidra Software

Reverse-Engineering for Beginners, 2nd Edition: Master the art of debugging, from understanding code to mitigating threats (2025)
Author: David Alvarez Perez
🔥73
آنالیز استاتیک ساده

هدف:
یادگیری بررسی یک برنامه بدون اجرا شدن و استخراج اطلاعات مهم: توابع رشته‌ها و نقاط ورودی

ابزارهای مورد نیاز

IDA یا Ghidra

Strings

PEview یا CFF Explorer


مراحل قدم به قدم

بررسی رشته‌ها


تصویر خروجی strings روی برنامه ساده:

Hello World!

Enter your name:

توضیح: این رشته‌ها اطلاعات مهم برنامه رو نشون میدن


دیاسمبل کردن برنامه



متن IDA/Ghidra با نمایش Entry Point و توابع اصلی:

Main
Sub_401000


توضیح: توابع اصلی رو پیدا کنید و ببینید رشته‌ها چگونه استفاده میشن


شناسایی نقاط ورودی



متن PE Header با علامت Entry Point:

Entry Point: 0x401000


توضیح: این نقطه اولین جایی که برنامه اجرا میشه


بررسی Import Table



متن Import Table در PE view:

KERNEL32.dll
  - GetModuleHandleA
  - CreateFileA
  - ReadFile


توضیح: نشون میده برنامه از چه توابع خارجی و منابعی استفاده میکنه


نکات مهم:

هیچ برنامه‌ای اجرا نمیشه پس ریسک آلوده شدن سیستم وجود نداره

همیشه با نسخه کپی یا در ماشین مجازی کار کنید



Simple Static Analysis

Objective:
Learn to examine a program without running it and extract important information: functions strings and entry points

Tools Required

IDA or Ghidra

Strings

PEview or CFF Explorer

Step-by-Step

Examining Strings

Image of the output of strings on a simple program:

Hello World!

Enter your name:


Explanation: These strings show important information about the program

Disassembling the program

IDA/Ghidra text showing the Entry Point and main functions:

Main
Sub_401000


Explanation: Find the main functions and see how the strings are used

Identifying entry points

PE Header text with Entry Point:

Entry Point: 0x401000


Explanation: This is the first place the program is executed

Checking the Import Table

Import Table text in PE view:

KERNEL32.dll
- GetModuleHandleA
- CreateFileA
- ReadFile


Explanation: Shows what external functions and resources the program uses

Important notes:

No program is executed so there is no risk of system infection

Always work with a copy or in a virtual machine
6
دیباگ و آنالیز داینامیک

هدف اینه برنامه رو اجرا میکنیم و توی رفتارش ببینیم چیکار میکنه کجا میره چه رجیسترایی عوض میشن کی فایل میخونه یا به شبکه وصل میشه

ابزار لازم x64dbg یا OllyDbg برای برنامه‌های قدیمی یه ماشین مجازی واسه امن بودن


برنامه رو با x64dbg باز کنید دیباگر معمولا اول کار روی Entry Point متوقف میشه


نقطه توقف بذارید جایی که فکر میکنید مهمه یا رشته دیده شده Breakpoint بذارید تا وقتی رسید اجرا وایسه


مرحله‌ای جلو برید از Step Into (معمولا F7) و Step Over (F8) استفاده کنید Step Into میره داخل تابع Step Over اونو کامل اجرا میکنه و میاد بیرون


رجیستر و حافظه ببین مقدارهای EAX, EBX, ECX, EDX و بقیه رو چک کنید تو قسمت Memory یا Dump میتونید محتوای حافظه رو ببینید


رفتار برنامه رو تحلیل کنید ببینید چه رجیسترهایی تغییر میکنن کی فایل یا شبکه فراخوانی میشه چه رشته‌هایی استفاده میشه



نکات کاربردی:

همیشه توی VM یا محیط ایزوله کار کنید

برنامه ممکنه ضد دیباگ داشته باشه در این صورت باید اون مکانیزم‌ها رو دور بزنید

با دیباگ میتونید راحت تر بفهمید برنامه واقعا چکاری انجام میده و کجاها باید دست بزنید


تمرین ساده:

یه برنامه ساده Hello World بنویسید


با x64dbg بازش کنید و روی printf یا Breakpoint MessageBoxA بذارید


اجرا کنید و ببینید چه رشته‌ای توی رجیسترها و حافظه قرار میگیره


یه مقدار توی رجیستر یا حافظه تغییر بدید و ببینید رفتار برنامه چه تغییری میکنه


Debug and Dynamic Analysis

The goal is to run the program and observe its behavior to see what it does where it goes what registers change when it reads a file or connects to the network

Required tools x64dbg or OllyDbg for old programs A virtual machine to be safe

Open the program with x64dbg The debugger usually stops at the Entry Point first

Place a breakpoint where you think it is important or the string is seen Place a breakpoint until it reaches the execution

Go one step forward Use Step Into (usually F7) and Step Over (F8) Step Into goes into the function Step Over executes it completely and comes out

Look at the registers and memory Check the values of EAX, EBX, ECX, EDX and others You can see the memory content in the Memory or Dump section

Analyze the behavior of the program to see what registers change when the file or network is called what strings are used

Useful tips:

Always work in a VM or isolated environment

The program may have anti-debug, in which case you should bypass those mechanisms

With debugging you can more easily understand what the program is really doing and where you need to touch

Simple exercise:

Write a simple Hello World program

Open it with x64dbg and set a Breakpoint on printf or MessageBoxA

Run it and see what string is placed in the registers and memory

Change a value in a register or memory and see how the program behaves
4
DiffRays

ابزاری پژوهش‌ محور برای مقایسه پچ‌های باینریه که به منظور کمک به تحقیقات آسیب‌پذیری توسعه اکسپلویت و مهندسی معکوس طراحی شده

A research-oriented tool for comparing binary patches designed to aid in vulnerability research, exploit development, and reverse engineering.

https://github.com/pwnfuzz/diffrays

@PfkSecurity
4