Subversion Repositories freemyipod

Rev

Rev 811 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 811 Rev 816
Line 282... Line 282...
282
            return thread
282
            return thread
283
    from libemcoredata import scheduler_thread
283
    from libemcoredata import scheduler_thread
284
    thread = scheduler_thread()._to_bunch()
284
    thread = scheduler_thread()._to_bunch()
285
    thread.name = "[Invalid Thread 0x%08X]" % address
285
    thread.name = "[Invalid Thread 0x%08X]" % address
286
    return thread
286
    return thread
-
 
287
    
-
 
288
    
-
 
289
def string_from_image(data, base, ptr, maxlen):
-
 
290
  if ptr == 0: name = "<NULL>"
-
 
291
  try:
-
 
292
    string = ""
-
 
293
    end = data.find(b"\0", ptr - base, ptr - base + maxlen)
-
 
294
    if end < 0: return "<BAD_STRING>"
-
 
295
    else:
-
 
296
      d = data[ptr - base : end]
-
 
297
      for i in range(len(d)):
-
 
298
        byte = ord(d[i : i + 1])
-
 
299
        if byte < 0x20: return "<BAD_STRING>"
-
 
300
        else: string = string + chr(byte)
-
 
301
  except: return "<BAD_PTR>"
-
 
302
  return string
287
 
303
 
288
 
304
 
289
def gethwname(id):
305
def gethwname(id):
290
    try:
306
    try:
291
        from libemcoredata import hwtypes
307
        from libemcoredata import hwtypes
Line 443... Line 459...
443
def majorver():
459
def majorver():
444
    """
460
    """
445
        Returns the major version of python
461
        Returns the major version of python
446
    """
462
    """
447
    import sys
463
    import sys
448
    return sys.hexversion // 0x1000000
-
 
449
464
    return sys.hexversion // 0x1000000
-
 
465
    
-
 
466
450
467