Re: Preliminary enV2/VX9100 Support

Nathan Hjelm <[email protected]>
Newsgroups gmane.comp.mobile.bitpim.devel
Message-ID <[email protected]>
Attached are patches which implement the suggestion from my previous  
email (setting all the bytes of keys 1-4). The extended patch extends  
DMv5 to autodetect DMv6 and the separate patch keeps DMv5 and DMv6  
separate. Joe and Aaron, does setting the keys in this way unlock both  
of your phones properly? As I mentioned earlier, neither phone appears  
to care if the 0xfe 00 command is one byte too short or too long so  
the extended patch should work.



-Nathan

On Jun 28, 2008, at 11:24 PM, Joe Pham wrote:

>> Is there a reason why the DM version needs to be hardcoded for each
>> phone? DMv6 is an simply extension of DMv5 and can be detected on
>> the fly.
>
> I thought it'd be cleaner to separate them out since the length of  
> the 0xFE command is different from v5 (7 bytes) to v6 (either 8 or  
> 24 bytes), though that may or may not make any practical differences.
>
> -Joe Pham
>
>
> ____________________________________________________________
> Beauty Advice Just Got a Makeover
> Read reviews about the beauty products you have always wanted to try
> http://thirdpartyoffers.netzero.net/TGL2231/fc/JKFkuJO6pwABNrqcf6lIUSlxJ7MjiXATFCm2g8Cbwzsi3oOi5pa3a8/
>
> -------------------------------------------------------------------------
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> BitPim-devel mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bitpim-devel

-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php

_______________________________________________
BitPim-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bitpim-devel
dmv5_extended.diff (application/octet-stream, 43.2 KB)
Index: src/phones/p_lg.py
===================================================================
--- src/phones/p_lg.py	(revision 4621)
+++ src/phones/p_lg.py	(working copy)
@@ -2084,7 +2084,7 @@
         self._bufferstartoffset=buf.getcurrentoffset()
         try: self.__field_cmd
         except:
-            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'constant': 0xFE })
         self.__field_cmd.writetobuffer(buf)
         try: self.__field_unlock_code
         except:
@@ -2103,7 +2103,7 @@
         'Reads this packet from the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
-        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'constant': 0xFE })
         self.__field_cmd.readfrombuffer(buf)
         self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
         self.__field_unlock_code.readfrombuffer(buf)
@@ -2117,14 +2117,14 @@
     def __getfield_cmd(self):
         try: self.__field_cmd
         except:
-            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'constant': 0xFE })
         return self.__field_cmd.getvalue()
 
     def __setfield_cmd(self, value):
         if isinstance(value,UINT):
             self.__field_cmd=value
         else:
-            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'constant': 0xFE })
 
     def __delfield_cmd(self): del self.__field_cmd
 
@@ -2309,17 +2309,17 @@
 
 
 
-class DMKeyReq(BaseProtogenClass):
-    "Slightly different command for DMv6"
-    __fields=['cmd', 'unlock_code', 'unlock_key', 'zero', 'option']
+class ULReqv6(BaseProtogenClass):
+    ""
+    __fields=['cmd', 'unlock_code', 'key0', 'zero', 'key1', 'key2', 'key3', 'key4']
 
     def __init__(self, *args, **kwargs):
         dict={}
         # What was supplied to this function
         dict.update(kwargs)
         # Parent constructor
-        super(DMKeyReq,self).__init__(**dict)
-        if self.__class__ is DMKeyReq:
+        super(ULReqv6,self).__init__(**dict)
+        if self.__class__ is ULReqv6:
             self._update(args,dict)
 
 
@@ -2328,7 +2328,7 @@
 
 
     def _update(self, args, kwargs):
-        super(DMKeyReq,self)._update(args,kwargs)
+        super(ULReqv6,self)._update(args,kwargs)
         keys=kwargs.keys()
         for key in keys:
             if key in self.__fields:
@@ -2336,7 +2336,7 @@
                 del kwargs[key]
         # Were any unrecognized kwargs passed in?
         if __debug__:
-            self._complainaboutunusedargs(DMKeyReq,kwargs)
+            self._complainaboutunusedargs(ULReqv6,kwargs)
         if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
         # Make all P fields that haven't already been constructed
 
@@ -2346,24 +2346,21 @@
         self._bufferstartoffset=buf.getcurrentoffset()
         try: self.__field_cmd
         except:
-            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'constant': 0xFE })
         self.__field_cmd.writetobuffer(buf)
         try: self.__field_unlock_code
         except:
-            self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x03 })
         self.__field_unlock_code.writetobuffer(buf)
-        try: self.__field_unlock_key
-        except:
-            self.__field_unlock_key=UINT(**{'sizeinbytes': 4,  'default': 0x00 })
-        self.__field_unlock_key.writetobuffer(buf)
+        self.__field_key0.writetobuffer(buf)
         try: self.__field_zero
         except:
-            self.__field_zero=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_zero=UINT(**{'sizeinbytes': 2,  'default': 0x00 })
         self.__field_zero.writetobuffer(buf)
-        try: self.__field_option
-        except:
-            self.__field_option=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_option.writetobuffer(buf)
+        self.__field_key1.writetobuffer(buf)
+        self.__field_key2.writetobuffer(buf)
+        self.__field_key3.writetobuffer(buf)
+        self.__field_key4.writetobuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
 
@@ -2372,30 +2369,36 @@
         'Reads this packet from the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
-        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'constant': 0xFE })
         self.__field_cmd.readfrombuffer(buf)
-        self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
+        self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x03 })
         self.__field_unlock_code.readfrombuffer(buf)
-        self.__field_unlock_key=UINT(**{'sizeinbytes': 4,  'default': 0x00 })
-        self.__field_unlock_key.readfrombuffer(buf)
-        self.__field_zero=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
+        self.__field_key0=UINT(**{'sizeinbytes': 4})
+        self.__field_key0.readfrombuffer(buf)
+        self.__field_zero=UINT(**{'sizeinbytes': 2,  'default': 0x00 })
         self.__field_zero.readfrombuffer(buf)
