Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

Commit

Permalink
Fixed a few things to make this work on linux
Browse files Browse the repository at this point in the history
  • Loading branch information
dgalling committed Jan 23, 2014
1 parent bbef7d3 commit 48b799b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
17 changes: 11 additions & 6 deletions examples/example_elf.rb
Expand Up @@ -7,14 +7,19 @@

bisc = BISC::ELFAssembler.new(ARGV)

pVar = bisc.allocate(4)
free = bisc.get_iat_pointer('free')
lpVar = bisc.allocate(4)
lppExit = bisc.get_iat_pointer('exit')

NOPS = [ "NOP" ] * 500
Main = [
pVar,
free,
"NOP",
"POP ECX", lpVar,
"POP EAX", 0x01,
"MOV [ECX], EAX",
"POP ECX", lppExit,
"MOV EAX, [ECX]",
"PUSH EAX", "NOP", 0x02,
"NOP", "NOP"
]

print bisc.assemble(Main)
print bisc.assemble(NOPS + Main)

2 changes: 1 addition & 1 deletion lib/bisc/elf_assembler.rb
Expand Up @@ -32,7 +32,7 @@ def add_module(path)
hits = scanner.scan_segment(header)

hits.each do |hit|
address = elf.elf.rva_to_offset(hit[0])
address = hit[0]
bytes = hit[1][0]
matchdata = re.match([bytes].pack('H*'))

Expand Down

0 comments on commit 48b799b

Please sign in to comment.