Skip to content

Commit

Permalink
use DWORD_SIZE in more places
Browse files Browse the repository at this point in the history
  • Loading branch information
banister committed Dec 14, 2017
1 parent d9f208b commit 32b7d2e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test/fake_code_signer/pe_header.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ def security_address

# size of the digital signature
def security_size
deref(security_offset + 4)
deref(security_offset + DWORD_SIZE)
end

private

# dereferences a pointer
# the only pointer type we support is an unsigned long (DWORD)
def deref(ptr)
@image[ptr, 4].unpack("L").first
@image[ptr, DWORD_SIZE].unpack("L").first
end

# offset of e_lfanew (which stores the offset of the actual PE header)
Expand Down

0 comments on commit 32b7d2e

Please sign in to comment.