(I like how you restrained from directly linking to the TV Tropes entry. It keeps everyone's valuable Internet time from disappearing)
It's hard to compare anything to rape, really, though I can see how the first one might be comparable. General memory-probing like the second one I'd compare to an invasive strip-search. It's not malicious, and the heroes believe they're justified because if they did find something useful it might save lives, but it's still a violation.