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-10-2017, 00:35   #1 (permalink)
Insane Poster
 
Join Date: Jan 2017
Posts: 64
Member: 2674769
Status: Offline
Thanks Meter: 9
ESN from MEID HASH SHA` proplem!


need to calculate hash for meid to get esn hex Delphi code

put thare is proplem

I test the unit with abc it worked ok like this

Password := 'abc';
Digest := CalcSHA1 (Password [1], Length (Password));
Str := SHA1DigestToHex (Digest);
msg(str,clred);


the hash is
a9993e364706816aba3e25717850c26c9cd0d89d ok no proplem


but for example I put this meid = A10000009296F2

Password := 'A10000009296F2';
Digest := CalcSHA1 (Password [1], Length (Password));
Str := SHA1DigestToHex (Digest);
msg(str,clred);


the hash calculated is
4cf522d69e6334472377eed5959dbfaa422005dc it is wrong

need good calculator for Delphi please







  Reply With Quote
Old 09-10-2017, 12:45   #2 (permalink)
Product Manager
 
Join Date: Jan 2004
Location: Unknown
Age: 32
Posts: 7,633
Member: 49752
Status: Offline
Sonork: 100.112446
Thanks Meter: 5,236
@doctorsu
In programming before running start walking first.
Basic thing is first to learn is what data is .. ascii or binary.
ascii A10000009296F2 = 4131303030303030393239364632
binary A10000009296F2 = A10000009296F2
sha1 of binary is 2D0E6EFEA8F8082C9703CF6636C4A2195C75B7ED

8075B7ED is your esn.
  Reply With Quote
The Following 2 Users Say Thank You to stanner_austin For This Useful Post:
Old 09-11-2017, 01:20   #3 (permalink)
Insane Poster
 
Join Date: Jan 2017
Posts: 64
Member: 2674769
Status: Offline
Thanks Meter: 9
can you explain more how did you get the sha1 of binary

2D0E6EFEA8F8082C9703CF6636C4A2195C75B7ED

I have exe console for this but I wont to write in Delphi
  Reply With Quote
Old 09-11-2017, 19:25   #4 (permalink)
Moderator
 
Nishith's Avatar
 
Join Date: May 2012
Location: BHARAT
Posts: 1,521
Member: 1766148
Status: Offline
Sonork: 100.1614494
Thanks Meter: 442
Quote:
Originally Posted by doctorsu View Post
can you explain more how did you get the sha1 of binary

2D0E6EFEA8F8082C9703CF6636C4A2195C75B7ED

I have exe console for this but I wont to write in Delphi
This might be helpful: SHA-1 Calculator
  Reply With Quote
The Following User Says Thank You to Nishith For This Useful Post:
Old 09-22-2017, 23:17   #5 (permalink)
Insane Poster
 
Join Date: Jan 2017
Posts: 64
Member: 2674769
Status: Offline
Thanks Meter: 9
hiiiiiiiiiiiiiiiii

Quote:
Originally Posted by Ni****h View Post
This might be helpful: SHA-1 Calculator
solved python


import hashlib

Code:
meid = raw_input("").upper()

s = hashlib.sha1(meid.decode('hex'))
    #decode the hex MEID (convert it to binary!)

pesn = "80" + s.hexdigest()[-6:].upper()
    #put the last 6 digits of the hash after 80

print " " + pesn
  Reply With Quote
Old 10-02-2017, 23:55   #6 (permalink)
Insane Poster
 
Join Date: Jan 2017
Posts: 64
Member: 2674769
Status: Offline
Thanks Meter: 9
Quote:
Originally Posted by Ni****h View Post
This might be helpful: SHA-1 Calculator

this good and working but what type of calculator is this

is thare similer for Delphi
  Reply With Quote
Old 10-03-2017, 02:20   #7 (permalink)
Insane Poster
 
Join Date: Jan 2017
Posts: 64
Member: 2674769
Status: Offline
Thanks Meter: 9
done in Delphi finally

HexStr := 'A10000009296F2';
BinaryStream := TMemoryStream.Create;
try
BinaryStream.Size := Length(HexStr) div 2;
if BinaryStream.Size > 0 then
begin
HexToBin(PAnsiChar(HexStr), BinaryStream.Memory, BinaryStream.Size);
// read into the buffer
j2 := BinaryStream.Read(buffer,Sizeof(buffer));
x := TDCP_sha1.Create(nil);
x.Init;
x.Update(buffer,j2);
SetLength(HashDigest, x.GetHashSize div 8);
x.Final(HashDigest[0]);
for j := 0 to Length(HashDigest) - 1 do // convert it into a hex string
s := s + IntToHex(HashDigest[j],2);
end;
finally
x.Free;
BinaryStream.Free;
end;
trim(s);
msg(s,clyellow);



this is outut tmemo1

2D0E6EFEA8F8082C9703CF6636C4A2195C75B7ED


thanks

stanner_austin
Ni****h
  Reply With Quote
The Following User Says Thank You to doctorsu For This Useful Post:
Reply

Bookmarks

Thread Tools
Display Modes

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


 



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



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

SEO by vBSEO