Zonja Capalini

Reverse-engineering OARs: Understanding parcel maps

Format 0.2 Opensim Archives (OARs) include, since Opensim version 3c271b, a “landdata” directory that stores parcel data. For each parcel in the region there is a file in XML format in the directory. Amost all objects in Opensim are associated with a unique uuid that identifies them, and parcels are not an exception to that rule. Files in the “landdata” directory use the uuid of the parcel as their filename and have a “.xml” extension.

What’s inside each one of these .xml files? Let’s take a peek at a sample one:

    <?xml version="1.0" encoding="utf-16"?>
    <LandData>
      <Area>6256</Area>
      <AuctionID>0</AuctionID>
      <AuthBuyerID>00000000-0000-0000-0000-000000000000</AuthBuyerID>
      <Category>-1</Category>
      <ClaimDate>1255170099</ClaimDate>
      <ClaimPrice>0</ClaimPrice>
      <GlobalID>bfbf7bd4-7d7b-4a35-aba0-c352201cddcf</GlobalID>
      <GroupID>00000000-0000-0000-0000-000000000000</GroupID>
      <IsGroupOwned>False</IsGroupOwned>
      <Bitmap>AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
       AAAAP//fwAAAAAA//9/AAAAAAD//38AAAAAAP//fwAAAAAA//9/AAAAAAD//38AAAAAAP//f
       wAAAAAA//9/AAAAAAD//38AAAAAAP//fwAAAAAA//9/AAAAAAD//38AAAAAAP//fwAAAAAA/
       /9/AAAAAAD//38AAAAAAP//fwAAAAAA//9/AAAAAAA=</Bitmap>
      <Description />
      <Flags>505454667</Flags>
      <LandingType>0</LandingType>
      <Name>Arrabal Tango Club</Name>
      <Status>0</Status>
      <LocalID>4</LocalID>
      <MediaAutoScale>0</MediaAutoScale>
      <MediaID>00000000-0000-0000-0000-000000000000</MediaID>
      <MediaURL />
      <MusicURL>http://xx.xx.xx.xx:8000</MusicURL>
      <OwnerID>69af4428-cec0-48d8-a0d9-c05268facca5</OwnerID>
      <ParcelAccessList />
      <PassHours>0</PassHours>
      <PassPrice>0</PassPrice>
      <SalePrice>0</SalePrice>
      <SnapshotID>00000000-0000-0000-0000-000000000000</SnapshotID>
      <UserLocation>&lt;0, 0, 0&gt;</UserLocation>
      <UserLookAt>&lt;0, 0, 0&gt;</UserLookAt>
      <Dwell>0</Dwell>
      <OtherCleanTime>0</OtherCleanTime>
    </LandData>

That’s the xml file for Arrabal Tango Club in Condensation Land — I’ve only obscured the music URL and wrapped the part between the <Bitmap> and </Bitmap> tags, which originally used only one line, with no intervening blanks. This string encodes the shape and position of the parcel in the region. How do we know that? Well, the parcel map has to be stored somewhere, and it has to be quite large, so the only candidate is the “Bitmap” string :-) Most probably this long string is a text encoding of binary data.

Indeed this is the case: the string is using the Base64 encoding (you can find that quickly by browsing the Wikipedia). After decoding the string, we get a binary chunk of exactly 512 bytes. I checked that all the terrain files have strings of exactly the same length, so this number had to mean something. Continue reading

Advertisements

December 18, 2009 Posted by | OpenSim, Tech News, Tutorials, ZOE | , , , , , | 6 Comments