Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
20 May, 2013, 18:41:11 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1] 2 3 4   Go Down
  Print  
Author Topic: Hacking into the .g3p/b format [HALTED] -  (Read 3603 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« on: 03 March, 2012, 20:12:08 »
+1

All hacking has been stopped because of recent concerns expressed by the community.

KermMartian writes:

Quote
I am one of the Prizm hackers who had been expressing concerns on #cemetech. I've been in various contact with Casio marketing and engineering personnel over the past year or so, and they have made it clear that they're currently turning a blind eye to mature, responsible third-party hacking. Officially, they're supposed to both not support it and potentially disallow it, but that hinges on how we behave. [...]

We do not want to drive Casio into the same cat-and-mouse game the Nspire developers have to work around.



General header format:


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
AAACBDAF90889A8D _xFF_yFF_yFF..FE
_a_a_a_a.._b_c_c 00000000_._._d_d

_x : file type
- .g3a=0xD3; .g3e=0xB6; .g3p/b=0x82; .g3m=0x8A

_y : unknown
- if (.g3a) then 0xFE else 0xEF

.. : check bytes
- upper=LSB_of_a+0xBF
- lower=LSB_of_a+0x48

_. : CP check bytes
- rightmost=if (Casio Provided) then LSB_of_a+0x85 else LSB_of_a+0x17
- leftmost=(checksum of LSW_of_a) + ...
-- if (Casio Provided) then (.g3p/b=0x9B; .g3e=0xCF) ...
-- else (.g3p/b=0x09; .g3e=0x3D; .g3m=0x11)

_a : inverted file size

_b : unknown
- if (.g3m) then 0x01 else 0x00
- could be related to _d

_c : unknown
- if (!.g3a) then 0x0000
- seems to be unrelated to _a

_d : inverted element count
- if (!.g3m) then 0x0000

The .G3P format:

A 32-bit ckecksum seems to be stored at the end of the image data block (starts at 0xD0), but before any footer. The procedure to calculate this checksum is not known. Without disassembling the Prizm's CAPTURE routine, further analysis appears to be a waste of time.

References to zlib inside the OS imply they are using this for data compression. Also, it is not known if the type ID at _o (see below) is required for the decompression part.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
AAACBDAF90889A8D 82FFEFFFEFFF..FE
_a_a_a_a..000000 00000000_._.0000
4350_b_b_b_b_c_c _c_c_c0000000000
_d_d_d_d0000_e_e _f_f_f_f00000000
00000000000000_g 0000000000000000
0000000000000000 00000000000000_h
00000000000000_i 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 _b_b_b_b_j_j_j_j
??_k_l_l_m_m???? ????????_n_n_n_n
_o_o???????????? ????????????????

Main header:
.. : check bytes (see 'General header format')
_. : CP check bytes (see 'General header format')
_a : inverted file size

Sub header:
_b : if "CP" then 0x00010000 else 0x30313030
_c : if "CP" then 0x00 else 0x4C79373535
_d : file_size - 0x20
_e : if "CP" then (0x0001 or 0x0009) else (0x0A09 or 0x0009)
_f : file_size - (0xB8 + _g + _i + _h)
_g : if _e=0x0001 then 0x00 else 0x8C // length footer 1
_h : if _e=0x0A09 then 0x2C else 0x00 // length footer 3
_i : if _e=0x0A09 then 0x?? else 0x00 // length footer 2
_j : file_size - (0xCC + _g + _i + _h)
_k : if CAPTURE then 0x01 else 0x00
_l : image_width
_m : image_heigth
_n : file_size - (0xD0 + _g + _i + _h)
_o : type ID (see 'Sub formats' below)

Sub formats:

"CP" format with _e=0x0001 and _g=0x00
- no footer; Casio Provided (ID: 0x3C1B)

"CP" format with _e=0x0009 and _g=0x8C
- one footer; Casio Provided (ID: 0x3C1B)

"CP0100" format with _e=0x0001 and _g=0x00
- no footer; CAPTURE Format (ID: 0x388D)

"CP0100" format with _e=0x0009 and _g=0x8C
- one footer; Converter Format (ID: 0x789C)

"CP0100" format with _e=0x0A09 and _g=0x8C; _i=0x??; _h=0x2C
- three footers; Casio Provided (ID: 0x3E93)

The .G3B format:

A 32-bit ckecksum should be stored at the end of the image data block (starts at 0xD0), but before any footer.


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
AAACBDAF90889A8D 82FFEFFFEFFF..FE
_a_a_a_a..000000 00000000_._.0000
4350_b_b_b_b_c_c _c_c_c0000000000
_d_d_d_d0000_e_e 00000000_f_f_f_f
0000000000000000 0000008C00000000
000000000000002C 0000000000000000
000000_z00000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 0000000000000000
0000000000000000 _b_b_b_b_j_j_j_j
_l_l_m_m???????? ????????_n_n_n_n
_o_o???????????? ????????????????

Main header:
.. : check bytes (see 'General header format')
_. : CP check bytes (see 'General header format')
_a : inverted file size

Sub header:
_b : if "CP" then 0x00010000 else 0x30313030
_c : if "CP" then 0x00 else 0x4C79373535
_d : file_size - 0x20
_e : if "CP" then 0x0492 else 0x0092
_f : file_size - (0xB8 + 0x8C + _z + 0x2C)
_z : if "CP" then 0x10 else 0x00 // length footer 2
_j : file_size - (0xCC + 0x8C + _z + 0x2C)
_l : image_width
_m : image_heigth
_n : unknown length
_o : type ID (see 'Sub formats' below)

Sub formats:

"CP" format with _e=0x0492 and _z=0x10
- three footers; Casio Provided (ID: 0x3C1B)

"CP0100" format with _e=0x0092 and _z=0x00
- two footers; Casio Provided (ID: 0x3C1B)
- two footers; Converter Format (ID: 0x789C)
« Last Edit: 09 April, 2012, 02:24:14 by cfxm » Logged
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: Yesterday at 00:12:41
Date Registered: 18 April, 2011, 18:01:37
Posts: 192


Total Post Ratings: +7

View Profile
« Reply #1 on: 03 March, 2012, 20:13:46 »
0

Why does Casio have two formats? Do they serve different purposes?
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #2 on: 03 March, 2012, 20:24:37 »
0

The "CP" format seems to be older. All later tools and files use "CP0100". I did not focus on what is stored inside these footers. If it contains extra security against modifications, then we can just modify the _e flag to ignore this (at least for .g3p files).
« Last Edit: 03 March, 2012, 20:25:42 by cfxm » Logged
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: Yesterday at 00:12:41
Date Registered: 18 April, 2011, 18:01:37
Posts: 192


Total Post Ratings: +7

View Profile
« Reply #3 on: 03 March, 2012, 20:38:46 »
0

I meant, what's the difference between .g3b and g3p files?
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #4 on: 03 March, 2012, 20:47:00 »
0

I meant, what's the difference between .g3b and g3p files?

Sorry, I did not expect such a basic question. Wink

.g3p is the Prizm's image format
.g3b is the Prizm's animation format
The latter is only used along with the Picture Plot add-in.
Logged
sammyMaX
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: Yesterday at 00:12:41
Date Registered: 18 April, 2011, 18:01:37
Posts: 192


Total Post Ratings: +7

View Profile
« Reply #5 on: 03 March, 2012, 21:01:09 »
0

Cool, thanks for the info Smiley
Logged


Are you wondering who Sammy is? My avatar is Sammy.
   
bynary_man
LV2 Member (Next: 40)
**
Offline Offline

Last Login: 12 December, 2012, 22:07:14
Date Registered: 19 February, 2011, 20:19:39
Posts: 24

Total Post Ratings: +1

View Profile
« Reply #6 on: 06 March, 2012, 18:54:01 »
0

This is very interesting Smiley
Logged
krazylegodrummer56
LV2 Member (Next: 40)
**
Offline Offline

Gender: Male
Last Login: Yesterday at 16:30:51
Date Registered: 29 February, 2012, 22:45:18
Location: Sometime Somewhere
Posts: 25


Total Post Ratings: -3

View Profile
« Reply #7 on: 07 March, 2012, 00:06:19 »
0

And how does this help?

Will you now be able to put modified pics onto the prizm?
Logged

I have a Casio Prizm now! YAY!!! Cheesy








fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #8 on: 07 March, 2012, 11:24:21 »
0

Quote
And how does this help?

Will you now be able to put modified pics onto the prizm?

The missing part is the checksum calculation. When we know it, we can (hopefully) create Casio provided images. Wink
Logged
calc84maniac
Epic z80 roflpwner
Coder Of Tomorrow
LV11 Super Veteran (Next: 3000)
*
Offline Offline

Gender: Male
Last Login: 14 May, 2013, 10:02:35
Date Registered: 28 August, 2008, 05:09:05
Location: Right behind you.
Posts: 2735


Total Post Ratings: +373

View Profile
« Reply #9 on: 07 March, 2012, 12:58:42 »
0

Won't that completely nullify the point of them making the CG-10?
Logged

"Most people ask, 'What does a thing do?' Hackers ask, 'What can I make it do?'" - Pablos Holman
Jonius7
aka jhgenius
LV10 31337 u53r (Next: 2000)
**********
Offline Offline

Gender: Male
Last Login: Today at 06:58:52
Date Registered: 03 September, 2010, 02:50:11
Location: Gold Coast, Australia
Posts: 1743


Total Post Ratings: +50

View Profile WWW
« Reply #10 on: 07 March, 2012, 14:25:48 »
0

So this will allow us to change the Prizm Startup screen and system screens?
That sounds really cool, we could completely change what it says, or 'rearrange' pixels for efficiency.
Logged



Userbars.com is down?
+9001
Intermediate TI-nspire Basic Programmer
Programmed some CASIO Basic in the past
DJ_O Music Discographist Wink
Userbars for these coming... in the process

My Released and Announced Projects (Updated 2013/01/29)
TI-nspire BASIC
TI-nspire Hold 'em | Health Bar | Scissors Paper Rock | Battle of 16s (stalled) | sTIck RPG (stalled) | Monopoly (stalled)

TI-nspire Lua
Numstrat | TI-nspire Hold 'em Lua | Terraria (coming soon)
Axe Parser
Doodle God (stalled while I go and learn some Axe)

Spoiler for Other Stuff:
Spoiler for Want your own HonestDownloads userbar?:
Hello! Do you want to show your affection for my website, HonestDownloads? Then here is a userbar I specially created earlier just for HonestDownloads users!

To add it to your signature just copy and paste the code below into your sig and you'll become an instant supporter of my website!

1
[URL=http://www.jhgenius01.webs.com][IMG]http://s1.bild.me/bilder/060112/3684792HDuserbaruser.png[/IMG][/URL]
Spoiler for My TI-nspire Basic Programs (Updated 2012/04/15):
***List of Programs in the TI-nspire Stadium***
Group Release 2012/04/07 on omnimaga.org

Games
   Noteable Release    ticalc.org Release Development/Not Publicly Released
2010/05/08 TI-nspire Hold 'em
   2012/04/07 v1.1.2   2012/04/10 v1.1.3  2012/04/14 v1.2.1
2010/08/03 Cosmic Legions
   2012/04/07 v0.2.2.2 (1st Release)
2010/08/12 Battle of 16s
   2012/04/07 v0.2.7
2010/09/10 Health Bar
   2012/04/07 v1.2     2012/04/02 v1.0   
2010/12/04 sTIck RPG
   2012/04/07 v0.1.5.2
2011/01/09 Monopoly
   2012/04/07 v0.16    (1st Release)
2012/04/09 Scissors Paper Rock
   2012/04/14 v0.8.1

Miscellaneous
2010/11/07 中文 (Chinese) Demonstration
   2012/04/07 v1.3     (1st Release)

Potential/Minor Programs
2010/09/26 Shanghai Metro
   2012/04/07 v0.2     (1st Release)
2010/12/22 TI-nspire Programming Tutorials
   2012/04/07 v0.1     (1st Release)
2010/12/28 Casino Games
   Was not released.
2011/04/22 Interlink
   2012/04/07 v0.0.4   (1st Release)
2012/03/22 Hierarchy
   2012/04/07 v0.01

Demo Programs (some may become Potential Programs)
2010/06/23 Monopoly (Board)
   2012/04/07 Prototype
2010/07/14 Strategy Battle
   2012/04/07 v0.12
2010/10/05 JRPG
   2012/04/07 v0.2
2010/11/02 PlotGrid
   2012/04/07 v0.2
2010/11/24 civilizaTIon™
   2012/04/07 v0.11

Purely Informational
2011/01/05 TI-nspire Stadium Changelog
   2012/04/07 v2
   Created to list significant releases of my programs. A page similar to this List of Programs in the TI-nspire Stadium was included in the documentation of most of my programs until sometime in Late 2011/Early 2012.

All games and programs coded in TI-nspire Basic.
© 2010-2012 Jason Ho.
Last Updated 14 April 2012

jhgenius01.webs.com
Will be moving! Stay tuned for updates.
Spoiler for Progress of Doodle God Axe:
2011/12/21 4% - Progress Suspended, ideas of graphical sprites still uncertain
Spoiler for Other Other You Know What Other Stuff I'm Talking About Stuff Stuff (Updated 2012/01/17):
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #11 on: 07 March, 2012, 18:08:22 »
0

Quote
Won't that completely nullify the point of them making the CG-10?
Yep. Smiley

Quote
So this will allow us to change the Prizm Startup screen and system screens?
As far as I know, these are simple bitmaps inside the OS. On legacy models, OS patching is not too complicated from within an add-in as you can use flash writing syscalls. But I don't know if the Prizm adds extra security against modifications. Well, the OS checksum is already known.
« Last Edit: 07 March, 2012, 18:13:05 by cfxm » Logged
JosJuice
LV9 Veteran (Next: 1337)
*********
Online Online

Last Login: Today at 18:34:34
Date Registered: 24 September, 2010, 16:46:12
Location: Sweden
Posts: 1300


Total Post Ratings: +51

View Profile
« Reply #12 on: 07 March, 2012, 19:21:07 »
0

Won't that completely nullify the point of them making the CG-10?
Yes.
So this will allow us to change the Prizm Startup screen and system screens?
That sounds really cool, we could completely change what it says, or 'rearrange' pixels for efficiency.
No. What this will allow us to do is to create our own images to use as backgrounds for graphs and other math purposes that already support the images that are supplied by Casio.

EDIT: Ninja'd by more that an hour. I should use F5 more. Tongue
« Last Edit: 07 March, 2012, 19:21:43 by JosJuice » Logged

DJ Omnimaga
Retired Omnimaga founder (Site issues must be PM'ed to Netham45, Eeems, Shmibs, Deep Thought and AngelFish, not me.)
Editor
LV15 Omnimagician (Next: --)
*
Offline Offline

Gender: Male
Last Login: Today at 17:49:32
Date Registered: 25 August, 2008, 07:00:21
Location: Québec (Canada)
Posts: 50205


Total Post Ratings: +2611

View Profile WWW
« Reply #13 on: 07 March, 2012, 21:53:24 »
0

I would definitively like if it was made possible to create CG10 custom images or port CG20 ones to the CG10.

A lot of PRIZM BASIC games do not run on the CG10 because of the different format.
« Last Edit: 07 March, 2012, 21:53:32 by DJ_O » Logged

Retired 83+ coder, Omnimaga/TIMGUL founder. Now doing power metal music (formerly did electronica)

Follow me on Bandcamp|Facebook|Reverbnation|Youtube|Twitter|Myspace
fxdev
LV4 Regular (Next: 200)
****
Offline Offline

Last Login: 19 March, 2013, 20:52:08
Date Registered: 18 January, 2011, 16:21:14
Posts: 177

Topic starter
Total Post Ratings: +28

View Profile
« Reply #14 on: 07 March, 2012, 23:26:33 »
0

Anyone skilled in disassembling PC programs like the Casio image converter? Because I'm not... Tongue
And Simon doesn't seem to be interested in reverse-engineering the CAPTURE routine.

In the worst case, this could take us another year.
Logged
Pages: [1] 2 3 4   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.591 seconds with 30 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.