State-dependent attack and defense mechanisms in a wireless networked control system are investigated. The controller in this system attempts to transmit control commands to a remotely located plant by using a wireless channel that is subject to jamming attacks from an adversary. The probability of a failure on this channel depends on the powers of both the transmission signal emitted from the controller and the jamming interference signal emitted from the attacker. We show that if the power levels of transmissions from the controller are consistently above a threshold and the average power level of the jamming interference is sufficiently small, then the networked control system is guaranteed to be almost surely asymptotically stable. However, it is hard to analytically derive optimal attack and defense policies due to the complexity of the wireless channel model. To find out potentially dangerous attacks and high-performance defense policies, we propose a search-based approach and utilize genetic algorithms. Specifically, by considering Voronoi partitions of the state space, we find attack policies that achieve large quadratic costs. We use the search-based approach also for designing defense policies, where the controller adjusts the power of the transmission signal based on the plant's state information. The efficacy of the proposed approach is demonstrated through a number of simulation-based experiments.