-        self.__field_option=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_option.readfrombuffer(buf)
+        self.__field_key1=UINT(**{'sizeinbytes': 4})
+        self.__field_key1.readfrombuffer(buf)
+        self.__field_key2=UINT(**{'sizeinbytes': 4})
+        self.__field_key2.readfrombuffer(buf)
+        self.__field_key3=UINT(**{'sizeinbytes': 4})
+        self.__field_key3.readfrombuffer(buf)
+        self.__field_key4=UINT(**{'sizeinbytes': 4})
+        self.__field_key4.readfrombuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
 
 
     def __getfield_cmd(self):
         try: self.__field_cmd
         except:
-            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'constant': 0xFE })
         return self.__field_cmd.getvalue()
 
     def __setfield_cmd(self, value):
         if isinstance(value,UINT):
             self.__field_cmd=value
         else:
-            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'constant': 0xFE })
 
     def __delfield_cmd(self): del self.__field_cmd
 
@@ -2404,91 +2407,127 @@
     def __getfield_unlock_code(self):
         try: self.__field_unlock_code
         except:
-            self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x03 })
         return self.__field_unlock_code.getvalue()
 
     def __setfield_unlock_code(self, value):
         if isinstance(value,UINT):
             self.__field_unlock_code=value
         else:
-            self.__field_unlock_code=UINT(value,**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_unlock_code=UINT(value,**{'sizeinbytes': 1,  'default': 0x03 })
 
     def __delfield_unlock_code(self): del self.__field_unlock_code
 
     unlock_code=property(__getfield_unlock_code, __setfield_unlock_code, __delfield_unlock_code, None)
 
-    def __getfield_unlock_key(self):
-        try: self.__field_unlock_key
-        except:
-            self.__field_unlock_key=UINT(**{'sizeinbytes': 4,  'default': 0x00 })
-        return self.__field_unlock_key.getvalue()
+    def __getfield_key0(self):
+        return self.__field_key0.getvalue()
 
-    def __setfield_unlock_key(self, value):
+    def __setfield_key0(self, value):
         if isinstance(value,UINT):
-            self.__field_unlock_key=value
+            self.__field_key0=value
         else:
-            self.__field_unlock_key=UINT(value,**{'sizeinbytes': 4,  'default': 0x00 })
+            self.__field_key0=UINT(value,**{'sizeinbytes': 4})
 
-    def __delfield_unlock_key(self): del self.__field_unlock_key
+    def __delfield_key0(self): del self.__field_key0
 
-    unlock_key=property(__getfield_unlock_key, __setfield_unlock_key, __delfield_unlock_key, None)
+    key0=property(__getfield_key0, __setfield_key0, __delfield_key0, None)
 
     def __getfield_zero(self):
         try: self.__field_zero
         except:
-            self.__field_zero=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_zero=UINT(**{'sizeinbytes': 2,  'default': 0x00 })
         return self.__field_zero.getvalue()
 
     def __setfield_zero(self, value):
         if isinstance(value,UINT):
             self.__field_zero=value
         else:
-            self.__field_zero=UINT(value,**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_zero=UINT(value,**{'sizeinbytes': 2,  'default': 0x00 })
 
     def __delfield_zero(self): del self.__field_zero
 
     zero=property(__getfield_zero, __setfield_zero, __delfield_zero, None)
 
-    def __getfield_option(self):
-        try: self.__field_option
-        except:
-            self.__field_option=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        return self.__field_option.getvalue()
+    def __getfield_key1(self):
+        return self.__field_key1.getvalue()
 
-    def __setfield_option(self, value):
+    def __setfield_key1(self, value):
         if isinstance(value,UINT):
-            self.__field_option=value
+            self.__field_key1=value
         else:
-            self.__field_option=UINT(value,**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_key1=UINT(value,**{'sizeinbytes': 4})
 
-    def __delfield_option(self): del self.__field_option
+    def __delfield_key1(self): del self.__field_key1
 
-    option=property(__getfield_option, __setfield_option, __delfield_option, None)
+    key1=property(__getfield_key1, __setfield_key1, __delfield_key1, None)
 
+    def __getfield_key2(self):
+        return self.__field_key2.getvalue()
+
+    def __setfield_key2(self, value):
+        if isinstance(value,UINT):
+            self.__field_key2=value
+        else:
+            self.__field_key2=UINT(value,**{'sizeinbytes': 4})
+
+    def __delfield_key2(self): del self.__field_key2
+
+    key2=property(__getfield_key2, __setfield_key2, __delfield_key2, None)
+
+    def __getfield_key3(self):
+        return self.__field_key3.getvalue()
+
+    def __setfield_key3(self, value):
+        if isinstance(value,UINT):
+            self.__field_key3=value
+        else:
+            self.__field_key3=UINT(value,**{'sizeinbytes': 4})
+
+    def __delfield_key3(self): del self.__field_key3
+
+    key3=property(__getfield_key3, __setfield_key3, __delfield_key3, None)
+
+    def __getfield_key4(self):
+        return self.__field_key4.getvalue()
+
+    def __setfield_key4(self, value):
+        if isinstance(value,UINT):
+            self.__field_key4=value
+        else:
+            self.__field_key4=UINT(value,**{'sizeinbytes': 4})
+
+    def __delfield_key4(self): del self.__field_key4
+
+    key4=property(__getfield_key4, __setfield_key4, __delfield_key4, None)
+
     def iscontainer(self):
         return True
 
     def containerelements(self):
         yield ('cmd', self.__field_cmd, None)
         yield ('unlock_code', self.__field_unlock_code, None)
-        yield ('unlock_key', self.__field_unlock_key, None)
+        yield ('key0', self.__field_key0, None)
         yield ('zero', self.__field_zero, None)
-        yield ('option', self.__field_option, None)
+        yield ('key1', self.__field_key1, None)
+        yield ('key2', self.__field_key2, None)
+        yield ('key3', self.__field_key3, None)
+        yield ('key4', self.__field_key4, None)
 
 
 
 
-class DMKeyResp(BaseProtogenClass):
-    "Return the key/seed needed to transition to DMv6"
-    __fields=['cmd', 'unlock_code', 'unlock_key']
+class ULResv6(BaseProtogenClass):
+    ""
+    __fields=['cmd', 'unlock_code', 'unlock_key', 'unlock_ok', 'bytes']
 
     def __init__(self, *args, **kwargs):
         dict={}
         # What was supplied to this function
         dict.update(kwargs)
         # Parent constructor
-        super(DMKeyResp,self).__init__(**dict)
-        if self.__class__ is DMKeyResp:
+        super(ULResv6,self).__init__(**dict)
+        if self.__class__ is ULResv6:
             self._update(args,dict)
 
 
@@ -2497,7 +2536,7 @@
 
 
     def _update(self, args, kwargs):
-        super(DMKeyResp,self)._update(args,kwargs)
+        super(ULResv6,self)._update(args,kwargs)
         keys=kwargs.keys()
         for key in keys:
             if key in self.__fields:
@@ -2505,7 +2544,7 @@
                 del kwargs[key]
         # Were any unrecognized kwargs passed in?
         if __debug__:
-            self._complainaboutunusedargs(DMKeyResp,kwargs)
+            self._complainaboutunusedargs(ULResv6,kwargs)
         if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
         # Make all P fields that haven't already been constructed
 
@@ -2516,6 +2555,8 @@
         self.__field_cmd.writetobuffer(buf)
         self.__field_unlock_code.writetobuffer(buf)
         self.__field_unlock_key.writetobuffer(buf)
+        self.__field_unlock_ok.writetobuffer(buf)
+        self.__field_bytes.writetobuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
 
@@ -2530,6 +2571,10 @@
         self.__field_unlock_code.readfrombuffer(buf)
         self.__field_unlock_key=UINT(**{'sizeinbytes': 4})
         self.__field_unlock_key.readfrombuffer(buf)
+        self.__field_unlock_ok=UINT(**{'sizeinbytes': 1})
+        self.__field_unlock_ok.readfrombuffer(buf)
+        self.__field_bytes=DATA()
+        self.__field_bytes.readfrombuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
 
 
@@ -2572,6 +2617,32 @@
 
     unlock_key=property(__getfield_unlock_key, __setfield_unlock_key, __delfield_unlock_key, None)
 
+    def __getfield_unlock_ok(self):
+        return self.__field_unlock_ok.getvalue()
+
+    def __setfield_unlock_ok(self, value):
+        if isinstance(value,UINT):
+            self.__field_unlock_ok=value
+        else:
+            self.__field_unlock_ok=UINT(value,**{'sizeinbytes': 1})
+
+    def __delfield_unlock_ok(self): del self.__field_unlock_ok
+
+    unlock_ok=property(__getfield_unlock_ok, __setfield_unlock_ok, __delfield_unlock_ok, None)
+
+    def __getfield_bytes(self):
+        return self.__field_bytes.getvalue()
+
+    def __setfield_bytes(self, value):
+        if isinstance(value,DATA):
+            self.__field_bytes=value
+        else:
+            self.__field_bytes=DATA(value,)
+
+    def __delfield_bytes(self): del self.__field_bytes
+
+    bytes=property(__getfield_bytes, __setfield_bytes, __delfield_bytes, None)
+
     def iscontainer(self):
         return True
 
@@ -2579,21 +2650,22 @@
         yield ('cmd', self.__field_cmd, None)
         yield ('unlock_code', self.__field_unlock_code, None)
         yield ('unlock_key', self.__field_unlock_key, None)
+        yield ('unlock_ok', self.__field_unlock_ok, None)
+        yield ('bytes', self.__field_bytes, None)
 
 
 
 
-class DMEnterReq(BaseProtogenClass):
-    "Request to transition to DMv6"
-    __fields=['cmd', 'unlock_code', 'unlock_key', 'zero', 'option', 'unlock_key2']
+class DM6Unlock2(BaseProtogenClass):
+    __fields=['cmd', 'data1', 'data2']
 
     def __init__(self, *args, **kwargs):
         dict={}
         # What was supplied to this function
         dict.update(kwargs)
         # Parent constructor
-        super(DMEnterReq,self).__init__(**dict)
-        if self.__class__ is DMEnterReq:
+        super(DM6Unlock2,self).__init__(**dict)
+        if self.__class__ is DM6Unlock2:
             self._update(args,dict)
 
 
@@ -2602,7 +2674,7 @@
 
 
     def _update(self, args, kwargs):
-        super(DMEnterReq,self)._update(args,kwargs)
+        super(DM6Unlock2,self)._update(args,kwargs)
         keys=kwargs.keys()
         for key in keys:
             if key in self.__fields:
@@ -2610,7 +2682,7 @@
                 del kwargs[key]
         # Were any unrecognized kwargs passed in?
         if __debug__:
-            self._complainaboutunusedargs(DMEnterReq,kwargs)
+            self._complainaboutunusedargs(DM6Unlock2,kwargs)
         if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
         # Make all P fields that haven't already been constructed
 
@@ -2620,29 +2692,16 @@
         self._bufferstartoffset=buf.getcurrentoffset()
         try: self.__field_cmd
         except:
-            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFB })
         self.__field_cmd.writetobuffer(buf)
-        try: self.__field_unlock_code
+        try: self.__field_data1
         except:
-            self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_unlock_code.writetobuffer(buf)
-        try: self.__field_unlock_key
+            self.__field_data1=UINT(**{'sizeinbytes': 2,  'default': 0x06 })
+        self.__field_data1.writetobuffer(buf)
+        try: self.__field_data2
         except:
-            self.__field_unlock_key=UINT(**{'sizeinbytes': 4,  'default': 0x00 })
-        self.__field_unlock_key.writetobuffer(buf)
-        try: self.__field_zero
-        except:
-            self.__field_zero=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_zero.writetobuffer(buf)
-        try: self.__field_option
-        except:
-            self.__field_option=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_option.writetobuffer(buf)
-        if self.unlock_code==3:
-            try: self.__field_unlock_key2
-            except:
-                self.__field_unlock_key2=LIST(**{'elementclass': _gen_p_lg_179,  'createdefault': True,                 'length': 16 })
-            self.__field_unlock_key2.writetobuffer(buf)
+            self.__field_data2=UINT(**{'sizeinbytes': 1,  'default': 0x02 })
+        self.__field_data2.writetobuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
 
@@ -2651,163 +2710,84 @@
         'Reads this packet from the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
-        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFB })
         self.__field_cmd.readfrombuffer(buf)
