Module: MachO::Utils

Defined in:
lib/macho/utils.rb

Class Method Summary collapse

Class Method Details

.fat_magic?(num) ⇒ Boolean



16
17
18
# File 'lib/macho/utils.rb', line 16

def self.fat_magic?(num)
	num == FAT_MAGIC || num == FAT_CIGAM
end

.magic32?(num) ⇒ Boolean



20
21
22
# File 'lib/macho/utils.rb', line 20

def self.magic32?(num)
	num == MH_MAGIC || num == MH_CIGAM
end

.magic64?(num) ⇒ Boolean



24
25
26
# File 'lib/macho/utils.rb', line 24

def self.magic64?(num)
	num == MH_MAGIC_64 || num == MH_CIGAM_64
end

.magic?(num) ⇒ Boolean



11
12
13
14
# File 'lib/macho/utils.rb', line 11

def self.magic?(num)
	num == FAT_MAGIC || num == FAT_CIGAM || num == MH_MAGIC ||
	num == MH_CIGAM || num == MH_MAGIC_64 || num == MH_CIGAM_64
end

.round(value, round) ⇒ Object



4
5
6
7
8
9
# File 'lib/macho/utils.rb', line 4

def self.round(value, round)
	round -= 1
	value += round
	value &= ~round
	value
end