You may not have to pull out the dishwasher. All electrical connections for dishwashers are at the bottom right in the front. I just installed a new Whirlpool this past weekend for my son and the electrical box is held in with one hex screw. Remove the screw, pivot the box to the left and pull it out. The was enough wire from the wall and from the dishwasher that I was able to make the connection in front of the machine. If it's a GE brand or other older model the electric box cover comes off facing the front. You can remove the cable from the box, tie a string to the wire and pull the wire back from the sink out from the dishwasher cabinet. Use the string to pull the new wire from the sink base to the dishwasher. I had to do something similar. As I pushed the dishwasher into place the wire was being pushed back toward the back wall. I pulled out the machine, tied a pull string to the wire and as I push the machine back into place I kept pulling on the string to get the wire out in front of it.
This a new whirlpool model. After the dishwasher was leveled the leg did straighten out.
View attachment 44736