-        self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_unlock_code.readfrombuffer(buf)
-        self.__field_unlock_key=UINT(**{'sizeinbytes': 4,  'default': 0x00 })
-        self.__field_unlock_key.readfrombuffer(buf)
-        self.__field_zero=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_zero.readfrombuffer(buf)
-        self.__field_option=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        self.__field_option.readfrombuffer(buf)
-        if self.unlock_code==3:
-            self.__field_unlock_key2=LIST(**{'elementclass': _gen_p_lg_179,  'createdefault': True,                 'length': 16 })
-            self.__field_unlock_key2.readfrombuffer(buf)
+        self.__field_data1=UINT(**{'sizeinbytes': 2,  'default': 0x06 })
+        self.__field_data1.readfrombuffer(buf)
+        self.__field_data2=UINT(**{'sizeinbytes': 1,  'default': 0x02 })
+        self.__field_data2.readfrombuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
 
 
     def __getfield_cmd(self):
         try: self.__field_cmd
         except:
-            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFB })
         return self.__field_cmd.getvalue()
 
     def __setfield_cmd(self, value):
         if isinstance(value,UINT):
             self.__field_cmd=value
         else:
-            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'default': 0xFE })
+            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'default': 0xFB })
 
     def __delfield_cmd(self): del self.__field_cmd
 
     cmd=property(__getfield_cmd, __setfield_cmd, __delfield_cmd, None)
 
