File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -476,13 +476,22 @@ def self.geteip_fpu(badchars, modified_registers = [])
476
476
# If the register is not ESP, copy ESP
477
477
if ( dst != ESP )
478
478
mod_registers . push ( dst )
479
- next if badchars . index ( ( 0x70 + dst ) . chr )
479
+ if badchars . index ( ( 0x70 + dst ) . chr )
480
+ mod_registers . pop ( dst )
481
+ next
482
+ end
480
483
481
484
if !( badchars . index ( "\x89 " ) or badchars . index ( ( 0xE0 +dst ) . chr ) )
482
485
buf << "\x89 " + ( 0xE0 + dst ) . chr
483
486
else
484
- next if badchars . index ( "\x54 " )
485
- next if badchars . index ( ( 0x58 +dst ) . chr )
487
+ if badchars . index ( "\x54 " )
488
+ mod_registers . pop ( dst )
489
+ next
490
+ end
491
+ if badchars . index ( ( 0x58 +dst ) . chr )
492
+ mod_registers . pop ( dst )
493
+ next
494
+ end
486
495
buf << "\x54 " + ( 0x58 + dst ) . chr
487
496
end
488
497
end
@@ -519,6 +528,7 @@ def self.geteip_fpu(badchars, modified_registers = [])
519
528
modified_registers . concat ( mod_registers )
520
529
return [ out , REG_NAMES32 [ reg ] . upcase , gap ]
521
530
end
531
+ mod_registers . pop ( dst )
522
532
end
523
533
524
534
return nil
You can’t perform that action at this time.
0 commit comments