2014-08-13, 16:14
Recompiled EBRtweak 1.0a
Attempts to fix flaw originally marked by VAMPIREFO, and discovered separately by myself tonight.
!!! As with anything, verify, verify, verify. Use at own risk, and verify your results. Do NOT blindly use programs without validating the claims first. !!!
Special thanks to NEXUSTRIX, BURS, AGISMANIAX, HOVATEK, and VAMPIREFO for their valued input!
---
This table was used as the basis for EBRtweak, which I believe is flawed.
NEXUSTRIX originally posted...
Size EBR1 EBR2 EBR2-2-1
0.5GB 10 28 D5
1.0GB 20 38 C5
1.5GB 30 48 B5
2.0GB 40 58 A5
2.5GB 50 68 95
3.0GB 60 78 85
3.5GB 70 88 75
4.0GB 80 98 65
4.5GB A8 90 55
5.0GB B8 A0 45
5.5GB 35 C8 B0
6.0GB C0 25 D8
As VAMPIREFO indicated, and I discovered doing manual calculations tonight... the values should be...
1.0GB 20
1.5GB 30
2.0GB 40
2.5GB 50
3.0GB 60
3.5GB 70
4.0GB 80
4.5GB 90
5.0GB A0
5.5GB B0
6.0GB C0
Furthermore, relating this back to NEXUSTRIX's table... I believe the values SHOULD BE...
Size EBR1 EBR2 EBR2-2-1
0.5GB 10 28 D5
1.0GB 20 38 C5
1.5GB 30 48 B5
2.0GB 40 58 A5
2.5GB 50 68 95
3.0GB 60 78 85
3.5GB 70 88 75
4.0GB 80 98 65
4.5GB 90 A8 55
5.0GB A0 B8 45
5.5GB B0 C8 35
6.0GB C0 D8 25
... note the obvious patterns, i.e., each column increases/decreases by one even base-16 level.
Using these links/documents as a guide (below) on how to calculate EBR1/2 manually (only to discover a small typographical error by the author when they were showing how to manually calculate new values). I used the author's top half example, and reverse engineered my phone's values with success.
[Snip]
N.B. Early in the document the author says that D = ( A + B ) - C (which appears correct when using original phone EBR1/2 to calculate). Later, the author performs a manual calculation for a new memory size, but uses a new equation, D = A + B + C, for unknown reason. I believe this is the mistake. Stick to the top half of the document/tutorial.
I applied, a) the first section of the tutorial by verifying with my own phone, b) applied the algorithm to set new values, i.e., 5-GB partition, and c) used the updated chart above with a recompiled version of the EBRtweak program (source included, Thank you BURS!!!).
I manually calculated my original phone memory, calculated what I wanted, then ran EBRtweak 1.0a (linked above) and they all match.
Hope this helps.
I will be pushing this change to my phone in next day or so, and will then attempt to fill the partitions as much as possible to see if I can corrupt or breach the partition boundaries in an attempt to validate these values actually work.
Here are my calculations, but you will need to reference the tutorial links above in order to understand the calculations.
--- Original manufacturer 2-GB partition with 32GB built in... MTK6589 phone
A = (0058 1A00) = 0x001A5800
B = (0000 4000) = 0x00400000 <- 2-GB partition
C = (00C4 0100) = 0x0001C400
Max = (FFFF FFFF) = 0xFFFFFFFF
D = (0094 5800) = 0x00589400
E = (FFA7 A5FF) = 0xFFA5A7FF
Calculate D,E for comparison
D = ( A + B ) - C = 0x001A5800 + 0x00400000 - 0x0001C400 = 0x00589400 (Match!)
E = Max Value - ( A + B ) = 0xFFFFFFFF - ( 0x001A5800 + 0x00400000 ) = 0xFFFFFFFF - 0x005A5800 = 0xFFA5A7FF (Match!)
--- 5-GB using EBRtweak v1.0 (calculated D doesn't match; wrong value applied to 5-GB option; original program based on NEXUSTRIX errors in table)
A = (0058 1A00) = 0x001A5800
B = (0000 B800) = 0x00B80000 (EBRtweak generated; this is NOT a 5-GB partition)
C = (00C4 0100) = 0x0001C400
Max = (FFFF FFFF) = 0xFFFFFFFF
D = (0094 A000) = 0x00A09400 (EBRtweak generated)
E = (FFA7 45FF) = 0xFF45A7FF (EBRtweak generated)
Calculate D,E for comparison
D = ( A + B ) - C = 0x001A5800 + 0x00B80000 - 0x0001C400 = 0x00D09400 (NO MATCH!)
E = Max Value - ( A + B ) = 0xFFFFFFFF - ( 0x001A5800 + 0x00B80000 ) = 0xFFFFFFFF - 0x00D25800 = 0xFF2DA7FF (NO MATCH!)
--- Calculated manually, want 5-GB partition
A = (0058 1A00) = 0x001A5800
B = (0000 A000) = 0x00A00000 <- 5-GB
C = (00C4 0100) = 0x0001C400
Max = (FFFF FFFF) = 0xFFFFFFFF
D = A + B - C = 0x001A5800 + 0x00A00000 - 0x0001C400 = 0x00B89400
E = Max Value - ( A + B ) = 0xFFFFFFFF - ( 0x001A5800 + 0x00A00000 ) = 0xFFFFFFFF - 0x00BA5800 = 0xFF45A7FF
--- Recompiled to EBRtweak 1.0a, selected 5-GB
New EBR1/2 files match manual calculations from tutorial. Hmmm...
-grittyKitty
Attempts to fix flaw originally marked by VAMPIREFO, and discovered separately by myself tonight.
!!! As with anything, verify, verify, verify. Use at own risk, and verify your results. Do NOT blindly use programs without validating the claims first. !!!
Special thanks to NEXUSTRIX, BURS, AGISMANIAX, HOVATEK, and VAMPIREFO for their valued input!
---
This table was used as the basis for EBRtweak, which I believe is flawed.
NEXUSTRIX originally posted...
Size EBR1 EBR2 EBR2-2-1
0.5GB 10 28 D5
1.0GB 20 38 C5
1.5GB 30 48 B5
2.0GB 40 58 A5
2.5GB 50 68 95
3.0GB 60 78 85
3.5GB 70 88 75
4.0GB 80 98 65
4.5GB A8 90 55
5.0GB B8 A0 45
5.5GB 35 C8 B0
6.0GB C0 25 D8
As VAMPIREFO indicated, and I discovered doing manual calculations tonight... the values should be...
1.0GB 20
1.5GB 30
2.0GB 40
2.5GB 50
3.0GB 60
3.5GB 70
4.0GB 80
4.5GB 90
5.0GB A0
5.5GB B0
6.0GB C0
Furthermore, relating this back to NEXUSTRIX's table... I believe the values SHOULD BE...
Size EBR1 EBR2 EBR2-2-1
0.5GB 10 28 D5
1.0GB 20 38 C5
1.5GB 30 48 B5
2.0GB 40 58 A5
2.5GB 50 68 95
3.0GB 60 78 85
3.5GB 70 88 75
4.0GB 80 98 65
4.5GB 90 A8 55
5.0GB A0 B8 45
5.5GB B0 C8 35
6.0GB C0 D8 25
... note the obvious patterns, i.e., each column increases/decreases by one even base-16 level.
Using these links/documents as a guide (below) on how to calculate EBR1/2 manually (only to discover a small typographical error by the author when they were showing how to manually calculate new values). I used the author's top half example, and reverse engineered my phone's values with success.
[Snip]
N.B. Early in the document the author says that D = ( A + B ) - C (which appears correct when using original phone EBR1/2 to calculate). Later, the author performs a manual calculation for a new memory size, but uses a new equation, D = A + B + C, for unknown reason. I believe this is the mistake. Stick to the top half of the document/tutorial.
I applied, a) the first section of the tutorial by verifying with my own phone, b) applied the algorithm to set new values, i.e., 5-GB partition, and c) used the updated chart above with a recompiled version of the EBRtweak program (source included, Thank you BURS!!!).
I manually calculated my original phone memory, calculated what I wanted, then ran EBRtweak 1.0a (linked above) and they all match.
Hope this helps.
I will be pushing this change to my phone in next day or so, and will then attempt to fill the partitions as much as possible to see if I can corrupt or breach the partition boundaries in an attempt to validate these values actually work.
Here are my calculations, but you will need to reference the tutorial links above in order to understand the calculations.
--- Original manufacturer 2-GB partition with 32GB built in... MTK6589 phone
A = (0058 1A00) = 0x001A5800
B = (0000 4000) = 0x00400000 <- 2-GB partition
C = (00C4 0100) = 0x0001C400
Max = (FFFF FFFF) = 0xFFFFFFFF
D = (0094 5800) = 0x00589400
E = (FFA7 A5FF) = 0xFFA5A7FF
Calculate D,E for comparison
D = ( A + B ) - C = 0x001A5800 + 0x00400000 - 0x0001C400 = 0x00589400 (Match!)
E = Max Value - ( A + B ) = 0xFFFFFFFF - ( 0x001A5800 + 0x00400000 ) = 0xFFFFFFFF - 0x005A5800 = 0xFFA5A7FF (Match!)
--- 5-GB using EBRtweak v1.0 (calculated D doesn't match; wrong value applied to 5-GB option; original program based on NEXUSTRIX errors in table)
A = (0058 1A00) = 0x001A5800
B = (0000 B800) = 0x00B80000 (EBRtweak generated; this is NOT a 5-GB partition)
C = (00C4 0100) = 0x0001C400
Max = (FFFF FFFF) = 0xFFFFFFFF
D = (0094 A000) = 0x00A09400 (EBRtweak generated)
E = (FFA7 45FF) = 0xFF45A7FF (EBRtweak generated)
Calculate D,E for comparison
D = ( A + B ) - C = 0x001A5800 + 0x00B80000 - 0x0001C400 = 0x00D09400 (NO MATCH!)
E = Max Value - ( A + B ) = 0xFFFFFFFF - ( 0x001A5800 + 0x00B80000 ) = 0xFFFFFFFF - 0x00D25800 = 0xFF2DA7FF (NO MATCH!)
--- Calculated manually, want 5-GB partition
A = (0058 1A00) = 0x001A5800
B = (0000 A000) = 0x00A00000 <- 5-GB
C = (00C4 0100) = 0x0001C400
Max = (FFFF FFFF) = 0xFFFFFFFF
D = A + B - C = 0x001A5800 + 0x00A00000 - 0x0001C400 = 0x00B89400
E = Max Value - ( A + B ) = 0xFFFFFFFF - ( 0x001A5800 + 0x00A00000 ) = 0xFFFFFFFF - 0x00BA5800 = 0xFF45A7FF
--- Recompiled to EBRtweak 1.0a, selected 5-GB
New EBR1/2 files match manual calculations from tutorial. Hmmm...
-grittyKitty