Shorting a PIPE or secondary and covering with the shares is supposed to be illegal.
This used to be routine practice, but I don't think it is any longer. However, shorting in anticipation of an offering is legal (assuming you haven't any actual knowledge of the offering), and these guys pretty much can guess when another offering must be on the horizon.