[2015] Nokia X2 Kernel Exploit for Stock Rom (Source Code)

I wrote a windows executable which gains access adb with root permissions without any su binary.
I wrote it for batch developers. I hope we can see new tools for our X2.
Also it has detailed help and usage instructions
Please look screenies below.

Download:
-Exploit
-ADB Tools

Source Code: (*.bat file)



@echo off
:settingexe
cls
echo. ...setting exe properties
mode con:cols=50 lines=21
color 0a
rem CursorHide
set ver=v1.00
set title=Nokia X2 Exploit
set date=12/07/2015
set author=by Ali BEYAZ aka Symbuzzer@XDA
title %title%
goto start

:start
echo. %title%
echo. %author%
echo. %date% %ver%
echo.
goto checkfiles

:checkfiles
echo. ...checking files
if not exist adb.exe goto adbnotfound
if not exist AdbWinApi.dll goto adbnotfound
if not exist AdbWinUsbApi.dll goto adbnotfound
if not exist cygwin1.dll goto adbnotfound
if not exist exploit.exe goto modified
echo. ...SUCCESS - files ready
goto commands

:commands
if "%~1"=="" goto help
if "%~1"=="-help" goto help
if "%~1"=="-hide" goto hidden
if "%~1"=="-start" goto startingadb

:hidden
echo. ...hiding, please wait
timeout /nobreak 4 > nul
rem Hideself
goto startingadb

:startingadb
echo. ...killing old adb session
adb kill-server > nul
echo. ...running a new adb session
adb start-server > nul
goto waitingphoneconnection

:waitingphoneconnection
echo. ...checking phone connection
echo. ...waiting phone connection
adb wait-for-device
echo. ...SUCCESS - phone connected
goto adbroot

:adbroot
echo. ...attempting to gain root access over adb
adb root > nul
echo. ...exploiting, please wait
adb wait-for-device
echo. ...starting shell session
adb shell setprop debug.adb.root 1 > nul
adb shell exit
echo. ...2nd attempt to gain root access over adb
adb root > nul
echo. ...please wait
adb wait-for-device
adb shell exit
echo. ...ending shell session
echo. ...3rd attempt to gain root access over adb
adb root > nul
goto adbrootsuccess

:adbrootsuccess
echo. ...SUCCESS - gained adb root access
timeout /nobreak 20
exit

:adbnotfound
mode con:cols=50 lines=8
echo. ...ERROR - adb tools not found!
echo. ...adb tools are:
echo. ... -adb.exe
echo. ... -AdbWinApi.dll
echo. ... -AdbWinUsbApi.dll
echo. ... -cygwin1.dll
timeout /nobreak 10
exit

:modified
mode con:cols=50 lines=4
echo. ...ERROR - it seems you try to modify exploit
echo. ...refusing
timeout /nobreak 10
exit

:help
cls
mode con:cols=90 lines=21
echo.
echo. %title%
echo. %author%
echo. %date% %ver%
echo.
echo. COMMANDS:
echo. -start run process foreground (exploit.exe -start)
echo. -hide run process invisible (exploit.exe -hide)
echo. -help open help menu (exploit.exe -help)
echo.
echo. HOW TO USE:
echo. You can call it from a batch file with "call exploit.exe -start" command
echo.
You can run it from a batch file with "start /w exploit.exe -start" command
echo. You can run hidden it from a batch file with "start /w exploit.exe -hide" command
echo.
echo. NOTES:
echo.
Use "start /w" command instead "start" for waiting gaining root over adb
echo. * Dont modify exploit.exe file, otherwise it will refuse to run
echo.
echo. ...press any key to exit
pause > nul
exit


Screenshoots:

[2015] Nokia X2 Kernel Exploit for Stock Rom (Source Code)
[2015] Nokia X2 Kernel Exploit for Stock Rom (Source Code)
[2015] Nokia X2 Kernel Exploit for Stock Rom (Source Code)
[2015] Nokia X2 Kernel Exploit for Stock Rom (Source Code)