Omnimaga

Calculator Community => Casio Calculators => Topic started by: fxdev on March 03, 2012, 01:12:08 pm

Title: Hacking into the .g3p/b format [HALTED]
Post by: fxdev on March 03, 2012, 01:12:08 pm
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:

Code: [Select]
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.

Code: [Select]
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.

Code: [Select]
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)
Title: Re: Hacking into the .g3p/b format
Post by: sammyMaX on March 03, 2012, 01:13:46 pm
Why does Casio have two formats? Do they serve different purposes?
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 03, 2012, 01:24:37 pm
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).
Title: Re: Hacking into the .g3p/b format
Post by: sammyMaX on March 03, 2012, 01:38:46 pm
I meant, what's the difference between .g3b and g3p files?
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 03, 2012, 01:47:00 pm
I meant, what's the difference between .g3b and g3p files?

Sorry, I did not expect such a basic question. ;)

.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.
Title: Re: Hacking into the .g3p/b format
Post by: sammyMaX on March 03, 2012, 02:01:09 pm
Cool, thanks for the info :)
Title: Re: Hacking into the .g3p/b format
Post by: bynary_man on March 06, 2012, 11:54:01 am
This is very interesting :)
Title: Re: Hacking into the .g3p/b format
Post by: krazylegodrummer56 on March 06, 2012, 05:06:19 pm
And how does this help?

Will you now be able to put modified pics onto the prizm?
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 07, 2012, 04:24:21 am
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. ;)
Title: Re: Hacking into the .g3p/b format
Post by: calc84maniac on March 07, 2012, 05:58:42 am
Won't that completely nullify the point of them making the CG-10?
Title: Re: Hacking into the .g3p/b format
Post by: Jonius7 on March 07, 2012, 07:25:48 am
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.
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 07, 2012, 11:08:22 am
Quote
Won't that completely nullify the point of them making the CG-10?
Yep. :)

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.
Title: Re: Hacking into the .g3p/b format
Post by: JosJuice on March 07, 2012, 12:21:07 pm
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. :P
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on March 07, 2012, 02:53:24 pm
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.
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 07, 2012, 04:26:33 pm
Anyone skilled in disassembling PC programs like the Casio image converter? Because I'm not... :P
And Simon doesn't seem to be interested in reverse-engineering the CAPTURE routine.

In the worst case, this could take us another year.
Title: Re: Hacking into the .g3p/b format
Post by: helder7 on March 07, 2012, 06:54:25 pm
I made some interesting discoveries

the .g3p/g3b file save the vwindow, xmin, xmax...

