Skip to content

Commit

Permalink
Merge pull request #56 from dmg210/main
Browse files Browse the repository at this point in the history
add immobilizer functionality to the gui
  • Loading branch information
dmg210 authored Nov 23, 2024
2 parents 17ffd36 + 8780da2 commit 6a6ba88
Show file tree
Hide file tree
Showing 4 changed files with 699 additions and 34 deletions.
179 changes: 150 additions & 29 deletions flasher/gkflasher.ui
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,22 @@
<rect>
<x>0</x>
<y>0</y>
<width>800</width>
<width>801</width>
<height>642</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>801</width>
<height>642</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>801</width>
<height>642</height>
</size>
</property>
<property name="windowTitle">
<string>GKFlasher</string>
</property>
Expand All @@ -20,10 +32,10 @@
<widget class="QTabWidget" name="tabWidget">
<property name="geometry">
<rect>
<x>0</x>
<x>10</x>
<y>50</y>
<width>881</width>
<height>171</height>
<width>781</width>
<height>161</height>
</rect>
</property>
<property name="currentIndex">
Expand Down Expand Up @@ -90,7 +102,7 @@
<rect>
<x>100</x>
<y>100</y>
<width>681</width>
<width>661</width>
<height>22</height>
</rect>
</property>
Expand Down Expand Up @@ -124,7 +136,7 @@
<rect>
<x>100</x>
<y>10</y>
<width>681</width>
<width>661</width>
<height>22</height>
</rect>
</property>
Expand Down Expand Up @@ -207,7 +219,7 @@
<rect>
<x>100</x>
<y>10</y>
<width>681</width>
<width>661</width>
<height>22</height>
</rect>
</property>
Expand Down Expand Up @@ -244,6 +256,115 @@
</property>
</widget>
</widget>
<widget class="QWidget" name="tab_immo">
<attribute name="title">
<string>Immobilizer</string>
</attribute>
<widget class="QPushButton" name="immoInfoBtn">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Display Information</string>
</property>
</widget>
<widget class="QPushButton" name="smartraNeturalizeBtn">
<property name="geometry">
<rect>
<x>210</x>
<y>10</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Smartra Neutralize</string>
</property>
</widget>
<widget class="QPushButton" name="limpHomeModeBtn">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Limp Home Mode</string>
</property>
</widget>
<widget class="QPushButton" name="teachKeysBtn">
<property name="geometry">
<rect>
<x>210</x>
<y>40</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Teach Keys</string>
</property>
</widget>
<widget class="QPushButton" name="immoResetBtn">
<property name="geometry">
<rect>
<x>10</x>
<y>70</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Immo Reset</string>
</property>
</widget>
<widget class="QPushButton" name="limpHomePasswordChangeBtn">
<property name="geometry">
<rect>
<x>210</x>
<y>70</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Limp Home Password Change</string>
</property>
</widget>
<widget class="QPushButton" name="readVinBtn">
<property name="geometry">
<rect>
<x>10</x>
<y>100</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Read VIN</string>
</property>
</widget>
<widget class="QPushButton" name="writeVinBtn">
<property name="geometry">
<rect>
<x>210</x>
<y>100</y>
<width>191</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>Write VIN</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="about">
<attribute name="title">
<string>About</string>
Expand All @@ -253,23 +374,23 @@
<rect>
<x>0</x>
<y>0</y>
<width>801</width>
<height>141</height>
<width>775</width>
<height>138</height>
</rect>
</property>
<property name="html">
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;meta charset=&quot;utf-8&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'System Font'; font-size:10pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;https://opengk.org&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Created by:&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;dante383&lt;/span&gt; https://github.com/dante383&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;dmg210&lt;/span&gt; https://github.com/dmg210&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;Special thanks:&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-weight:700;&quot;&gt;chase206 KyleM Rob46&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt;&quot;&gt;https://opengk.org&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'System Font'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt;&quot;&gt;Created by:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt; font-weight:696;&quot;&gt;dante383&lt;/span&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt;&quot;&gt; https://github.com/dante383&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt; font-weight:696;&quot;&gt;dmg210&lt;/span&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt;&quot;&gt; https://github.com/dmg210&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'System Font'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt;&quot;&gt;Special thanks:&lt;/span&gt;&lt;/p&gt;
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-family:'System Font'; font-size:10pt; font-weight:696;&quot;&gt;chase206 KyleM Rob46&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
</widget>
</widget>
Expand All @@ -293,9 +414,9 @@ p, li { white-space: pre-wrap; }
<widget class="QProgressBar" name="progressBar">
<property name="geometry">
<rect>
<x>0</x>
<x>10</x>
<y>220</y>
<width>801</width>
<width>791</width>
<height>23</height>
</rect>
</property>
Expand All @@ -306,19 +427,19 @@ p, li { white-space: pre-wrap; }
<widget class="QTextEdit" name="logOutput">
<property name="geometry">
<rect>
<x>0</x>
<y>240</y>
<width>801</width>
<height>401</height>
<x>10</x>
<y>250</y>
<width>781</width>
<height>381</height>
</rect>
</property>
</widget>
<widget class="QComboBox" name="ecusBox">
<property name="geometry">
<rect>
<x>420</x>
<x>490</x>
<y>10</y>
<width>371</width>
<width>301</width>
<height>23</height>
</rect>
</property>
Expand All @@ -332,9 +453,9 @@ p, li { white-space: pre-wrap; }
<widget class="QComboBox" name="baudratesBox">
<property name="geometry">
<rect>
<x>420</x>
<x>490</x>
<y>40</y>
<width>371</width>
<width>301</width>
<height>23</height>
</rect>
</property>
Expand Down
3 changes: 1 addition & 2 deletions flasher/immo.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def cli_immo_reset (bus, desired_baudrate):
if (input('[?] Looks good! Continue? [y/n]: ') == 'y'):
print(bus.execute(kwp.commands.StartRoutineByLocalIdentifier(Routine.IMMO_RESET_CONFIRM.value, 0x01)).get_data())

print('[*] ECU reseted! Turn ignition off for 10 seconds for changes to take effect')
print('[*] ECU restarted! Turn ignition off for 10 seconds for changes to take effect')

def cli_smartra_neutralize (bus, desired_baudrate):
print('[*] starting default diagnostic session')
Expand Down Expand Up @@ -148,7 +148,6 @@ def cli_immo_teach_keys (bus, desired_baudrate):
key_b = (key >> 8) & 0xFF
key_c = key & 0xFF


print('[*] Starting routine 0x1A with key as parameter and some 0xFFs')
print(bus.execute(kwp.commands.StartRoutineByLocalIdentifier(Routine.IMMO_INPUT_PASSWORD.value, key_a, key_b, key_c, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF)).get_data())

Expand Down
2 changes: 1 addition & 1 deletion gkflasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def cli_flash_eeprom (ecu, input_filename, flash_calibration=True, flash_program
def cli_clear_adaptive_values (ecu, desired_baudrate):
print('[*] Clearing adaptive values.. ', end='')
ecu.clear_adaptive_values(desired_baudrate)
print('Done!')
print('Done! Turn off ignition for 10 seconds to apply changes.')

def load_config (config_filename):
return yaml.safe_load(open('gkflasher.yml'))
Expand Down
Loading

0 comments on commit 6a6ba88

Please sign in to comment.