Skip to Content
Learning Malware Analysis
book

Learning Malware Analysis

by Monnappa K A
June 2018
Beginner
510 pages
13h 7m
English
Packt Publishing
Content preview from Learning Malware Analysis

6.5 If-Elseif-Else Statement

The following is a C code containing if-ElseIf-else statements:

if (x == 0) {  x = 5;}else if (x == 1) {  x = 6;}else {  x = 7;}

From the preceding code, let's try to determine a situation when jumps (control transfers) will be taken. There are two conditional jump points; if x is not equal to 0, it will jump to the else_if block, and if x is not equal to 1 (a condition check in else if), then the jump is taken to else. There are also two unconditional jumps: inside the if block after x=5 (the end of the if block) and inside of the else if after x=6 (the end of the else if block). Both of these unconditional jumps skip the else statement to reach the end.

The following is the translated assembly language showing ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Malware Analysis

Practical Malware Analysis

Michael Sikorski, Andrew Honig
Mastering Malware Analysis

Mastering Malware Analysis

Alexey Kleymenov, Amr Thabet
Evasive Malware

Evasive Malware

Kyle Cucci

Publisher Resources

ISBN: 9781788392501Other