-    def __getfield_unlock_code(self):
-        try: self.__field_unlock_code
+    def __getfield_data1(self):
+        try: self.__field_data1
         except:
-            self.__field_unlock_code=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        return self.__field_unlock_code.getvalue()
+            self.__field_data1=UINT(**{'sizeinbytes': 2,  'default': 0x06 })
+        return self.__field_data1.getvalue()
 
-    def __setfield_unlock_code(self, value):
+    def __setfield_data1(self, value):
         if isinstance(value,UINT):
-            self.__field_unlock_code=value
+            self.__field_data1=value
         else:
-            self.__field_unlock_code=UINT(value,**{'sizeinbytes': 1,  'default': 0x00 })
+            self.__field_data1=UINT(value,**{'sizeinbytes': 2,  'default': 0x06 })
 
-    def __delfield_unlock_code(self): del self.__field_unlock_code
+    def __delfield_data1(self): del self.__field_data1
 
-    unlock_code=property(__getfield_unlock_code, __setfield_unlock_code, __delfield_unlock_code, None)
+    data1=property(__getfield_data1, __setfield_data1, __delfield_data1, None)
 
-    def __getfield_unlock_key(self):
-        try: self.__field_unlock_key
+    def __getfield_data2(self):
+        try: self.__field_data2
         except:
-            self.__field_unlock_key=UINT(**{'sizeinbytes': 4,  'default': 0x00 })
-        return self.__field_unlock_key.getvalue()
+            self.__field_data2=UINT(**{'sizeinbytes': 1,  'default': 0x02 })
+        return self.__field_data2.getvalue()
 
-    def __setfield_unlock_key(self, value):
+    def __setfield_data2(self, value):
         if isinstance(value,UINT):
-            self.__field_unlock_key=value
+            self.__field_data2=value
         else:
-            self.__field_unlock_key=UINT(value,**{'sizeinbytes': 4,  'default': 0x00 })
+            self.__field_data2=UINT(value,**{'sizeinbytes': 1,  'default': 0x02 })
 
-    def __delfield_unlock_key(self): del self.__field_unlock_key
+    def __delfield_data2(self): del self.__field_data2
 
-    unlock_key=property(__getfield_unlock_key, __setfield_unlock_key, __delfield_unlock_key, None)
+    data2=property(__getfield_data2, __setfield_data2, __delfield_data2, None)
 
-    def __getfield_zero(self):
-        try: self.__field_zero
-        except:
-            self.__field_zero=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        return self.__field_zero.getvalue()
-
-    def __setfield_zero(self, value):
-        if isinstance(value,UINT):
-            self.__field_zero=value
-        else:
-            self.__field_zero=UINT(value,**{'sizeinbytes': 1,  'default': 0x00 })
-
-    def __delfield_zero(self): del self.__field_zero
-
-    zero=property(__getfield_zero, __setfield_zero, __delfield_zero, None)
-
-    def __getfield_option(self):
-        try: self.__field_option
-        except:
-            self.__field_option=UINT(**{'sizeinbytes': 1,  'default': 0x00 })
-        return self.__field_option.getvalue()
-
-    def __setfield_option(self, value):
-        if isinstance(value,UINT):
-            self.__field_option=value
-        else:
-            self.__field_option=UINT(value,**{'sizeinbytes': 1,  'default': 0x00 })
-
-    def __delfield_option(self): del self.__field_option
-
-    option=property(__getfield_option, __setfield_option, __delfield_option, None)
-
-    def __getfield_unlock_key2(self):
-        try: self.__field_unlock_key2
-        except:
-            self.__field_unlock_key2=LIST(**{'elementclass': _gen_p_lg_179,  'createdefault': True,                 'length': 16 })
-        return self.__field_unlock_key2.getvalue()
-
-    def __setfield_unlock_key2(self, value):
-        if isinstance(value,LIST):
-            self.__field_unlock_key2=value
-        else:
-            self.__field_unlock_key2=LIST(value,**{'elementclass': _gen_p_lg_179,  'createdefault': True,                 'length': 16 })
-
-    def __delfield_unlock_key2(self): del self.__field_unlock_key2
-
-    unlock_key2=property(__getfield_unlock_key2, __setfield_unlock_key2, __delfield_unlock_key2, None)
-
     def iscontainer(self):
         return True
 
     def containerelements(self):
         yield ('cmd', self.__field_cmd, None)
