0Pricing
Reverse Engineering & Binary Analysis Basics · Ders

Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma

Derleyicinin işlevleri nasıl satır içine yerleştirdiğini ve döngüleri nasıl yeniden şekillendirdiğini (açma, vektörleştirme) fark edin; böylece eniyileştirilmiş assembly'yi kaynak kodun amacıyla eşleştirebilin.

Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma, CoddyKit'te ücretsiz bir Reverse Engineering & Binary Analysis Basics dersidir. Bu, 4 dersinin 4. dersidir. Aşağıdan dersin tamamını ücretsiz okuyabilir, sonra tarayıcıda yerleşik kod editörü ve 7/24 yapay zeka koçu ile uygulamalı olarak pratik yapabilirsin. Bu, Reverse Engineering & Binary Analysis Basics öğrenme yolunun bir parçasıdır ve ilerlemeniz web ve CoddyKit uygulaması arasında senkronize olur. Reverse Engineering & Binary Analysis Basics kursu toplamda 4 dersten oluşur.

Bu dersin bazı bölümleri henüz çevrilmemiş olup İngilizce olarak gösterilmektedir.

Optimizations Reshape Structure

You know common optimizations, can read optimized assembly, and reconstruct logic. Two transformations cause the most confusion: function inlining and loop reshaping.

Recognizing them keeps your reconstruction accurate.

What Is Inlining?

Inlining replaces a function call with the callee's body, eliminating call overhead.

In the binary the original function may vanish entirely; its code appears merged into every caller.

// source
static int sq(int x){ return x*x; }
int f(int a){ return sq(a) + 1; }
// after inlining f becomes: return a*a + 1;

Spotting Inlined Code

Signs of inlining:

  • A helper you expect to see as a separate function never appears
  • The same instruction pattern repeats in many callers
  • No matching call where the source had one

Loop Unrolling

Loop unrolling executes several iterations per loop pass to cut branch overhead.

A loop that should run 4 times may show 4 copies of the body and no inner branch.

; sum 4 elements, unrolled
mov eax, [rdi]
add eax, [rdi+4]
add eax, [rdi+8]
add eax, [rdi+12]

Partial Unrolling

For unknown trip counts the compiler unrolls in chunks (say 4 at a time) plus a remainder loop for leftovers.

Seeing a big block followed by a small single-step loop is the classic partial-unroll fingerprint.

Vectorization (SIMD)

Vectorization processes multiple data elements at once using SIMD registers like XMM/YMM.

Instructions such as movdqu, paddd, or addps signal that a scalar loop was turned into vector operations.

movdqu xmm0, [rsi]
paddd  xmm0, xmm1   ; add 4 ints in parallel
movdqu [rdi], xmm0

Reconstructing the Original Loop

When you see SIMD or unrolled bodies, mentally collapse them back to a single scalar loop. Four parallel adds equal a loop summing four elements.

Document the simple intent, not the optimized shape.

Loop-Invariant Code Motion

Compilers hoist computations that do not change across iterations out of the loop. A multiplication you expect inside the loop may appear before it.

Knowing this prevents you from misreading where work happens.

Strength Reduction

Multiplications inside loops are often replaced by cheaper additions (strength reduction). An index times stride becomes a pointer that increments by stride each pass.

Recognize add ptr, 8 as 'next element' rather than literal pointer math.

Tools Can Help

Decompilers (Ghidra, Hex-Rays) often re-roll loops and de-inline automatically, presenting cleaner pseudocode. Use them, but verify against the assembly when behavior matters.

Tail-Call Optimization

When a function's last action is a call, the compiler may turn it into a jump instead of call-then-return, reusing the current frame.

Seeing a jmp to another function at the end of a routine, rather than a call followed by ret, is the signature of a tail call.

; tail call instead of call + ret
mov edi, eax
jmp helper

Quick Check

You expected to see a small helper function but it never appears as its own routine; instead its code is duplicated inside every caller. What optimization is this?

Recap

You can now see through aggressive optimizations:

  • Inlining merges callees into callers
  • Unrolling and vectorization fan loop bodies into parallel work
  • Invariant motion and strength reduction relocate or cheapen operations

Collapse these back to simple source intent in your reconstruction.

Sıkça Sorulan Sorular

“Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma” dersi ücretsiz mi?

Evet — “Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma” dersin tüm metni burada web'de ücretsiz olarak okunabilir. Etkileşimli olarak pratik yapmak (yerleşik kod editörü ve 7/24 yapay zeka koçu) ve Reverse Engineering & Binary Analysis Basics kursunun geri kalanını açmak için CoddyKit PRO'ya yükselt. Reverse Engineering & Binary Analysis Basics kursu toplamda 4 dersten oluşur.

“Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma” dersinde ne öğreneceğim?

Derleyicinin işlevleri nasıl satır içine yerleştirdiğini ve döngüleri nasıl yeniden şekillendirdiğini (açma, vektörleştirme) fark edin; böylece eniyileştirilmiş assembly'yi kaynak kodun amacıyla eşle… Reverse Engineering & Binary Analysis Basics ile uygulamalı kodu tarayıcıda doğrudan çalıştırarak pratik yaparsın ve 7/24 yapay zeka koçu dersi çalışırken sorularını yanıtlar.

Reverse Engineering & Binary Analysis Basics öğrenmeye başlamak için deneyim gerekli mi?

Önceden deneyim gerekmez. CoddyKit'te Reverse Engineering & Binary Analysis Basics, başlangıçtan ileri seviyeye kadar yapılandırıldığı için buradan başlayabilir veya başından başlayıp kendi hızında ilerleme yapabilirsin. Bu, 4 dersinin 4. dersidir.

“Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma” dersi ne kadar sürer?

Çoğu CoddyKit dersi yaklaşık 5–10 dakika sürer. Her biri kısa ve etkileşimli olduğu için sabit ilerleme yaparsın ve web ile uygulama arasında tam olarak bıraktığın yerden devam edebilirsin.

Bu Reverse Engineering & Binary Analysis Basics dersinde kod yazıp çalıştırabilir miyim?

Evet. Her Reverse Engineering & Binary Analysis Basics dersi yerleşik bir kod editörü içerir, bu sayede tarayıcıda gerçek kod yazıp çalıştırabilir ve anlık yapay zeka geri bildirimi alırsın — yerel kurulum gerekli değildir.

Bu kursun tüm dersleri

  1. Yaygın Derleyici İyileştirmeleri
  2. İyileştirilmiş Assembly Kodunu Analiz Etme
  3. Özgün Kaynak Mantığını Yeniden Oluşturma
  4. Satır İçi Yerleştirme ve Döngü Dönüşümlerini Tanıma
← Reverse Engineering & Binary Analysis Basics Sayfasına Dön