اخلاء مسؤولية | DISCLAIMER
بسم الله الرحمن الرحيم
السلام عليكم ..
تاتي الكثير من الاستفسارات عن مشكلة جديدة ظهرت للفنيين بعد تبديل الذواكر وبالاخص الاجهزة الحديثة منها من فئة A مثلا او بعض الاجهزة الحديثة من فئة G والقائمة في ازدياد
وبقي الامر مجهولا وحل المشكلة غير معروف حتى اللحظة
وسنقوم بتفصيل كل ما سبق على عدة اجزاء نطرح من خلالها المسبب والحلول والتجارب بالتفصيل :
وفي هذا #المقال ان شاء الله سنقوم بطرح سبب المشكلة وبشكل علمي وموسع مبني على ابحاث خاصة بالفريق ..
والشرح خاص وحصري من فريق HALABTECH JTAG TEAM
#الجزء الاول
RPMB
سؤال: ما هو المسبب للمشكلة الحالية واين يكمن السر؟
جواب: لجأت الشركات في الاونة الاخيرة واهمها SAMSUNG لاستخدام القطاع المبهم من قطاعات الذاكرة وهو قطاع (RPMB) والمعروف لدى اغلب الفنيين العاملين في مجال الذواكر وبرمجتها انه قطاع خامل لا يأثر على اقلاع الجهاز وكان الفني سابقا يقوم بكتابة دامب واختيار ذاكرة متوافقة والعمليات الاخرى اللاحقة فيعمل الجهاز بكفاءة ولكن اليوم الموضوع اختلف في الاجهزة الحديثة ذات حمايات RMM وسنتطرق بالتفصيل للشرح عن هذا الموضوع
اولا: ما هو قطاع RPMB وما المقصود بهذا الاختصار
تحتوي ذواكر EMMC – UFS على قطاع خاص محمي من الوصول او التعديل عليه يدعى RPMB وهو اختصار لعبارة
(Replay Protect Memory Block)
وكما قلنا سابقا ان هذا القطاع يكون موجود في نوعي الذواكر
1- EMMC قطاع RPMB
2- UFS قطاع ID: W-LUN 0xC4
ثانيا : لماذا تم انشاء هذا القطاع ؟
شرحنا في مقالات سابقة ان ذواكر EMMC تحوي على عدة قطاعات رئيسية هي
USER DATA
ROM2
ROM3
RPMB
ونلاحظ ان معظم المعالجات تستخدم القطاعين USER DATA – ROM2 للاقلاع حسب نوع المعالج
ونلاحظ ايضا ان باقي ملفات النظام من النظام ذاته او ملفات المستخدم او معلومات المودم والمتواجدة في EFS ومعلومات شركات الاتصالات في حال كانت الاجهزة مقفلة الخ……. يتم تنزيلها على قطاع USER DATA وهو قطاع قابل للتعديل والكتابة والتعديل عليه من قبل الفنيين
لهذا قامت الشركة باستخدام القطاع المبهم RPMB في الاجهزة الحديثة ووضع قيم تشفير خاصة عليه لانه محمي من التعديل والكتابة ولا يمكن لاي بوكس مختص في مجال برمجة الذواكر (JTAG) من المساس به في الوقت الحالي وسنقوم بشرح الية الاقلاع الكاملة لاستخدام هذا القطاع من قبل المعالج
فيما يلي مخطط لطريقة اقلاع الاجهزة الحديثة لفهم الية عملها واذا عرف السبب بطل العجب
1- يقوم (HOST )او المضيف بقرائة مفتاح العداد (COUNTER VALUE) الموجود في RPMB (سنقوم بتحديده بالصور المرفقة) لكي ينشأ MAC او TOKEN باستخدام خوارزمية SHA-256
2- يقوم (HOST) او المضيف بارسال MAC المستخرج من العملية الاولى الى المتحكم الخاص بالذاكرة (EMMC CONTROLLER)
3-يقوم المتحكم الخاص بالذاكرة (EMMC CONTROLLER) بقراءة المفتاح الذي تم تحميله مسبقا من قبل المضيف (HOST) وقيمة العداد (COUNTER VALUE)
4- تتم مقارنة MAC المستخرجة من قبل المضيف (HOST) والموجودة على متحكم الذاكرة (EMMC CONTROLLER) واذا كانت المفاتيح مطابقة يتم السماح بالوصول الى قطاع RPMB
مثال في حال عدم تطابق MAC ظهور رسالة الخطء
RPMB PROVISIONED, But HMAC Mismatch
الان بعد معرفتنا بألية عمل اقلاع المضيف والمتحكم بالذاكرة (HOST- EMMC CONTROLLER)
صار بالامكان ان نعرف السبب الرئيسي لتشفير الاجهزة بعد تبديل الذواكر ونخرج بالخلاصة التالية
1-إذا كان المفتاح KEY غير موجود على الذاكرة EMMC اذا في هذه الحال يكون العداد قيمته 0 (COUNTER VALUE) هنا يقوم الجهاز (المعالج) يبرمجة المفتاح في هذه الذاكرة EMMC حيث يتم إنشاء المفتاح من المعالج عن طريق عملية استخراج بواسطة السيريال SN و EMMC CID وبالتالي فان الجهاز في هذه الحالة سوف يعمل بكفاءة باعتبار تمت برمجة المفتاح لاول مرة من قبل المعالج وعلى الذاكرة وهذه العملية حصرا تتم في الذواكر الجديدة او النظيفة من اي برمجة سابقة على قطاع RPMB وتدعى هذه الذواكر CLEAN
2- إذا كان المفتاح KEY مبرمج مسبقا اذا في هذه الحال يكون العداد قيمته فوق 0 (COUNTER VALUE) هنا يقوم الجهاز (المعالج) بمحاولة برمجة المفتاح في هذه الذاكرة EMMC وعندما يكتشف المعالج وجود مفتاح مبرمج مسبقا في هذه الحال يقوم باحباط عملية البرمجة ويقوم بتفعيل حماية RMM ويقلع الجهاز في وضع التشفير وتدعى هذه الذواكر NOT CLEAN
وفي بعض الحاللات يكون العداد 0 ولكن النتيجة كالتالي والسبب عدم استطاعة البوكس في تحديد الحالة الصحيحة لل RPMB Maybe not clean
======================================================================
ALSALAM ALIKUM
HI
Many inquiries come about a new problem that has emerged for technicians
after the replacement of memory especially modern devices,
including the category A, for example,
or some modern devices from the category G, and the list is increasing
The matter remains unknown and the problem has not been known yet
We will detail all of the above in several parts and discuss the problem and solutions
And experiments in detail:
In this post, INSHALLAH, we will present the cause of the problem publicly and broadly, based on team research
explanation is exclusive from HALABTECH JTAG TEAM team
Part One:
RPMB
Question: What is causing the current problem and where is the secret?
Answer: Recently,The companies espicially Samsung resorted to using The vague sector of the memory sectors (RPMB) It is known to most technicians working in the field of E and its programming that it is an inactive sector that does not affect the work of the device
The technician previously wrote DUMP to choose an appropriate and other subsequent process, and the device will working efficiently, But today the topic has differed in modern devices with RMM protection and we will discuss in detail to explain this topic
First: What is the RPMB sector and what is the abbreviation?
EMMC – UFS memories have a private sector protected from access or modification called RPMB which is an abbreviation of the phrase
It means (Replay Protect Memory Block)
As we said already , this sector is Existing in both types of memory
1- EMMC is called RPMB
2- UFS it’s called ID: W-LUN 0xC4
Second: Why was this sector established?
As we all know, EMMC memories contain several main sectors
User data
ROM2
ROM3
RPMB
We note that most processors use the USER DATA – ROM2 sectors to boot according to the processor type
We also note that the rest of the system files are from the same system or user files or modem information found in EFS and telecom companies information in case the devices are locked etc. They are downloaded to the USER DATA sector, which is an sector that can be modified, written and modified by technicians
For this reason the company has used the vague sector RPMB in modern devices and put special Encrypt values on it because it is protected from modification and writing, It is not possible for any box specialized in the field of memory programming (JTAG) to be affected by it at the present time and we will explain the complete boot mechanism for the use of this sector by the processor.
Below is a diagram of how modern devices operate to understand how it work
1- The host is reading the counter key located in the RPMB (we will define it with pictures) in order for the MAC or TOKEN to be created using the SHA-256 algorithm.
2- The host sends the MAC extracted from the first operation to the memory controller
3- The memory controller reads the key previously loaded by the host and the counter value
4- The MAC extracted by the host on the memory controller is compared and if the keys are identical, access to the RPMB sector is allowed.
Now that we know the mechanism of the host and the memory controller boot, it is now possible to know the main reason for encrypting devices after replace the memories and come up with the following summary
1-If the key does not exist on EMMC memory then in this case the counter has a value of 0 here the device (processor) programmed the key in this memory EMMC where the key is generated from the processor by the process of extraction by Serial SN and EMMC CID Thus, the device in this case will work efficiently, as the key was first programmed by the processor and on memory, and this process is exclusively done in new or clean memories from any previous programming on the RPMB sector and these memories are called CLEAN
2- If the key is pre-programmed then in this case the counter has a value of above 0 here the device (the processor) attempts to program the key in this memory EMMC and when the processor detects the presence of a pre-programmed key in this case it frustrates the programming process and activates RMM protection and the device boot up in Encryption mode is called NOT CLEAN
Best regard from the Halab Tech team
ارجو ان يكون الشرح قد نال اعجابكم
الى اللقاء مع الجزء الثاني
بارك الله فيك على هذا الاثراء الرائع والمعلومة القيمة .