(http://img823.imageshack.us/img823/9859/definitions.jpg)

(http://img862.imageshack.us/img862/6188/optnf.jpg)
Title: Re: Hacking into the .g3p/b format
Post by: SimonLothar on March 11, 2012, 12:30:36 pm
Anyone skilled in disassembling PC programs like the Casio image converter? Because I'm not... :P
And Simon doesn't seem to be interested in reverse-engineering the CAPTURE routine.

In the worst case, this could take us another year.
The Prizm OS detects the CG10 via syscall 0x1196, which checks for the byte at 0xA0000305 to be 0x5A.
When opening a g3p-file the "Invalid Type"-message (msgno 0x3E) appears, if syscall 0x1196 detects a CG10.

Hence a byte inside of syscall 0x1196 would have to be modified.
At the moment I do not see another way to bypass the CG10-restriction.

BTW: I'd rather not think about changing the byte at 0xA0000305.
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 11, 2012, 01:15:14 pm
Quote
At the moment I do not see another way to bypass the CG10-restriction.
OS modding is a last resort only.

I have another idea:
Instead of cracking the image checksum and changing the type ID (which is hopefully not required for decompression, because this would mean complete repackaging using zlib), couldn't we just modify the image converter to write the ID 0x3C1B instead of 0x789C before the checksum calculation takes place? Worth a try...

Holy crap, the image converter does not seem to be protected. ;D
Title: Re: Hacking into the .g3p/b format
Post by: JosJuice on March 11, 2012, 02:55:55 pm
I have another idea:
Instead of cracking the image checksum and changing the type ID (which is hopefully not required for decompression, because this would mean complete repackaging using zlib), couldn't we just modify the image converter to write the ID 0x3C1B instead of 0x789C before the checksum calculation takes place? Worth a try...

Holy crap, the image converter does not seem to be protected. ;D
That might work, but this method is likely to be troublesome because of legal issues. Casio's converter is tricky to get, and I'm not sure if patching it is allowed.
Title: Re: Hacking into the .g3p/b format
Post by: SimonLothar on March 12, 2012, 01:56:21 pm
But I don't know if the Prizm adds extra security against modifications.
Obviously...it doesn't.  ;D
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on March 12, 2012, 04:33:55 pm
So you wrote the first OS modifying add-in? Casio learnt nothing... :P
Title: Re: Hacking into the .g3p/b format
Post by: SimonLothar on March 14, 2012, 03:03:40 pm
So you wrote the first OS modifying add-in?
Yes.

Casio learnt nothing...
I wouldn't state it this way. I did my first OS mod on a fx-9860G four years ago. Did not raise much general interest. I think it is reasonable that Casio did not bother.
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 02, 2012, 01:21:45 am
Hopefully it is possible to convert images between both models in the future. The French Casio community is growing larger, but most people use BASIC for their games. As a result, about 50% of the existing PRIZM games only work on european models. :'(
Title: Re: Hacking into the .g3p/b format
Post by: flyingfisch on April 02, 2012, 11:25:03 am
I understand why you would want to hack the g3p/b format, but I just thought i would throw this question out: would it be very hard to make a viewer for common image formats? (*.bmp, png, jpg, tiff... maybe even svg O.o)
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 03, 2012, 02:28:08 pm
I would actually like a tool to view calc images on the PC, like TI-Connect has. It's annoying to have to open a copy of the emulator then import the files to view them. X.x
Title: Re: Hacking into the .g3p/b format
Post by: SimonLothar on April 04, 2012, 12:52:02 pm
Obviously
"inflate 1.2.3 (Copyright 1995-2005 Mark Adler)"
is used to compress/decompress G3P files.
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 04, 2012, 01:35:42 pm
I meant one that is actually available for download for everyone (although Casio might not like that if the said tool can edit/save/compress images)
Title: Re: Hacking into the .g3p/b format
Post by: SimonLothar on April 06, 2012, 03:26:23 am
I meant one that is actually available for download for everyone
I agree, of course. But the prerequisite for such a tool is the knowledge of the algorithm. I am sure there are people around, who are more experienced in deflate/inflate-algorithms and faster in developing such a tool than me. BTW, I wonder if the deflate/inflate syscalls (f. i. 0x0821 and 0x0822 are involved) can be generally used on-calc to compress/decompress data.

(although Casio might not like that if the said tool can edit/save/compress images)
The inflate 1.2.3-algorithm (Copyright 1995-2005 Mark Adler) is no secret.
You can use it freely (For conditions of distribution and use, see copyright notice in zlib.h;http://www.raspberryginger.com/jbailey/minix/html/zlib_8h-source.html).
Though, perhaps they'll mind the bit-swapping like AAABBBBB <-> ~BBBBBAAA of the packed data block starting at offset 0xD0 to be unveiled. I am a newbie with deflate/inflate-algorithms (I hope I can change this in the time coming), but I do not think this bit-swapping is part of the inflate 1.2.3-algorithm. On the other hand bit-swapping is a general technique to camouflage information.
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 06, 2012, 11:38:25 pm
Apparently the hacking of the g3p/b format topic seems to have made a group of Casio PRIZM coders in the calculator community worried, because of the consequences the release of such tool could cause to the Casio PRIZM community. Although I have good faith that anybody posting in this thread want this tool to be used only for program development or to allow Planète-Casio BASIC games to be played on american PRIZM models, if this tool gets released publicly or even in the spam forum (which requires 500 posts), it will inevitabely fall under the wrong hands, eventually.

Personally, the only way around this that I thought is that once released, a trusted TI community member volunteers to convert images destined for programming use themselves, upon programmer/gamer requests, and that this person never release the tool anywhere. Otherwise, if released, I guarantee you that eventually someone will use it to cheat in tests or to stock porn in his calc. And even if that was to never happen, Casio will most likely worry that it will, and their reaction might be to lock down their calcs even more, potentially at the detriment of you good guys making games and useful tools for all of us. And sadly, Omnimaga and Cemetech did encounter their share of students asking help to cheat on tests before ( http://ourl.ca/15055 being an example, and see Calc84maniac's sarcastic response), and it was most likely even worse on other calc sites that aren't as programming-oriented as us, so even if that tool was only released privately to any member above 1000 posts, I am sure eventually it could lead to bad consequences. And this would be the last thing the community wants, especially when there are people trying to strenghten relations between Casio and the community.

The problem, though, is would anybody ever be willing to volunteer for converting people's pics himself (and filtering innapropriate ones)? My idea is that the pic request requires a link to the user's project in the works or a link to a FX-cg20-only game that he needs converted, so the person doesn't receive too many requests, but even then I worry this could be tedious for the person.
Title: Re: Hacking into the .g3p/b format
Post by: ruler501 on April 06, 2012, 11:51:06 pm
DJ_O while that idea may work for proving to the calc companies we are not trying to cheat and just want to have fun and or make a good program. I think that it would discourage some people from making programs because they'd have to msg/email/ask someone to convert there images for them. I personally would rather have it released to the whole community even if it might make casio try to block it. I personally believe that even if we got past it and gave the conversion method to only a few people casio would still try to prevent it just because the proof that it can be done is out there and might make some test officials scared.
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 06, 2012, 11:57:05 pm
I just fear it would backfire at us. FOr example, schools could just plain ban Casio PRIZM calcs from their classes and this would hurt Casio sales considerably, while hurting the PRIZM community big time. And the latter is what we want to prevent.
Title: Re: Hacking into the .g3p/b format
Post by: ruler501 on April 06, 2012, 11:59:30 pm
The thing is though that they may take any use of a tool that converts edited pictures to be usable on a CG-10 as a threat and do their best to prevent it. I know that if I was them I would do my best to prevent that specific bug from appearing even if the community that made it had not released it to the general public. Its to risky that someone else may figure it out and then use it to cheat.
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 07, 2012, 12:12:40 am
Well, then, what idea do you propose, other than releasing it to public? :P
Title: Re: Hacking into the .g3p/b format
Post by: ruler501 on April 07, 2012, 12:17:21 am
That is what I propose. I say we release it and if casio wants to they can block it. I doubt they would go as far as blocking all dev though. They'd just block the  ability to create custom images on cg-10's. I believe it would be better to allow everyone who wants to use it have it because either way once its made casio will probably try and block it. They wont have much of a choice. Even the limited release would still force them to act. You may release it closed source though to make it harder for them to combat it and have the source put in spam or something

[offtopic]We really should have a forum area where we can discuss real topics for members with 500+ posts or something like that. It would be useful for things like this especially
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 07, 2012, 12:30:22 am
Maybe, but Casio has a long history of failing at programming (eg the Locate glitch and the many bugs in older calcs) and stuff like that, and instead of figuring out how to block images, they might just remove that feature completely or something else worse. Also, there's still the fact that calcs allowing custom images are not allowed in US exams, so the calc would get banned from classes and become less popular. In return, the entire PRIZM community would get much less PRIZM owners and Omnimaga as a whole would be looked upon by people from other places who worked hard at establishing links and trustworthiness with Casio. Your post is rather careless about the community I think. Either you are too young to understand or you are yourself advocating cheating in tests (or even willing to use the tool to do so). Also even 5000 posts would not be enough. Postcount != trustworthy (some people go for quantity over quality so they might reach 5000 quickly then gain access to the tool )
Title: Re: Hacking into the .g3p/b format
Post by: AHelper on April 07, 2012, 12:58:58 am
Can someone remind me, what is CASIO's reasoning on why images can be banned?  It can't be for something like typed equations or something because e-Activity lets you do that.  Heck, I put class notes on it, how are images worse?  Just curious.

To weigh in on this, I think that until CASIO makes its position clear on what they will accept from third party sources, like add-ins ranging from games to CASes, images, and mods, the community should be nice to CASIO as they have the power to both help and hurt.

*AHelper looks at the nspire

Also, there is an addin being created that will let you view images (iirc, png images) stored on the prizm.  Don't know much about it, or if it really is going to happen or not.
Title: Re: Hacking into the .g3p/b format
Post by: ruler501 on April 07, 2012, 01:08:30 am
AHelper who knows why they banned it on tests. they obviously didnt think that you would have note taking on calcs...

and to go with AHelpers post there are already projects for image and video viewers whats the harm in allowing us to do it this way also? It will allow us to have games with the images is about all that will happen. Casio has reason from regular image viewers for the same reason as this so I truthfullly think this is the easiest for them.

@DJ I am able to see that it may hurt the community all I was saying is that either way once this is finished if casio is going to act they will. If it is held to a few people or not so why not release it publicly. The trust thing is important but if we show them we just want to use it for games they'll just toss it in with all the other things we do. also I do not cheat and I do not advocate cheating. I work hard to pass the classes at my school fairly and take offense that you suggest that I am encouraging or advocating cheating by suggest that a tool to convert from CG-20 to CG-10 images should be released publicly. And the thing on putting the source in spam would just be to make it harder for casio to find the method used. Though if you want to build trust you could release it with the program so they could fix it easier if they so chose.
Title: Re: Hacking into the .g3p/b format
Post by: AHelper on April 07, 2012, 01:14:13 am
Ah ha! I just remembered, the Prizm has a Reset All Addins (and storage) options.  Maybe that since all third party additions, like addins, can easily be removed before a test.  Since the .g3p/b is an official format used by the OS itself, having it included and wiping out user-made content would not remove these images.  (User content as-in addins and unknown file formats to the OS)

The above reason makes perfect sense... but still doesn't explain what CASIO has against pictures and not a 23KB file full of notes, examples (that add-in is much better than notefolio IMO), and such.
Title: Re: Hacking into the .g3p/b format
Post by: ruler501 on April 07, 2012, 01:19:18 am
AHelper I'll test in a minute whether that will touch .g3p/b files. Have to backup my prizm first :P
Title: Re: Hacking into the .g3p/b format
Post by: AHelper on April 07, 2012, 01:34:01 am
Well, the Addin&Storage only resets the storage memory.  The Main Memory only allows CASIO-approved formats, including the .g3p's, to be copied over USB.
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 07, 2012, 01:35:05 am
AHelper who knows why they banned it on tests. they obviously didnt think that you would have note taking on calcs...

and to go with AHelpers post there are already projects for image and video viewers whats the harm in allowing us to do it this way also? It will allow us to have games with the images is about all that will happen. Casio has reason from regular image viewers for the same reason as this so I truthfullly think this is the easiest for them.

@DJ I am able to see that it may hurt the community all I was saying is that either way once this is finished if casio is going to act they will. If it is held to a few people or not so why not release it publicly. The trust thing is important but if we show them we just want to use it for games they'll just toss it in with all the other things we do. also I do not cheat and I do not advocate cheating. I work hard to pass the classes at my school fairly and take offense that you suggest that I am encouraging or advocating cheating by suggest that a tool to convert from CG-20 to CG-10 images should be released publicly. And the thing on putting the source in spam would just be to make it harder for casio to find the method used. Though if you want to build trust you could release it with the program so they could fix it easier if they so chose.
The problem is the way you worded your arguments and your insisting with it sounds definitively like you don't care if it's used badly and even encourage people to use it for anything,bad or not. Now I'm giving up arguing with you because you seem to think only you is right and everyone else is wrong and that all of your opinions are facts and everyone else's are not. Plus, you always repeat the same arguments over and over anyway, without even bothering reading my new points.

By the way, if we publicly release this and it turns out bad, then an entire group of PRIZM coders will hate us for having been so careless. There's Omnimaga reputation that is under question too, you know! Well, guess what, if you insist so much into getting this publicly released and that everyone else is relunctant, but then the author releases it and something bad happens, then Omni won't be to blame!

Of course, if Casio ever takes a stance against third-party dev even though we have not done anything that might hurt their sales, then of course no one will object at the release of such tool (like what was done with OSLauncher with TI), but unless Casio decides to screw us over like TI did, why not play nice?
Title: Re: Hacking into the .g3p/b format
Post by: Hayleia on April 07, 2012, 08:58:07 am
I agree with DJ.
For now, the Prizm is not as powerful as the CX but at least it is opened. Releasing such a tool will probably make Casio act like TI and the Prizm community would die (because every calcs would be closed but the CX would be better). Then, the result of the converter thing would be that no game would run on any Prizm, fx-cg10 or fx-cg20.

I don't know anything about files in a Prizm but is there a difference between a game and an image in the file ? If yes, maybe the converter could see if it is an image or a game and convert it only if it is a game (seems impossible to me).

The thing I never understood is why OSLancher for Ndless 3.1 was released. TI was already against us, arguing that Ndless allows cheating and we prove that they were right.

Please don't do the same mistake with Casio.
Title: Re: Hacking into the .g3p/b format
Post by: JosJuice on April 07, 2012, 09:19:50 am
I think the usefulness of an image conversion tool would be very small if it isn't released. Being able to use our own images is a very important part of the Prizm, so a publicly released converter would be great - as long as it doesn't hurt anything else, that is. If the creation or release of such a tool would harm the ability to program, it would obviously be the worst thing to happen. However, I do not believe that it will happen. Casio might try to block the ability to use images if we discover a method to create them, but preventing us from writing add-ins doesn't make sense at all. They wouldn't earn anything by doing so, and they probably wouldn't want "revenge" on us for using images. After all, they are a company, and their interest is to make profit. It's not possible to be completely sure about what Casio will think, but I am convinced that the ability to use images wouldn't ban the Prizm from tests. Why not? Because the Nspire series has had the exact same ability for a year, and it's perfectly fine to use those! Even if images weren't allowed, I think actions by the community are too small to have any effect on if the Prizm is allowed. OSLauncher is released, and the non-CAS Nspires are still allowed on tests that don't allow CAS.
Well, the Addin&Storage only resets the storage memory.  The Main Memory only allows CASIO-approved formats, including the .g3p's, to be copied over USB.
.g3p/.g3b files cannot be stored in the main memory, and it would be very impractical anyway because of the size. All data deletion options that delete non-add-in files in storage memory will cause every image to be deleted (unless they're stored inside add-ins, but that's not what this topic is about).
I don't know anything about files in a Prizm but is there a difference between a game and an image in the file ? If yes, maybe the converter could see if it is an image or a game and convert it only if it is a game (seems impossible to me).
No. All images that can be read by the OS are stored in the same way. Even if it was possible, someone could just make a "game" that only consists of an image that would otherwise be forbidden.
Title: Re: Hacking into the .g3p/b format
Post by: KermMartian on April 07, 2012, 10:17:13 am
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. A Prizm coder started discussing creating a fake reset Add-In over at Cemetech, and a large number of us Prizm hackers quickly expressed our opinions on why that would be bad for everyone in terms of getting Casio to look more closely at what we were doing with Add-Ins and think seriously about Add-In security. Bottom line:

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

One of the great advantages of Prizm programming in my view is that our programs and add-ins work on Prizms without jailbreaking, without Ndlessing, without any sort of unlocking tools. If we want to maintain that, we have to code like ethical, mature, grown-up programmers. Undermining the whole reason that there's a different between the CG10 and the CG20, at least with a public tool release, would not be responsible. I can appreciate the ego value of successfully figuring out the format, and even telling people of your technical successes, but just as it wouldn't be ethical to release a tool to the general public that could exploit a glitch in computer systems to steal identities on the assumption that some would use it for good, it's not ethical to release this tool. There's a very good reason that SourceCoder doesn't do such image format conversions, and trust me, it's not technical reasons.
Title: Re: Hacking into the .g3p/b format
Post by: SimonLothar on April 07, 2012, 02:07:26 pm
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. A Prizm coder started discussing creating a fake reset Add-In over at Cemetech, and a large number of us Prizm hackers quickly expressed our opinions on why that would be bad for everyone in terms of getting Casio to look more closely at what we were doing with Add-Ins and think seriously about Add-In security. Bottom line:

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

One of the great advantages of Prizm programming in my view is that our programs and add-ins work on Prizms without jailbreaking, without Ndlessing, without any sort of unlocking tools. If we want to maintain that, we have to code like ethical, mature, grown-up programmers. Undermining the whole reason that there's a different between the CG10 and the CG20, at least with a public tool release, would not be responsible. I can appreciate the ego value of successfully figuring out the format, and even telling people of your technical successes, but just as it wouldn't be ethical to release a tool to the general public that could exploit a glitch in computer systems to steal identities on the assumption that some would use it for good, it's not ethical to release this tool. There's a very good reason that SourceCoder doesn't do such image format conversions, and trust me, it's not technical reasons.
Is it really ethical or necessary to link a discussion about the g3p-fileformat with
"fake reset-addin programming"
or -jeeeeeesh!-
"stealing identities"?
These have never been ideas of this thread.
But nevertheless, interesting rhetorical impact. Congrats. :)
Though. What a pity. I found interesting syscalls during analyzing the g3p-system (f. i. SaveFileDialog or OpenFileDialog; man'o'man, these would save a lot of G3A-space). :'(
Title: Re: Hacking into the .g3p/b format
Post by: DJ Omnimaga on April 07, 2012, 06:46:23 pm
@Kerm at least this is good that Casio has given us a chance. TI has never done so with the Nspire (as soon as Ndless was made possible on latest OSes, they immediately blocked it and went as far as installing anti-downgrade stuff. I think this is why I think we should take that chance and behave so they trust us. With TI we don't do any effort to behave, because they screwed with us from the very start, unlike Casio, and I even considered cancelling the entire TI-Nspire portion of the 2011 contest last year, replacing it with a DCS, 9860G or 68K one, a month or two before launching it, as some sort of boycott of TI's actions.

I still think that maybe, if kept secret among trusted community members, there could be someone volunteering to convert a few images for other people if they absolutely want their games to be cross-compatible, and it's a good idea to examine the format and try to hack it for the sake of just accomplishing something special, but we all need to be responsible and be aware of the consequences, negative or positive.

Also we gotta keep in mind that those BASIC games are very large in file size, so they might no longer get a signifiant audience in the future, when more ASM/C games comes out, plus I'm sure eventually there will be workarounds, such as xLIB for the PRIZM, letting people use 16x16 sprites and stuff like that for their game graphics. Not saying that BASIC games are bad, but I mean if a puzzle game is 2.3 MB, people might prefer the much smaller Tetrizm clone.

On the positive side, however, is that once BASIC pictures novelty have weared off, if someone volunteers to convert pics for people games, he won't get much work to do. :P
Title: Re: Hacking into the .g3p/b format
Post by: fxdev on April 08, 2012, 08:06:13 am
Simon told me, he was able to remove any CG10 restrictions by an OS-patching add-in. But because of obvious reasons, such a tool is never going to be released. It would be best to close the entire thread then.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: Deep Toaster on April 08, 2012, 12:39:37 pm
Not sure if anyone's mentioned this yet, but Casio's still giving out licenses to their G3B/G3P image generator for free at http://www.casioeducation.com/prizm/create.

It's their own tool, so why not use that? We wouldn't need to do anything to make them suspicious.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: DJ Omnimaga on April 08, 2012, 12:40:04 pm
Well that's cool that he managed to do it. Hopefully there are more PRIZM breakthroughs in the near future (even if that one cannot be released). Recently for example there was a successful overclocking attempt (that doesn't reboot the calc).

Not sure if anyone's mentioned this yet, but Casio's still giving out licenses to their G3B/G3P image generator for free at http://www.casioeducation.com/prizm/create. It's their own tool, so why not use that?

Because that only works for cg20 calcs. The goal of this thread was to allow cg10 calcs to use custom images too, but due to american school rules about calculator images, that could have lead to the PRIZM community demise.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: MPoupe on April 08, 2012, 01:02:59 pm
Not sure if anyone's mentioned this yet, but Casio's still giving out licenses to their G3B/G3P image generator for free at http://www.casioeducation.com/prizm/create.

It's their own tool, so why not use that? We wouldn't need to do anything to make them suspicious.
Did anybody try to download the tool ?
I tried and I am somehow confused. The tool works with cg 20, right ?
cg 20 is not for USA, so there are very few cg 20 users (comparing to cg 10 users) in the USA.
So why was I asked for US state ?
Simply the registration form expects that I am from some school, from USA and I own fx cg 20.
:-O

Nevertheless I was successful :-)
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: JosJuice on April 08, 2012, 01:08:44 pm
Not sure if anyone's mentioned this yet, but Casio's still giving out licenses to their G3B/G3P image generator for free at http://www.casioeducation.com/prizm/create.

It's their own tool, so why not use that? We wouldn't need to do anything to make them suspicious.
Did anybody try to download the tool ?
I tried and I am somehow confused. The tool works with cg 20, right ?
cg 20 is not for USA, so there are very few cg 20 users (comparing to cg 10 users) in the USA.
So why was I asked for US state ?
Simply the registration form expects that I am from some school, from USA and I own fx cg 20.
:-O

Nevertheless I was successful :-)

The descriptions seem to say that images should be used on the emulator, which works just like an fx-CG20 when it comes to images, even in fx-CG10 regions. Of course, they still work on actual fx-CG20s.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: DJ Omnimaga on April 08, 2012, 01:08:46 pm
By the way there's one other workaround people could use if they absolutely want custom pics on their calcs and have no problem not using that calc in classes: Buy a FX-cg20 on ebay. However you have to be careful to make sure the seller isn't misleading you into buying a FX-cg10 by passing it as a cg20 or something. (like people did with TI-Nspire prototypes)
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: MPoupe on April 08, 2012, 01:19:36 pm
The descriptions seem to say that images should be used on the emulator, which works just like an fx-CG20 when it comes to images, even in fx-CG10 regions. Of course, they still work on actual fx-CG20s.
Thank you for explaining.
But I do not see the value of working images in the emulator (assuming I am US cg10 owner). I would use emulator probably only to try something before I run it on real calc. There are much more advanced mathematics tools for PC otherwise (I mean using emulator as it is without any cooperation with the calculator)
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: JosJuice on April 08, 2012, 01:29:46 pm
The descriptions seem to say that images should be used on the emulator, which works just like an fx-CG20 when it comes to images, even in fx-CG10 regions. Of course, they still work on actual fx-CG20s.
Thank you for explaining.
But I do not see the value of working images in the emulator (assuming I am US cg10 owner). I would use emulator probably only to try something before I run it on real calc. There are much more advanced mathematics tools for PC otherwise (I mean using emulator as it is without any cooperation with the calculator)
I agree - it's not very useful. It's too bad that the fx-CG10 has to be this restricted.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: DJ Omnimaga on April 30, 2012, 08:01:40 pm
Something I wonder:

If hacking the g3p/b format and publishing a tool letting you bypass the cg10 restriction could backfire on the community by making Casio block add-ins, does it means that releasing a BMP/PNG image viewer could also cause problems? Because shortly after this project was halted, PNG (http://www.cemetech.net/forum/viewtopic.php?t=7750) and BMP (http://www.cemetech.net/forum/viewtopic.php?p=182708#182708) viewers were started, respectively. I'm confused as to why a cg20 image viewer for the cg10 would be any more risky than a PNG/BMP viewer, when all 3 involves the ability to view images on a calc that is not supposed to allow it? ???
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: SimonLothar on May 01, 2012, 05:03:16 am
...I'm confused as to why a cg20 image viewer for the cg10 would be any more risky than a PNG/BMP viewer...
You are right, of course. Based on careful calculations, the probability of abusing some unlimited standard-imagetype-viewer for the Prizm is even higher compared to an unlimited G3P-viewer. Hence, if someone is troubled over an unlimited G3P-viewer, it immediately follows, that he should be troubled over any unlimited image-viewer for the Prizm at least as much.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: fxdev on May 01, 2012, 01:08:09 pm
Quote
...a PNG/BMP viewer...
Well, someone should implement a check to make the program work on fx-CG20's only.
Title: Re: Hacking into the .g3p/b format [HALTED]
Post by: DJ Omnimaga on May 01, 2012, 01:39:19 pm
Yeah I agree such restriction could be added. Of course, somebody will probably argue that we should release whatever we want because of freedom of speech or blahblahblah, but I think this would not hurt, if we're really concerned about calcs getting banned in North American schools.

But of course the video viewer would not be any better on the image viewing sense. However the video player produces poor quality image, making it impossible to read text, so I guess it's not too bad.