GSM Shop GSM Shop
GSM-Forum  

Welcome to the GSM-Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features.
Only registered members may post questions, contact other members or search our database of over 8 million posts.

Registration is fast, simple and absolutely free so please - Click to REGISTER!

If you have any problems with the registration process or your account login, please contact contact us .

Go Back   GSM-Forum > Other Gsm/Mobile Related Forums > GSM Programming & Reverse Engineering


GSM Programming & Reverse Engineering Here you can post all Kind of GSM Programming and Reverse Engineering tools and Secrets.

Reply
 
LinkBack Thread Tools Display Modes
Old 09-28-2011, 20:41   #1 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Python Base


Python Related Stuff and pythonic solutions to gsm related problems.
  Reply With Quote
Old 09-28-2011, 21:24   #2 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Thanks in Advance for code of Huawei Modem Calculator Code in Python.
Quote:
Originally Posted by s400py View Post
Code:
import hashlib

def getCode(imei, salt):
        digest = hashlib.md5((imei+salt).lower()).digest()
        code = 0
        for i in range(0,4):
                code += (ord(digest[i])^ord(digest[4+i])^ord(digest[8+i])^ord(digest[12+i])) << (3-i)*8
        code &= 0x1ffffff
        code |= 0x2000000
        return code

imei = "123456789012347"

print getCode(imei, "5e8dd316726b0335")
print getCode(imei, "97B7BC6BE525AB44")
python
  Reply With Quote
Old 09-29-2011, 05:53   #3 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Thanks in Advance for code of Huawei Modem Calculator Code in Python.
Quote:
Originally Posted by s400py View Post
Code:
import hashlib

def getCode(imei, salt):
        digest = hashlib.md5((imei+salt).lower()).digest()
        code = 0
        for i in range(0,4):
                code += (ord(digest[i])^ord(digest[4+i])^ord(digest[8+i])^ord(digest[12+i])) << (3-i)*8
        code &= 0x1ffffff
        code |= 0x2000000
        return code

imei = "123456789012347"

print getCode(imei, "5e8dd316726b0335")
print getCode(imei, "97B7BC6BE525AB44")
python
  Reply With Quote
Old 09-12-2014, 21:58   #4 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Zte unlockcode calculator writen in python by me
Check it out

http://forum.gsmhosting.com/vbb/7929227-post206.html
  Reply With Quote
The Following User Says Thank You to mchizan For This Useful Post:
Old 09-15-2014, 22:36   #5 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Python Flash File Sorter (nokia files)

Problem
I download many flashfiles from nokia fire server from links shared here.Mostly i would download more than 10 different flash files and each comprises of 3 parts hence having to sort about 30 files.
This is pretty clumsy so i made a dirty script so that it can help in classifying the files and place them in respective folders.

Solution
.........coming soon......
  Reply With Quote
The Following User Says Thank You to mchizan For This Useful Post:
Old 09-17-2014, 22:33   #6 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Quote:
Originally Posted by mchizan View Post
Problem
I download many flashfiles from nokia fire server from links shared here.Mostly i would download more than 10 different flash files and each comprises of 3 parts hence having to sort about 30 files.
This is pretty clumsy so i made a dirty script so that it can help in classifying the files and place them in respective folders.

Solution
.........coming soon......
Step one completed, we can now identify all flashfiles downloaded with partern rmxxx and RM-xxx .
It involved using regular expressions to match the pattern, and create folders of the specific files.

........... Ideas are welcomed............
  Reply With Quote
The Following User Says Thank You to mchizan For This Useful Post:
Old 09-19-2014, 20:31   #7 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Okay i tried to combine the two regex for rm565 and RM-475 so i am making twin scripts, !pretty amature! they run by asking for the download folder, they scan and create unique folders.

How do i place the files into the folders??
I am reading about it, and as usual, help is appreciated.
  Reply With Quote
Old 09-21-2014, 12:26   #8 (permalink)
Freak Poster
 
Fatmox's Avatar
 
