December 2017
Intermediate to advanced
860 pages
16h 1m
English
Decision-making is also a simple concept as with any other programming language. Let's have a look at an example:
irb(main):001:0> 1 > 2
=> false
Let's also consider the case of string data:
irb(main):005:0> "Nipun" == "nipun"
=> false
irb(main):006:0> "Nipun" == "Nipun"
=> true
Let's consider a simple program with decision-making operators:
def find_match(a) if a =~ /Metasploit/ return true else return false end end # Main Starts Here a = "1238924983Metasploitduidisdid" bool_b=find_match(a) print bool_b.to_s
In the preceding program, we used the word "Metasploit" which sits right in the middle of junk data and is assigned to the variable a. Next, we send this data to the find_match() method, where it matches ...
Read now
Unlock full access