-        yield ('unlock_code', self.__field_unlock_code, None)
-        yield ('unlock_key', self.__field_unlock_key, None)
-        yield ('zero', self.__field_zero, None)
-        yield ('option', self.__field_option, None)
-        if self.unlock_code==3:
-            yield ('unlock_key2', self.__field_unlock_key2, None)
+        yield ('data1', self.__field_data1, None)
+        yield ('data2', self.__field_data2, None)
 
 
-    def init_key2(self):
-        if self.unlock_code==3 and \
-           not len(self.unlock_key2):
-            for _idx in range(16):
-                self.unlock_key2.append(0)
 
-    def convert_to_key2(self):  
-        """Convert the key value to key2"""
-        if self.unlock_code!=3:
-            return
-        self.init_key2()
-        _buf=buffer()
-        UINT(sizeinbytes=4, value=self.unlock_key).writetobuffer(_buf)
-        _key=_buf.getvalue()
-        for _idx in range(4):
-            self.unlock_key2[_idx*4]=~ord(_key[_idx])
 
+class DM6Unlock2Resp(BaseProtogenClass):
+    __fields=['cmd', 'data1', 'data2', 'unk']
 
-
-
-
-class _gen_p_lg_179(BaseProtogenClass):
-    'Anonymous inner class'
-    __fields=['data']
-
     def __init__(self, *args, **kwargs):
         dict={}
         # What was supplied to this function
         dict.update(kwargs)
         # Parent constructor
-        super(_gen_p_lg_179,self).__init__(**dict)
-        if self.__class__ is _gen_p_lg_179:
+        super(DM6Unlock2Resp,self).__init__(**dict)
+        if self.__class__ is DM6Unlock2Resp:
             self._update(args,dict)
 
 
@@ -2816,7 +2796,7 @@
 
 
     def _update(self, args, kwargs):
-        super(_gen_p_lg_179,self)._update(args,kwargs)
+        super(DM6Unlock2Resp,self)._update(args,kwargs)
         keys=kwargs.keys()
         for key in keys:
             if key in self.__fields:
@@ -2824,88 +2804,7 @@
                 del kwargs[key]
         # Were any unrecognized kwargs passed in?
         if __debug__:
-            self._complainaboutunusedargs(_gen_p_lg_179,kwargs)
-        if len(args):
-            dict2={'sizeinbytes': 1,  'default': 0 }
-            dict2.update(kwargs)
-            kwargs=dict2
-            self.__field_data=UINT(*args,**dict2)
-        # Make all P fields that haven't already been constructed
-
-
-    def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
-        'Writes this packet to the supplied buffer'
-        self._bufferstartoffset=buf.getcurrentoffset()
-        try: self.__field_data
-        except:
-            self.__field_data=UINT(**{'sizeinbytes': 1,  'default': 0 })
-        self.__field_data.writetobuffer(buf)
-        self._bufferendoffset=buf.getcurrentoffset()
-        if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
-
-
-    def readfrombuffer(self,buf,autolog=True,logtitle="<read data>"):
-        'Reads this packet from the supplied buffer'
-        self._bufferstartoffset=buf.getcurrentoffset()
-        if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
-        self.__field_data=UINT(**{'sizeinbytes': 1,  'default': 0 })
-        self.__field_data.readfrombuffer(buf)
-        self._bufferendoffset=buf.getcurrentoffset()
-
-
-    def __getfield_data(self):
-        try: self.__field_data
-        except:
-            self.__field_data=UINT(**{'sizeinbytes': 1,  'default': 0 })
-        return self.__field_data.getvalue()
-
-    def __setfield_data(self, value):
-        if isinstance(value,UINT):
-            self.__field_data=value
-        else:
-            self.__field_data=UINT(value,**{'sizeinbytes': 1,  'default': 0 })
-
-    def __delfield_data(self): del self.__field_data
-
-    data=property(__getfield_data, __setfield_data, __delfield_data, None)
-
-    def iscontainer(self):
-        return True
-
-    def containerelements(self):
-        yield ('data', self.__field_data, None)
-
-
-
-
-class DMEnterResp(BaseProtogenClass):
-    "Response to our request to enter DMv6"
-    __fields=['cmd', 'unlock_code', 'unlock_key', 'result']
-
-    def __init__(self, *args, **kwargs):
-        dict={}
-        # What was supplied to this function
-        dict.update(kwargs)
-        # Parent constructor
-        super(DMEnterResp,self).__init__(**dict)
-        if self.__class__ is DMEnterResp:
-            self._update(args,dict)
-
-
-    def getfields(self):
-        return self.__fields
-
-
-    def _update(self, args, kwargs):
-        super(DMEnterResp,self)._update(args,kwargs)
-        keys=kwargs.keys()
-        for key in keys:
-            if key in self.__fields:
-                setattr(self, key, kwargs[key])
-                del kwargs[key]
-        # Were any unrecognized kwargs passed in?
-        if __debug__:
-            self._complainaboutunusedargs(DMEnterResp,kwargs)
+            self._complainaboutunusedargs(DM6Unlock2Resp,kwargs)
         if len(args): raise TypeError('Unexpected arguments supplied: '+`args`)
         # Make all P fields that haven't already been constructed
 
@@ -2913,10 +2812,19 @@
     def writetobuffer(self,buf,autolog=True,logtitle="<written data>"):
         'Writes this packet to the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
+        try: self.__field_cmd
+        except:
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFB })
         self.__field_cmd.writetobuffer(buf)
-        self.__field_unlock_code.writetobuffer(buf)
-        self.__field_unlock_key.writetobuffer(buf)
-        self.__field_result.writetobuffer(buf)
+        try: self.__field_data1
+        except:
+            self.__field_data1=UINT(**{'sizeinbytes': 2,  'default': 0x06 })
+        self.__field_data1.writetobuffer(buf)
+        try: self.__field_data2
+        except:
+            self.__field_data2=UINT(**{'sizeinbytes': 6,  'default': 0    })
+        self.__field_data2.writetobuffer(buf)
+        self.__field_unk.writetobuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
 