Join Date: Jan 2005
Posts: 328
Member: 111423
Status: Offline
Sonork: 100.1618414
Thanks Meter: 22
Quote:
Originally Posted by mchizan View Post
Step one completed, we can now identify all flashfiles downloaded with partern rmxxx and RM-xxx .
It involved using regular expressions to match the pattern, and create folders of the specific files.

........... Ideas are welcomed............
hi
Mate python is not a compiler is a interpreter ... so a better way is to made a script to convert all UPCASE letters in LOWCASE and rename, this way you create a script only to prepare your files .....
  Reply With Quote
The Following User Says Thank You to Fatmox For This Useful Post:
Old 09-21-2014, 12:30   #9 (permalink)
Freak Poster
 
Fatmox's Avatar
 
Join Date: Jan 2005
Posts: 328
Member: 111423
Status: Offline
Sonork: 100.1618414
Thanks Meter: 22
Quote:
Originally Posted by mchizan View Post
Okay i tried to combine the two regex for rm565 and RM-475 so i am making twin scripts, !pretty amature! they run by asking for the download folder, they scan and create unique folders.

How do i place the files into the folders??
I am reading about it, and as usual, help is appreciated.

I think this, that i m post will light you, this is not mine but will do, for you to understand how to do it ...

Another thing is search for python os.remove, os.copy, and so on ....


Quote:


This will go through the source directory, create any directories that do not already exist in destination directory, and move files from source to the destination directory:

import os
import shutil

root_src_dir = 'Src Directory\\'
root_dst_dir = 'Dst Directory\\'

for src_dir, dirs, files in os.walk(root_src_dir):
dst_dir = src_dir.replace(root_src_dir, root_dst_dir)
if not os.path.exists(dst_dir):
os.mkdir(dst_dir)
for file_ in files:
src_file = os.path.join(src_dir, file_)
dst_file = os.path.join(dst_dir, file_)
if os.path.exists(dst_file):
os.remove(dst_file)
shutil.move(src_file, dst_dir)

Any pre-existing files will be removed first (via os.remove) before being replace by corresponding source file. Any files or directories that already exist in the destination but not in the source will remain untouched.
  Reply With Quote
The Following User Says Thank You to Fatmox For This Useful Post:
Old 09-23-2014, 07:50   #10 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Thanks bro, I am going to implement it, in fact I should have realized it earlier lowercase could save me the pain for two scripts!
I am going to share out my script , and check the whole of it
  Reply With Quote
Old 11-25-2014, 22:04   #11 (permalink)
Freak Poster
 
mchizan's Avatar
 
Join Date: May 2007
Location: somewhere in space
Posts: 107
Member: 505345
Status: Offline
Thanks Meter: 11
Quote:
Originally Posted by Fatmox View Post
I think this, that i m post will light you, this is not mine but will do, for you to understand how to do it ...

Another thing is search for python os.remove, os.copy, and so on ....

okay,ill paste my code,then we see where we can fix it. Thanks, lowwercaps helped me get all files, i can make uniques folders like rm-xxx from the files in the maindirectory.

As i said,i cant place the files in the created directory.
i thought i could repeat the searching,identifying,then placing them
  Reply With Quote
Reply

Bookmarks


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upgrade info needed. Which phones still use the Nokia 5110/7110 base for my car kit muffking Off Topic Zone 0 03-17-2002 22:20
no flasher could read OT701 intel based flash majid Alcatel & TCL Old Models 12 03-14-2002 07:35
windows based NK PPM & MCU uploader and repairer reo Main Sales Section 2 11-09-2001 19:54
NEW windows based ppm&mcu PROGRAM !!! reo Nokia Legacy Phones ( DCT-1 ,2 ,3 ,L ) 13 11-09-2001 19:51
PLSS CAN SMB SHARE WITH ME DATA BASE OF SIEMENS X35 unlocking codes.... igor_m x1x to x45/x50 4 10-11-2000 19:22

 



All times are GMT +1. The time now is 00:49.



Powered by Searchlight © 2024 Axivo Inc.
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
- GSM Hosting Ltd. - 1999-2023 -
Page generated in 0.24154 seconds with 10 queries

SEO by vBSEO