Halal product targeting a haram industry?

Salam all,

If the product in and of itself is halal, but the product specifically targets a haram industry and facilitates it, is this haram or halal to buy the stock (that sells the product)?

My basic understanding is that since, under hanafi fiqh, it’s ok to sell grapes to a winemaker then it’s ok to buy a stock which sells a halal product to a haram industry even if it specifically is targeted to it.

e.g. a product targeted specifically at the cannabis industry (like cultivation equipment), or a video-sharing platform aimed at the haram music industry.

My understanding is basic though so I don’t want to extrapolate too far. Has anyone read anything different?

Visa and MA are commonly held