@@ -2925,77 +2833,86 @@
         'Reads this packet from the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
-        self.__field_cmd=UINT(**{'sizeinbytes': 1})
+        self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFB })
         self.__field_cmd.readfrombuffer(buf)
-        self.__field_unlock_code=UINT(**{'sizeinbytes': 1})
-        self.__field_unlock_code.readfrombuffer(buf)
-        self.__field_unlock_key=UINT(**{'sizeinbytes': 4})
-        self.__field_unlock_key.readfrombuffer(buf)
-        self.__field_result=UINT(**{'sizeinbytes': 1})
-        self.__field_result.readfrombuffer(buf)
+        self.__field_data1=UINT(**{'sizeinbytes': 2,  'default': 0x06 })
+        self.__field_data1.readfrombuffer(buf)
+        self.__field_data2=UINT(**{'sizeinbytes': 6,  'default': 0    })
+        self.__field_data2.readfrombuffer(buf)
+        self.__field_unk=DATA()
+        self.__field_unk.readfrombuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
 
 
     def __getfield_cmd(self):
+        try: self.__field_cmd
+        except:
+            self.__field_cmd=UINT(**{'sizeinbytes': 1,  'default': 0xFB })
         return self.__field_cmd.getvalue()
 
     def __setfield_cmd(self, value):
         if isinstance(value,UINT):
             self.__field_cmd=value
         else:
-            self.__field_cmd=UINT(value,**{'sizeinbytes': 1})
+            self.__field_cmd=UINT(value,**{'sizeinbytes': 1,  'default': 0xFB })
 
     def __delfield_cmd(self): del self.__field_cmd
 
     cmd=property(__getfield_cmd, __setfield_cmd, __delfield_cmd, None)
 
-    def __getfield_unlock_code(self):
-        return self.__field_unlock_code.getvalue()
+    def __getfield_data1(self):
+        try: self.__field_data1
+        except:
+            self.__field_data1=UINT(**{'sizeinbytes': 2,  'default': 0x06 })
+        return self.__field_data1.getvalue()
 
-    def __setfield_unlock_code(self, value):
+    def __setfield_data1(self, value):
         if isinstance(value,UINT):
-            self.__field_unlock_code=value
+            self.__field_data1=value
         else:
-            self.__field_unlock_code=UINT(value,**{'sizeinbytes': 1})
+            self.__field_data1=UINT(value,**{'sizeinbytes': 2,  'default': 0x06 })
 
-    def __delfield_unlock_code(self): del self.__field_unlock_code
+    def __delfield_data1(self): del self.__field_data1
 
-    unlock_code=property(__getfield_unlock_code, __setfield_unlock_code, __delfield_unlock_code, None)
+    data1=property(__getfield_data1, __setfield_data1, __delfield_data1, None)
 
-    def __getfield_unlock_key(self):
-        return self.__field_unlock_key.getvalue()
+    def __getfield_data2(self):
+        try: self.__field_data2
+        except:
+            self.__field_data2=UINT(**{'sizeinbytes': 6,  'default': 0    })
+        return self.__field_data2.getvalue()
 
-    def __setfield_unlock_key(self, value):
+    def __setfield_data2(self, value):
         if isinstance(value,UINT):
-            self.__field_unlock_key=value
+            self.__field_data2=value
         else:
-            self.__field_unlock_key=UINT(value,**{'sizeinbytes': 4})
+            self.__field_data2=UINT(value,**{'sizeinbytes': 6,  'default': 0    })
 
-    def __delfield_unlock_key(self): del self.__field_unlock_key
+    def __delfield_data2(self): del self.__field_data2
 
-    unlock_key=property(__getfield_unlock_key, __setfield_unlock_key, __delfield_unlock_key, None)
+    data2=property(__getfield_data2, __setfield_data2, __delfield_data2, None)
 
-    def __getfield_result(self):
-        return self.__field_result.getvalue()
+    def __getfield_unk(self):
+        return self.__field_unk.getvalue()
 
-    def __setfield_result(self, value):
-        if isinstance(value,UINT):
-            self.__field_result=value
+    def __setfield_unk(self, value):
+        if isinstance(value,DATA):
+            self.__field_unk=value
         else:
-            self.__field_result=UINT(value,**{'sizeinbytes': 1})
+            self.__field_unk=DATA(value,)
 
-    def __delfield_result(self): del self.__field_result
+    def __delfield_unk(self): del self.__field_unk
 
-    result=property(__getfield_result, __setfield_result, __delfield_result, "0=Failure, 1=Success")
+    unk=property(__getfield_unk, __setfield_unk, __delfield_unk, None)
 
     def iscontainer(self):
         return True
 
     def containerelements(self):
         yield ('cmd', self.__field_cmd, None)
-        yield ('unlock_code', self.__field_unlock_code, None)
-        yield ('unlock_key', self.__field_unlock_key, None)
-        yield ('result', self.__field_result, "0=Failure, 1=Success")
+        yield ('data1', self.__field_data1, None)
+        yield ('data2', self.__field_data2, None)
+        yield ('unk', self.__field_unk, None)
 
 
 
Index: src/phones/com_lg.py
===================================================================
--- src/phones/com_lg.py	(revision 4621)
+++ src/phones/com_lg.py	(working copy)
@@ -17,6 +17,7 @@
 import p_lg
 import prototypes
 import common
+import random
 
 class LGPhonebook:
 
@@ -1592,38 +1593,49 @@
         _req=self.protocolclass.ULReq(unlock_key=0)
         _resp=self.sendbrewcommand(_req, self.protocolclass.ULRes)
 
-        # respond with the key
+        # generate the challenge-repsponse
         _key=self.get_challenge_response(_resp.unlock_key)
         if _key is None:
             self.log('Failed to get the key.')
             raise EnterDMError('Failed to get the key')
 
