I think the planes have some thing called as fly by wire, which runs a embedded linux os, which basically takes force control from the pilot if it detects anything unusual. This thing could be hacked if one has the right knowledge to do it.
It´s possible to create a custom software and charge it to the airplane? very difficult but possible. It´s possible to take over the control and fly it where you want to, without the pilots having a chance? no.
Maybe in the next generation airplanes once more complex computers are used.
The most probable outcome is that the computer you have hacked will stop communicating with other systems or it´s own sensors and will crash (the computer not the airplane).