Skip to content

Commit

Permalink
Update the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
lebr0nli committed Jul 24, 2023
1 parent 68be9bd commit eaf91d0
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion spec/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
skip_unless_objdump

expect { described_class.work(%w[--force --raw --level 1] + [libc_file]) }.to output(<<-EOS).to_stdout
324293 324386 939679 940120 940127 940131 1090444 1090456
324279 324286 324293 324386 939679 940120 940127 940131 1090444 1090456
EOS
end

Expand Down
8 changes: 5 additions & 3 deletions spec/one_gadget_aarch64_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
it 'libc-2.23' do
path = data_path('aarch64-libc-2.23.so')
expect(OneGadget.gadgets(file: path, force_file: true, level: 1))
.to eq [0x3d6d0, 0x3d6dc, 0x3d718, 0x60c1c, 0x60c20]
.to eq [0x3d6c4, 0x3d6cc, 0x3d6d0, 0x3d6d4, 0x3d6dc, 0x3d718, 0x60c1c, 0x60c20]
end

it 'libc-2.24' do
path = data_path('aarch64-libc-2.24.so')
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x3c934, 0x3c970]
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x3c92c, 0x3c934, 0x3c970]
end

it 'libc-2.27' do
path = data_path('aarch64-libc-2.27.so')
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x3f160, 0x3f184, 0x3f1a8, 0x63e90]
expect(OneGadget.gadgets(file: path,
force_file: true)).to eq [0x3f160, 0x3f168, 0x3f16c,
0x3f184, 0x3f1a8, 0x63e90]
end
end

Expand Down
14 changes: 8 additions & 6 deletions spec/one_gadget_amd64_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
it 'libc-2.19' do
path = data_path('libc-2.19-cf699a15caae64f50311fc4655b86dc39a479789.so')
expect(OneGadget.gadgets(file: path, force_file: true, level: 1))
.to eq [0x46428, 0x4647c, 0xc1ba3, 0xc1bf2, 0xe4968, 0xe5765, 0xe5771, 0xe66bd]
.to eq [0x46421, 0x46428, 0x4647c, 0xc1ba3, 0xc1bf2, 0xe4968, 0xe5765, 0xe5771, 0xe66bd]
end

it 'libc-2.24' do
Expand All @@ -23,22 +23,24 @@

it 'libc-2.26' do
path = data_path('libc-2.26-ddcc13122ddbfe5e5ef77d4ebe66d124ae5762c2.so')
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x47c46, 0x47c9a, 0xfccde, 0xfdb8e]
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x47c9a, 0xfccde, 0xfdb8e]
expect(one_gadget(path)).to eq OneGadget.gadgets(file: path)
end

it 'libc-2.27' do
path = data_path('libc-2.27-b417c0ba7cc5cf06d1d1bed6652cedb9253c60d0.so')
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x4f2c5, 0x4f322, 0x10a38c]
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x4f2be, 0x4f2c5, 0x4f322, 0x10a38c]
expect(one_gadget(path)).to eq OneGadget.gadgets(file: path)
end

it 'libc-2.31' do
path = data_path('libc-2.31-9fdb74e7b217d06c93172a8243f8547f947ee6d1.so')
expect(OneGadget.gadgets(file: path, force_file: true,
level: 1)).to eq [0x51e39, 0x51e45, 0x51e5a, 0x51e62, 0x84173, 0x84180, 0x8418c,
0x84199, 0xe3b2e, 0xe3b31, 0xe3b34, 0xe3d23, 0xe3d26, 0xe3d99,
0xe3da0, 0xe3de5, 0xe3ded, 0x1075da, 0x1075e2, 0x1075e7, 0x1075f1]
level: 1)).to eq [0x51e2b, 0x51e32, 0x51e39, 0x51e40, 0x51e45, 0x51e55, 0x51e5a,
0x51e5d, 0x51e62, 0x84165, 0x8416c, 0x84173, 0x84176, 0x8417b,
0x84180, 0x8418c, 0x84192, 0x84199, 0x841a0, 0xe3b2e, 0xe3b31,
0xe3b34, 0xe3d23, 0xe3d26, 0xe3d92, 0xe3d99, 0xe3da0, 0xe3dd7,
0xe3de1, 0xe3de5, 0xe3ded, 0x1075da, 0x1075e2, 0x1075e7, 0x1075f1]
expect(OneGadget.gadgets(file: path)).to eq [0xe3b2e, 0xe3b31, 0xe3b34]
end

Expand Down
4 changes: 3 additions & 1 deletion spec/one_gadget_i386_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@

it 'libc-2.19' do
path = data_path('libc-2.19-fd51b20e670e9a9f60dc3b06dc9761fb08c9358b.so')
expect(OneGadget.gadgets(file: path, force_file: true)).to eq [0x3fd27, 0x64c64, 0x64c6a, 0x64c6e]
expect(OneGadget.gadgets(file: path,
force_file: true)).to eq [0x3fd17, 0x3fd1e, 0x3fd27,
0x64c60, 0x64c64, 0x64c6a, 0x64c6e]
end

it 'libc-2.23' do
Expand Down

0 comments on commit eaf91d0

Please sign in to comment.