Homebrew Pyramids QR Code Hacking

elisherer

I ♥ 3DS
OP
Member
Joined
Dec 16, 2009
Messages
778
Trophies
0
Location
3dbrew.org
Website
www.sherer.co.il
XP
392
Country
Iceland
I dont understand what you did there...but the files "detonator.png, spike.png and money.png" are files that I made. (cut from the game's screenshots)
all the files in icons are files that i made and not files that I extracted from somewhere...The qr codes definently don't contain icons..
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
A few suggestions:
1. zero bytes are more frequent than others
2. bytes with high bit set are less frequent
3. data is not ciphered, otherwise it will be random scattered (although it still can be xored by a constant)
4. data is compressed, most probably RLE-like . Notice that p2-1 has a number of blocks but is only 53 bytes long.
5. start positions of moving objects can differ from the screenshot of the original distributed image with QR
6. assuming all of the above, notice a repeated sequence of strings 4-8 in p7-1c and a sequences at offset 0x0026 and 0x0037

P.S. and yes, this is all the data QR contain, it can be checked by generating a QR from a binary file and scannin it in Piramids itself. Believe me it works well for data obtained from ZXing decoder.
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
observation of skulls:

There seem to be only 2 types. Horizontal or Vertical. Horizontal ALWAYS start going to the right. Vertical ALWAYS start going up. From there they are "dumb machines" they just go till they hit something ...then turn around.
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
observation of dogs:

There may be no need to set direction.There seem to be two types only. Horizontal and Vertical. They just shoot in the opposite direction to the block they are next to. They are ALWAYS next to a block or border (no free standing)
 

elisherer

I ♥ 3DS
OP
Member
Joined
Dec 16, 2009
Messages
778
Trophies
0
Location
3dbrew.org
Website
www.sherer.co.il
XP
392
Country
Iceland
I don't understand enough on qr codes but I'm pretty sure that if ZXing gives us a byte array as a result then this is what's inside.
The QR, as i understand, have a lot of checksums and the bigger the qr is, the better accuracy of the data.
The actual qr data's header has the length of the data so if all the binaries has the same header then it's gotta be correct.
 

duke_srg

Well-Known Member
Member
Joined
Mar 1, 2011
Messages
1,862
Trophies
0
Age
44
Location
Moscow
XP
807
Country
Serbia, Republic of
I don't understand enough on qr codes but I'm pretty sure that if ZXing gives us a byte array as a result then this is what's inside.
The QR, as i understand, have a lot of checksums and the bigger the qr is, the better accuracy of the data.
The actual qr data's header has the length of the data so if all the binaries has the same header then it's gotta be correct.

I've already checked a regenerated versions of a first dozen of QRs in Pyramids a while ago. There is nothing to worry about with ZXing, we just need to break a binary.

upd; yep. I'm here. Thanx for PLE, I just had no time on holidays to help with =(
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
Observation on rock doors:

Only one type. Initially all rocks fall then roll to the left. second drop....they fall then roll to the right. etc etc.
although you have them listed as different. They seem to all be the same and they shape is figured by there placement(perspective)
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
From all those enemy observations, there seems no need to set orientation in the QR.
Enemy Types:

1 : Horizontal Skulls
2 : Vertical Skulls
3 : Horizontal Dogs
4 : Vertical Dogs
5 : Rock Door
6 : Snakes
7 : Spike balls
8 : Flies
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
Background Observation:

There are three distinct backgrounds in these particular levels. So there must be a bit/byte to set that.
1-x have a zoomed out pyramid (same as 1-x Levels in game)
2-x have a zoomed in pyramid with fountain (same as 2-x Levels in game)
7-x have a tomb with mummy walking around (assumed the same as 7-x levels in game ...didn't get that far)

**update** I found the hex
0x06 seems to control the background.

00 = Level 1 BG
01 = Level 2 BG
02 = Level 3 BG
03 = ??
04 = Level 7 BG (maybe never got that far in the game...its the one with the mummy walking around)

on a side note compare the BG in the screen shot to the actual import on:
1-7
1-8(assumed)
1-9
2-4
2-5
2-6
2-7
2-8

They are different but correspond to the hex
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
judging by the top left tile and looking at 0x07
and the last few tiles ..and the hex before the timer byte.

00 = Blank
18 = Rock Door
30 = Detonator
12 = Player
05 = Block
13 = Door
02 = Bullet
0D = Fire
06 = Bird Stone
21 = Wings
33 = Pillar
09 = Amulet
19 = Coins
07 = Fourblocks
11 = Vertical Dog
23-24-25-26 = All four pieces of large block

That gives us /some/ insight, both in tile calls and tile placement
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
looking at p7-1b the above post sort of helps with the file structure.

Knowing the first 2 tiles are door(13) and fire(0D)
and the last 2 tiles are detonator(30) and player(12)

we can now see the map data and other info.

The data seems to go from left to right ..top to bottom. where there is a single tile the number is displayed , multiple tiles in a row seems to have some sort of length array after them.
 

celcodioc

Major A$$hole
Member
Joined
Nov 13, 2011
Messages
278
Trophies
0
XP
159
Country
looking at p7-1b the above post sort of helps with the file structure.

Knowing the first 2 tiles are door(13) and fire(0D)
and the last 2 tiles are detonator(30) and player(12)

we can now see the map data and other info.

The data seems to go from left to right ..top to bottom. where there is a single tile the number is displayed , multiple tiles in a row seems to have some sort of length array after them.

After a very quick look at p1-2.bin that seems to be true...

The first bytes of the file: 18 00 21 21 00 04 18 5C

0x18 = The block in the top left corner... reminds me of donut lifts from Super Mario World... (I don't have this game, is this what you called rock doors? :P)
0x00 = Empty
0x21 = Banana
0x21 = Banana
0x00 = Empty
0x04 = Repeat flag for the empty tile?
0x18 = Another "donut lift"
0x5C = Repeat flag for the "donut lift"? After these bytes, there is no other 0x18 byte even though there are 6 "donut lifts" in the level...

I don't see how they would separate the repeat flags from the actual blocks though, but this was just a quick look after all.

The repeat flags in p1-7b.bin do actually make sense, but not in this file.



EDIT: Typo
 

morphius

The King of the Cosmos
Member
Joined
Nov 21, 2008
Messages
298
Trophies
0
Website
pachimod.blogspot.com
XP
282
Country
United States
I've noticed that for most levels ... first few tiles line up....then it all falls to shit, then comes back together at the end...not too sure whats going on.

look at the last tiles of 1-2

06 bird stone
06 bird stone
05 regular stone
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    as to you
  • K3Nv2 @ K3Nv2:
    How do you know if the night will be good when you're asleep
  • BakerMan @ BakerMan:
    because i didn't say i was asleep
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
  • The Real Jdbye @ The Real Jdbye:
    @TwoSpikedHands just switch, all the knowledge you learned still applies and most of the code and assets should be the same anyway
  • The Real Jdbye @ The Real Jdbye:
    and realistically they wouldn't

    be able to play it legally anyway since they need a ROM and they probably don't have the means to dump it themselves
  • The Real Jdbye @ The Real Jdbye:
    why the shit does the shitbox randomly insert newlines in my messages
  • Veho @ Veho:
    It does that when I edit a post.
  • Veho @ Veho:
    It inserts a newline in a random spot.
  • The Real Jdbye @ The Real Jdbye:
    never had that i don't think
    The Real Jdbye @ The Real Jdbye: never had that i don't think