XeNTaX Forum Index
Forum MultiEx Commander Tools Tools Home
It is currently Fri Oct 20, 2017 3:25 pm

All times are UTC + 1 hour


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: varint decoding
PostPosted: Thu Dec 18, 2014 1:22 pm 
Offline
mega-veteran
mega-veteran

Joined: Wed May 05, 2010 8:21 pm
Posts: 270
Location: Poland Głogów
Has thanked: 16 times
Have thanks: 514 times














You can make the ads go away by registering

Hi

How decode this files?. They are from google cache.

I use this scripts but with no luck.

https://code.google.com/r/avenka-co1/so ... e86c47ec4b

https://github.com/dowski/misc/blob/master/varints.py

files: http://www.mediafire.com/download/m29kk ... roblem.zip


Top
 Profile  
 
 Post subject: Re: varint decoding
PostPosted: Thu Feb 23, 2017 7:31 pm 
Offline
mega-veteran
mega-veteran

Joined: Wed May 05, 2010 8:21 pm
Posts: 270
Location: Poland Głogów
Has thanked: 16 times
Have thanks: 514 times
Here is a trick how to decode varint.
I needed varint decoding to get models from Sketchfab.
So here is a way:
1.select Sketchfab site with your favorite model (best lowpoly)
2.save this site as complete html (it creates html file and folder with the same name as html file)
3.close web browser (best use mozilla firefox)
4.go to folder with saved site and doubleclick on html
5.change web browser mode to offline.
6.open web browser console
6.from saved html folder open file "viewer-c077fc97f229ec2c2f73.js" in notaped++
In offline mode and with "viewer-c077fc97f229ec2c2f73.js" you can control how translate data from function to function


7.in js file find something like that
Code:
function(t,e,i){
       //data 't','e','i' on in
        console.log('t='+t)
        console.log('e='+e)
        console.log('i='+i)
   "use strict";
   var
   n=i(1205),
   r=n.osg,
   a=function(t,e,i)
      {
      for(var n=new r[i](e),a=0,s=0;a!==e;){var o=0,u=0;do o|=(127&t[s])<<u,u+=7;while(0!==(128&t[s++]));n[a++]=o}if("U"!==i[0])
         for(var l=0;l<e;++l)
            {
            var h=n[l];n[l]=h>>1^-(1&h)
            }
         console.log(n)   
                       //or write console.log('n='+n)
                       //data "n" on out
         return n};t.exports=a},


8.in js write command "console.log(...)" you can see data in console
- example in code
9.refresh web browser and see what happen in console.
10.this method need time and patience.

Here is a finally script to import decoded models from Sketchfab.
Install Blender249 and Python266, doubleclick Blender249.blend, in Text Window press alt+p and select file.osgjs.
To import model you need model_file.bin and file.osgjs in the same folder.
To skip bindposing change line BINDPOSE=1 to BINDPOSE=0


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.



Top
 Profile  
 
 Post subject: Re: varint decoding
PostPosted: Fri Feb 24, 2017 4:51 am 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2152
Location: Nexus, searching for Jim Kirk
Has thanked: 424 times
Have thanks: 1097 times
well, nice, as always :D

btw there's many "doubles" in the Uint16Arrays:

These are the face indices? Do I miss something?


Attachments:


You do not have the required permissions to view the files attached to this post. Register to gain access.


_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: varint decoding
PostPosted: Fri Feb 24, 2017 7:21 am 
Offline
mega-veteran
mega-veteran

Joined: Wed May 05, 2010 8:21 pm
Posts: 270
Location: Poland Głogów
Has thanked: 16 times
Have thanks: 514 times
Bytes are still encoded after unvarint.
It needs undelta, unimplicit and others use function to decode to indices.
But vertices need indices to decode and function like unpredict, unquantize.
All depend too if there are triangle_strip or triangles.


Top
 Profile  
 
 Post subject: Re: varint decoding
PostPosted: Tue Feb 28, 2017 12:17 pm 
Offline
M-M-M-Monster veteran
M-M-M-Monster veteran
User avatar

Joined: Fri Apr 20, 2012 9:24 am
Posts: 2152
Location: Nexus, searching for Jim Kirk
Has thanked: 424 times
Have thanks: 1097 times
Szkaradek123 wrote:
Bytes are still encoded after unvarint.
It needs undelta, unimplicit and others use function to decode to indices.
well, ok, thanks (sry, forgot this thread for a while).
I was a little bit confused because you wrote in your previous post (after that browser js action ):
Szkaradek123 wrote:
Here is a finally script to import decoded models from Sketchfab.
As you may know I've extracted an orc some months ago using simple RAM logging (viewtopic.php?f=16&t=10668&p=117317&hilit=+digging#p117317).
The problem was to find the (decoded!) face indices in tons of data.
(not sure whether this approach would be successful 11 months later :D )

_________________
"you can't always get things served on a silver tray"
extracting simple models: http://forum.xentax.com/viewtopic.php?f=29&t=10894
Make_H2O-ForzaHor3-jm9.zip

"We are Microsoft. You will be assimilated. Resistance is Futile."


Top
 Profile  
 
 Post subject: Re: varint decoding
PostPosted: Sat Jul 01, 2017 10:00 pm 
Offline
ultra-n00b

Joined: Tue Jun 27, 2017 9:54 pm
Posts: 1
Has thanked: 1 time
Have thanks: 0 time
Szkaradek123 wrote:
Here is a trick how to decode varint.
I needed varint decoding to get models from Sketchfab.
So here is a way:
1.select Sketchfab site with your favorite model (best lowpoly)
2.save this site as complete html (it creates html file and folder with the same name as html file)
3.close web browser (best use mozilla firefox)
4.go to folder with saved site and doubleclick on html
5.change web browser mode to offline.
6.open web browser console
6.from saved html folder open file "viewer-c077fc97f229ec2c2f73.js" in notaped++
In offline mode and with "viewer-c077fc97f229ec2c2f73.js" you can control how translate data from function to function


7.in js file find something like that
Code:
function(t,e,i){
       //data 't','e','i' on in
        console.log('t='+t)
        console.log('e='+e)
        console.log('i='+i)
   "use strict";
   var
   n=i(1205),
   r=n.osg,
   a=function(t,e,i)
      {
      for(var n=new r[i](e),a=0,s=0;a!==e;){var o=0,u=0;do o|=(127&t[s])<<u,u+=7;while(0!==(128&t[s++]));n[a++]=o}if("U"!==i[0])
         for(var l=0;l<e;++l)
            {
            var h=n[l];n[l]=h>>1^-(1&h)
            }
         console.log(n)   
                       //or write console.log('n='+n)
                       //data "n" on out
         return n};t.exports=a},


8.in js write command "console.log(...)" you can see data in console
- example in code
9.refresh web browser and see what happen in console.
10.this method need time and patience.

Here is a finally script to import decoded models from Sketchfab.
Install Blender249 and Python266, doubleclick Blender249.blend, in Text Window press alt+p and select file.osgjs.
To import model you need model_file.bin and file.osgjs in the same folder.
To skip bindposing change line BINDPOSE=1 to BINDPOSE=0


Hello master, I wanted to know if you can make a video tutorial about maybe I got confused in some steps and it would be great help try the blender script produces an error or maybe I am very clumsy


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group