-        _req=self.protocolclass.ULReq(unlock_code=1, unlock_key=_key)
-        _resp=self.sendbrewcommand(_req, self.protocolclass.ULRes)
-        if _resp.unlock_ok!=1:
+        if _resp.unlock_code == 0x02:
+            # DMv6 phones respond with "unlock code" 02
+            _resp = self._DMv6_unlock (_key ^ 0xffffffffL)
+        elif _resp.unlock_code == 0x00:
+            # DMv5 phones respond with "unlock code" 01
+            _resp = self._DMv5_unlock (_key)
+        else:
+            raise EnterDMError('Unknown unlock code from phone: %d'%_resp.unlock_code)
+
+        if _resp.unlock_ok != 1:
             raise EnterDMError('Bad response - unlock_ok: %d'%_resp.unlock_ok)
 
-    def _enter_DMv6(self):
-        # similar but slightly different from v5, the enV2 started this!
-        # request the seed
-        _req=self.protocolclass.DMKeyReq()
-        _resp=self.sendbrewcommand(_req, self.protocolclass.DMKeyResp)
-        _key=self.get_challenge_response(_resp.unlock_key)
-        if _key is None:
-            self.log('Failed to get the key.')
-            raise EnterDMError('Failed to get the key')
-        _req=self.protocolclass.DMEnterReq(unlock_key=_key)
-        if _resp.unlock_code==0:
-            _req.unlock_code=1
-        elif _resp.unlock_code==2:
-            _req.unlock_code=3
-            _req.convert_to_key2()
-        else:
-            raise EnterDMError('Unknown unlock_code: %d'%_resp.unlock_code)
-        _resp=self.sendbrewcommand(_req, self.protocolclass.DMEnterResp)
-        if _resp.result!=1:
-            raise EnterDMError('Bad response - unlock_ok: %d'%_resp.result)
+    def _DMv5_unlock(self, key):
+        _req=self.protocolclass.ULReq(unlock_code=1, unlock_key=key)
+        _resp=self.sendbrewcommand(_req, self.protocolclass.ULRes)
+        return _resp
 
+    def _DMv6_unlock(self, xorkey):
+        # key0 is entirely random
+        # key1-4 contain 3 random bytes and one xor key byte
+        # Note: the values of the random bytes seem to determine where the xor key byte is stored.
+        #       Once we determine how the random bytes affect the key byte location the below values
+        #       will be calculated randomly. For now hard-coding some values from a know response
+        #       should work.
+        # -Nathan
+
+        key0 = random.randint (0, 0xffffffffL)
+        key1 = (xorkey & 0x000000ffL) * 0x01010101L
+        key2 = ((xorkey & 0x0000ff00L) >>  8) * 0x01010101L
+        key3 = ((xorkey & 0x00ff0000L) >> 16) * 0x01010101L
+        key4 = ((xorkey & 0xff000000L) >> 24) * 0x01010101L
+
+        _req = self.protocolclass.ULReqv6(unlock_code=3, key0=key0, key1=key1, key2=key2, key3=key3, key4=key4)
+        _resp=self.sendbrewcommand(_req, self.protocolclass.ULResv6)
+
+        return _resp
+
     def enter_DM(self, e=None):
         # do nothing if the phone failed to previously enter DM
         if self._in_DM is False:
@@ -1632,10 +1644,7 @@
         if self._DMv5 is None:
             self.setDMversion()
         try:
-            if self._DMv6:
-                # new DM scheme
-                self._enter_DMv6()
-            elif self._DMv5:
+            if self._DMv5:
                 # enter DMv5
                 self._enter_DMv5()
             else:
@@ -1645,8 +1654,8 @@
         except:
             self.log('Failed to transition to DM')
             self._in_DM=False
-##            if __debug__:
-##                raise
+            if __debug__:
+                raise
             return
 
     def _OnTimer(self):
@@ -1671,13 +1680,11 @@
     def setDMversion(self):
         """Define the DM version required for this phone, default to DMv5"""
         self._DMv5=True
-        self._DMv6=False
 
     def __init__(self):
         self._in_DM=None
         self._timer=None
         self._DMv5=None
