File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 1004
1004
it "returns a register as third element" do
1005
1005
expect ( subject [ 2 ] ) . to be_an Fixnum
1006
1006
end
1007
+
1008
+ context "when modified_registers passed" do
1009
+ let ( :modified_registers ) { [ ] }
1010
+ it "add modified registers" do
1011
+ described_class . geteip_fpu ( badchars , modified_registers )
1012
+ expect ( modified_registers ) . to_not be_empty
1013
+ end
1014
+
1015
+ it "modifies 2 or 3 registers" do
1016
+ described_class . geteip_fpu ( badchars , modified_registers )
1017
+ expect ( modified_registers . length ) . to be_between ( 2 , 3 )
1018
+ end
1019
+
1020
+ it "modifies ESP" do
1021
+ described_class . geteip_fpu ( badchars , modified_registers )
1022
+ expect ( modified_registers ) . to include ( Rex ::Arch ::X86 ::ESP )
1023
+ end
1024
+ end
1007
1025
end
1008
1026
1009
1027
context "when too many badchars" do
1010
1028
let ( :badchars ) { ( 0x00 ..0xff ) . to_a . pack ( "C*" ) }
1011
1029
1012
1030
it { is_expected . to be_nil }
1031
+
1032
+ context "when modified_registers passed" do
1033
+ let ( :modified_registers ) { [ ] }
1034
+ it "doesn't add any register" do
1035
+ described_class . geteip_fpu ( badchars , modified_registers )
1036
+ expect ( modified_registers ) . to be_empty
1037
+ end
1038
+ end
1013
1039
end
1014
1040
end
1015
1041
You can’t perform that action at this time.
0 commit comments