Skip to Main Content
Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
book

Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals

by James C Foster
April 2005
Intermediate to advanced content levelIntermediate to advanced
700 pages
20h 39m
English
Syngress
Content preview from Sockets, Shellcode, Porting, and Coding: Reverse Engineering Exploits and Tool Coding for Security Professionals
code;
}
Here is an example that prints the numbers 1 through 100 (one per line):
for (i=1; i<=100; i++) {
display(i, '\n');
}
Note that after this loop is finished executing, the value of i is 101.This is because
the LoopExpression evaluates each iteration until LoopCondition becomes FALSE. In this
case, LoopCondition (
i <= 100) becomes FALSE only once
i
is assigned the value 101.
“foreach” Loops
foreach loops can be used to iterate across each element in an array.To iterate through all
items in an array, use this syntax, which will assign each value in the array to the variable
x:
foreach x (array) {
display(x, '\n');
}
You can also put each array index in an array or hash using a foreach loop and the
keys function:
foreach k (keys(array)) {
display ("array[", ...
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

32/64-Bit 80x86 Assembly Language Architecture

32/64-Bit 80x86 Assembly Language Architecture

James Leiterman

Publisher Resources

ISBN: 9781597490054