-        self._DMv6=None
         self._timeout=None
         if not hasattr(self, '_real_getfilecontents'):
             (self._real_getfilecontents,
Index: src/phones/com_lgvx9100.py
===================================================================
--- src/phones/com_lgvx9100.py	(revision 4621)
+++ src/phones/com_lgvx9100.py	(working copy)
@@ -59,8 +59,7 @@
         parentphone.__init__(self, logtarget, commport)
 
     def setDMversion(self):
-        self._DMv6=True
-        self._DMv5=False
+        self._DMv5=True
 
     # Fundamentals:
     #  - get_esn             - same as LG VX-8300
Index: src/phones/p_lg.p
===================================================================
--- src/phones/p_lg.p	(revision 4621)
+++ src/phones/p_lg.p	(working copy)
@@ -140,11 +140,11 @@
 
 PACKET ULReq:
     ""
-    1 UINT { 'default': 0xFE } +cmd
+    1 UINT { 'constant': 0xFE } +cmd
     1 UINT { 'default': 0x00 } +unlock_code
     4 UINT unlock_key
     1 UINT { 'default': 0x00 } +zero
-    
+
 PACKET ULRes:
     ""
     1 UINT cmd
@@ -152,58 +152,36 @@
     4 UINT unlock_key
     1 UINT unlock_ok
 
-PACKET DMKeyReq:
-    "Slightly different command for DMv6"
-    1 UINT { 'default': 0xFE } +cmd
-    1 UINT { 'default': 0x00 } +unlock_code
-    4 UINT { 'default': 0x00 } +unlock_key
-    1 UINT { 'default': 0x00 } +zero
-    1 UINT { 'default': 0x00 } +option
+PACKET ULReqv6:
+    ""
+    1 UINT { 'constant': 0xFE } +cmd
+    1 UINT { 'default': 0x03 } +unlock_code
+    4 UINT key0
+    2 UINT { 'default': 0x00 } +zero
+    4 UINT key1
+    4 UINT key2
+    4 UINT key3
+    4 UINT key4
 
-PACKET DMKeyResp:
-    "Return the key/seed needed to transition to DMv6"
+PACKET ULResv6:
+    ""
     1 UINT cmd
     1 UINT unlock_code
     4 UINT unlock_key
+    1 UINT unlock_ok
+    * DATA bytes
 
-PACKET DMEnterReq:
-    "Request to transition to DMv6"
-    1 UINT { 'default': 0xFE } +cmd
-    1 UINT { 'default': 0x00 } +unlock_code
-    4 UINT { 'default': 0x00 } +unlock_key
-    1 UINT { 'default': 0x00 } +zero
-    1 UINT { 'default': 0x00 } +option
-    if self.unlock_code==3:
-        * LIST { 'createdefault': True,
-                 'length': 16 } +unlock_key2:
-            1 UINT { 'default': 0 } +data
-    %{
+# it is unclear whether this command is meaningful
+PACKET DM6Unlock2:
+    1 UINT { 'default': 0xFB } +cmd
+    2 UINT { 'default': 0x06 } +data1
+    1 UINT { 'default': 0x02 } +data2
+   
+PACKET DM6Unlock2Resp:
+    1 UINT { 'default': 0xFB } +cmd
+    2 UINT { 'default': 0x06 } +data1
+    6 UINT { 'default': 0    } +data2
+    * DATA unk
 
-    def init_key2(self):
-        if self.unlock_code==3 and \
-           not len(self.unlock_key2):
-            for _idx in range(16):
-                self.unlock_key2.append(0)
-
-    def convert_to_key2(self):  
-        """Convert the key value to key2"""
-        if self.unlock_code!=3:
-            return
-        self.init_key2()
-        _buf=buffer()
-        UINT(sizeinbytes=4, value=self.unlock_key).writetobuffer(_buf)
-        _key=_buf.getvalue()
-        for _idx in range(4):
-            self.unlock_key2[_idx*4]=~ord(_key[_idx])
-
-    %}
-
-PACKET DMEnterResp:
-    "Response to our request to enter DMv6"
-    1 UINT cmd
-    1 UINT unlock_code
-    4 UINT unlock_key
-    1 UINT result "0=Failure, 1=Success"
-    
 PACKET data:
     * DATA bytes
dmv6_separate.diff (application/octet-stream, 3.6 KB)
Index: src/phones/p_lg.py
===================================================================
--- src/phones/p_lg.py	(revision 4621)
+++ src/phones/p_lg.py	(working copy)
@@ -2791,7 +2791,8 @@
         UINT(sizeinbytes=4, value=self.unlock_key).writetobuffer(_buf)
         _key=_buf.getvalue()
         for _idx in range(4):
-            self.unlock_key2[_idx*4]=~ord(_key[_idx])
+            for _idy in range(4);
+                self.unlock_key2[_idx*4 + _idy]=~ord(_key[_idx])
 
 
 
Index: src/phones/p_lgax8600.py
===================================================================
--- src/phones/p_lgax8600.py	(revision 4621)
+++ src/phones/p_lgax8600.py	(working copy)
@@ -2520,7 +2520,7 @@
 
 
 class textmemo(BaseProtogenClass):
-    __fields=['text', 'dunno', 'memotime']
+    __fields=['text', 'memotime']
 
     def __init__(self, *args, **kwargs):
         dict={}
@@ -2554,10 +2554,6 @@
         'Writes this packet to the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
         self.__field_text.writetobuffer(buf)
-        try: self.__field_dunno
-        except:
-            self.__field_dunno=UINT(**{'sizeinbytes': 4, 'default' : 0x1000000})
-        self.__field_dunno.writetobuffer(buf)
         self.__field_memotime.writetobuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologwrite(buf, logtitle=logtitle)
@@ -2567,10 +2563,8 @@
         'Reads this packet from the supplied buffer'
         self._bufferstartoffset=buf.getcurrentoffset()
         if autolog and self._bufferstartoffset==0: self.autologread(buf, logtitle=logtitle)
-        self.__field_text=USTRING(**{'sizeinbytes': 152, 'encoding': PHONE_ENCODING, 'raiseonunterminatedread': False, 'raiseontruncate': False })
+        self.__field_text=USTRING(**{'sizeinbytes': 151, 'encoding': PHONE_ENCODING, 'raiseonunterminatedread': False, 'raiseontruncate': False })
         self.__field_text.readfrombuffer(buf)
-        self.__field_dunno=UINT(**{'sizeinbytes': 4, 'default' : 0x1000000})
-        self.__field_dunno.readfrombuffer(buf)
         self.__field_memotime=LGCALDATE(**{'sizeinbytes': 4})
         self.__field_memotime.readfrombuffer(buf)
         self._bufferendoffset=buf.getcurrentoffset()
@@ -2583,17 +2577,9 @@
         if isinstance(value,USTRING):
             self.__field_text=value
         else:
-            self.__field_text=USTRING(value,**{'sizeinbytes': 152, 'encoding': PHONE_ENCODING, 'raiseonunterminatedread': False, 'raiseontruncate': False })
+            self.__field_text=USTRING(value,**{'sizeinbytes': 151, 'encoding': PHONE_ENCODING, 'raiseonunterminatedread': False, 'raiseontruncate': False })
 
     def __delfield_text(self): del self.__field_text
 
     text=property(__getfield_text, __setfield_text, __delfield_text, None)
 
-    def __getfield_dunno(self):
-        try: self.__field_dunno
-        except:
-            self.__field_dunno=UINT(**{'sizeinbytes': 4, 'default' : 0x1000000})
-        return self.__field_dunno.getvalue()
-
-    def __setfield_dunno(self, value):
-        if isinstance(value,UINT):
Index: src/phones/p_lg.p
===================================================================
--- src/phones/p_lg.p	(revision 4621)
+++ src/phones/p_lg.p	(working copy)
@@ -194,7 +194,8 @@
         UINT(sizeinbytes=4, value=self.unlock_key).writetobuffer(_buf)
         _key=_buf.getvalue()
         for _idx in range(4):
-            self.unlock_key2[_idx*4]=~ord(_key[_idx])
+            for _idy in range(4);
+                self.unlock_key2[_idx*4 + _idy]=~ord(_key[_idx])
 
     %}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.