Skip to Content
Practical Malware Analysis
book

Practical Malware Analysis

by Michael Sikorski, Andrew Honig
February 2012
Intermediate to advanced
800 pages
23h 55m
English
No Starch Press
Content preview from Practical Malware Analysis

Disassembling Arithmetic Operations

Many different types of math operations can be performed in C programming, and we’ll present the disassembly of those operations in this section.

Example 6-6 shows the C code for two variables and a variety of arithmetic operations. Two of these are the -- and ++ operations, which are used to decrement by 1 and increment by 1, respectively. The % operation performs the modulo between the two variables, which is the remainder after performing a division operation.

Example 6-6. C code with two variables and a variety of arithmetic

int a = 0;
int b = 1;
a = a + 11;
a = a - b;
a--;
b++;
b = a % 3;

Example 6-7 shows the assembly for the C code shown in Example 6-6, which can be broken down to translate back to C.

Example 6-7. Assembly ...

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

Learning Malware Analysis

Learning Malware Analysis

Monnappa K A
Security in Computing, 6th Edition

Security in Computing, 6th Edition

Charles Pfleeger, Shari Lawrence Pfleeger, Lizzie Coles-Kemp
Evasive Malware

Evasive Malware

Kyle Cucci

Publisher Resources

ISBN: 9781593272906Errata Page