1. Post #841
    Gold Member
    robmaister12's Avatar
    January 2008
    4,969 Posts
    I'm starting to actually like Python quite a bit... still need to get used to the different syntax though.

    Anyways, got the container files working. Strangely, some of the .tga files aren't actually TGA files, I'll investigate that more tomorrow and see what that's all about. I put the code up on github: https://github.com/Robmaister/VideoGameFormats

    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 3 (list)

  2. Post #842
    Gold Member
    FoohyAB's Avatar
    July 2009
    945 Posts
    While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from Switchball, but all of it is compressed into a massive bin archive.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  3. Post #843
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    So.. In my book I've moved on to doing Arithmetic in Java. It's actually pretty fun, and I'm sure it's actually better than a calculator but w/e. Anyway, I'm just gonna dump my code here incase you guys wanna see it:
    Code:
    class arithmetic 
    {
    public static void main ( String[] args ) {
    int num = 100 ; 
    int factor = 20 ; 
    int sum = 0 ;
    sum = num + factor;// 100 + 20 
    System.out.println( "Addition Sum: " + sum );
    sum = num - factor;// 100 - 20 
    System.out.println( "Subtraction Sum: " + sum );
    sum = num * factor;// 100 * 20 
    System.out.println( "Multiplication Sum: " + sum );
    sum = num / factor;// 100 / 20 
    System.out.println( "Division Sum: " + sum );
    } 
    }
    Made =


    I'm gonna try do one on my own now, only referencing back to the book if I completely don't remember.. (I'll post my errors, if I've made any)
    Code:
    class arithmetic2
    {
    public static void main ( String[] args ) {
    int num = 1337 ;
    int factor = 1337;
    int sum = 0 ; 
    sum = num + factor ;
    System.out.println( "Addition of 1337 shit: " + sum );
    sum = num - factor ;
    System.out.println( "Subtraction of 1337 shit: " + sum ) ; 
    sum = num * factor ;
    System.out.println( "Multiplication of 1337 shit: " + sum ) ; 
    sum = num / factor ; 
    System.out.println ( "Division of 1337 shit: " + sum ) ; 
    }
    }
    I literally made 0 errors. Hell yeaaaaah.

    How do you guys think I'm doing with Java then, any opinions?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Programming King Programming King x 4 (list)

  4. Post #844
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from Switchball, but all of it is compressed into a massive bin archive.
    you're probably going to have to step through the file loading process in some form of disassembler and see how the actual program splits it up into chunks.
    Might be worth checking first to see if it's actually a zip file or another standard compression system though.

    Edited:

    7zip is great for that kind of check.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 1 (list)

  5. Post #845
    Gold Member
    FoohyAB's Avatar
    July 2009
    945 Posts
    Yeah I tried opening it in 7zip before with no luck.
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  6. Post #846
    Facepunch's Local Lycanthrope
    Contron's Avatar
    December 2008
    1,785 Posts


    Time to make it look half-decent on OSX!
    Reply With Quote Edit / Delete Windows 7 Jersey Show Events

  7. Post #847
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    All of this + more in under 3 - 4 hours..
    I'm so tired.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Winner Winner x 7 (list)

  8. Post #848
    Richy19's Avatar
    May 2010
    5,411 Posts
    I wanted to use box2d for top down, but you need to add forces like friction by yourself, just wondering if anyone had a good formula for slowing down objects(so they dont just flight off like in 0 gravity)
    I was thinking something like:
    //This is what I dont know how to calculate????
    //Having the floor resistance & gravity variables allow for walking on ice where you dont slow down as fast, or walking on gravel where you slow down faster. this could just be one variableas all it does is determine how effectivve the floorResistance is.
    slowForce = area * ( floorResistance * ( mass * gravity ) );
    
    //Get the direction to apply the force to, to slow it down
    oppositeDir = Dirrection * -1;
    
    applyForce(oppositeDir, slowForce);
    
    //Clamp to 0 so that it doesnt start moving in opposite direction
    newSpeed = clamp(0, currentSpeed, newSpeed);
    
    Reply With Quote Edit / Delete Linux United Kingdom Show Events Disagree Disagree x 1 (list)

  9. Post #849
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    At first I thought assigning values was stupid considering I didn't see the point. Now I do! Woo. I love Java, not too hard but it always has a challenge.

    Correct me if I'm wrong but when assigning values on Java it basically means keeping the same sum and then changing it as you go on?

    for example
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  10. Post #850
    Frugle's Avatar
    June 2010
    487 Posts
    I wanted to use box2d for top down, but you need to add forces like friction by yourself, just wondering if anyone had a good formula for slowing down objects(so they dont just flight off like in 0 gravity)
    Linear damping?
    Reply With Quote Edit / Delete Windows 7 Finland Show Events Agree Agree x 1 (list)

  11. Post #851
    ArgvCompany's Avatar
    June 2012
    549 Posts
    You're doing fine, but why did you switch from Lua?

    Edited:

    At first I thought assigning values was stupid considering I didn't see the point. Now I do! Woo. I love Java, not too hard but it always has a challenge.

    Correct me if I'm wrong but when assigning values on Java it basically means keeping the same sum and then changing it as you go on?

    for example
    Yeah, variables are for making the computer "remembering" stuff and making you able to change it or read it later.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events Agree Agree x 3 (list)

  12. Post #852
    calzoneman's Avatar
    February 2008
    460 Posts
    At first I thought assigning values was stupid considering I didn't see the point. Now I do! Woo. I love Java, not too hard but it always has a challenge.

    Correct me if I'm wrong but when assigning values on Java it basically means keeping the same sum and then changing it as you go on?

    for example
    Please don't post pictures of code, use the code tags for general code and the cpp tags for C(++)-like syntax.

    Edit:
    Apparently not. Carry on.
    Reply With Quote Edit / Delete Linux United States Show Events Disagree Disagree x 6Agree Agree x 2Dumb Dumb x 1 (list)

  13. Post #853
    Gold Member
    thomasfn's Avatar
    July 2008
    2,965 Posts
    So I spent a greater part of the afternoon learning Python and finding my way around Lego Alpha Team's container format. I haven't written the actual code to dump the file contents yet, but I have been able to walk through the file manually with a hex editor. I'm just stuck on the last 8 bytes of a file table entry.

    As ints, the values are extremely high, so I'm thinking it might be a checksum, but grabbing the checksum of the file contents in a bunch of common formats doesn't match up with any part of those 8 bytes, in both big and little endian. So now I'm thinking that it might be some sort of file permissions setting, but that doesn't seem necessary in a container format...

    Edited:

    I'm going to see if any of the game dlls have exported symbols, method names should hold some clues...
    Sometimes these old formats include values which are obsolete or just simply not used by the engine. If you can't figure out what it is and you aren't missing any important information, it's usually safe to just skip the bytes in your decoder.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  14. Post #854
    Gold Member
    windwakr's Avatar
    September 2009
    4,604 Posts
    While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from Switchball, but all of it is compressed into a massive bin archive.
    Looks like game extractor is supposed to handle the file, but I couldn't get it to open the one included in the demo of the game.

    http://www.koders.com/java/fid2E7F6D...797.aspx?s=226


    The individual files looks like they're compressed or something. They all start with "VNZ".
    Reply With Quote Edit / Delete Windows 7 United States Show Events Useful Useful x 1 (list)

  15. Post #855
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    Please don't post pictures of code, use the code tags for general code and the cpp tags for C(++)-like syntax.
    If you look at my other posts, you'll see that I do that.. This was just once.. So picky, dude.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Dumb Dumb x 5Agree Agree x 2 (list)

  16. Post #856
    Andrew McWatters
    Dennab
    March 2011
    4,658 Posts
    These are the one of many reasons I don't recommend Lua for beginners: it has a lot of very nifty things that are so nifty it sometimes hard to understand. Plus, many other languages don't have them, so switching to another will be harder.
    tl;dr: Java or C# as a first language is a good choice
    I'm pretty sure all major C-like languages have arrays, for loops, and the freedom to name variables.

    Java and C# are excellent first languages; I have a friend that I recommended they get into Bukkit development by taking on Java and start learning programming that way.

    However, why would you not recommend Lua for beginners? It's more forgiving than even Java and C#, which already hold your hand, but Lua gives you a bottle to suck on, too. There's a reason why it's recommended for beginners here. There are actually more immediately provided concepts in Java and C# that cannot be replicated in Lua without the help of a module.

    That being said, he was doing well, so I don't see why he not just try Java or C# instead, since it'll be more rewarding, but Lua is pretty much as easy as it gets without becoming entirely irrelevant.

    Edited:

    If you look at my other posts, you'll see that I do that.. This was just once.. So picky, dude.
    Welcome to WAYWO!
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  17. Post #857
    Gold Member
    FoohyAB's Avatar
    July 2009
    945 Posts
    Looks like game extractor is supposed to handle the file, but I couldn't get it to open the one included in the demo of the game.

    http://www.koders.com/java/fid2E7F6D...797.aspx?s=226


    The individual files looks like they're compressed or something. They all start with "VNZ".

    I couldn't get it to work either, but I'm recreating that plugin in C#



    You've made me very very happy.
    Reply With Quote Edit / Delete Windows 7 United States Show Events Winner Winner x 4 (list)

  18. Post #858
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    Question about some code.
    Code:
    result = (num1 % 2 != 0) ? "Odd" : "Even" ;
    I understand it all. But what I don't understand is (assuming I'm correct) if the 2 represents the "Odd" and the 0 represents the "Even" how can 2 do that, considering 2 is even?
    like, how does it make sense?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 1 (list)

  19. Post #859
    I bought a title for $1.
    sambooo's Avatar
    March 2011
    3,059 Posts
    Question about some code.
    Code:
    result = (num1 % 2 != 0) ? "Odd" : "Even" ;
    I understand it all. But what I don't understand is (assuming I'm correct) if the 2 represents the "Odd" and the 0 represents the "Even" how can 2 do that, considering 2 is even?
    like, how does it make sense?
    2 % 2 == 0, therefore result == "Even" because 0 != 0 == false
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  20. Post #860
    Gold Member
    Chandler's Avatar
    February 2006
    1,406 Posts
    Question about some code.
    Code:
    result = (num1 % 2 != 0) ? "Odd" : "Even" ;
    I understand it all. But what I don't understand is (assuming I'm correct) if the 2 represents the "Odd" and the 0 represents the "Even" how can 2 do that, considering 2 is even?
    like, how does it make sense?
    You're performing a modulus operation, which means you're going to get back the remainder of the expression. If you divide 3 by 2 (or any odd number), you get back 1 (meaning, it is odd) and if you divide 2 by 2, the remainder is 0.

    Mathematics!
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 1 (list)

  21. Post #861
    Gold Member
    WTF Nuke's Avatar
    March 2009
    4,470 Posts
    I don't think you do understand the code, the % sign is the modulus sign, meaning it will return whatever is left over when dividing a number by another number. Say you put in 33, if it is divided by 2 you will get 16.5, but the modulus only divides up to 16 and returns 1 (as 16*2 = 32, 32+1 = 33). We then check if the number is 0. If it is 0, then we return even, if it is not, we return odd.
    Reply With Quote Edit / Delete Windows 7 Canada Show Events

  22. Post #862
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    Aw man, this is the first time I've got properly stuck using java. This sucks.
    Right, so basically
    Code:
    class condition
    {
    public static void main( String[] args) {
    int num1 = 1000;
    int num2 = 1001 ;
    String result ;
    result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ;
    System.out.println(num1 + "is" + result); 
    result = (num2 % 2 != 0) ? "Odd" : "Even" ; 
    System.out.println(num2 + " is " + result); }
    }
    It's dividing the numbers by 2, then what?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Funny Funny x 1 (list)

  23. Post #863
    PENISCORP DIRECTOR
    Gran PC's Avatar
    August 2007
    3,114 Posts
    % is the modulus operator. It divides the number by whatever is after it, and returns the remainder. If the remainder isn't 0 it sets result to "Odd", otherwise it sets it to "Even".
    Reply With Quote Edit / Delete Windows 7 Spain Show Events Agree Agree x 2Late Late x 2 (list)

  24. Post #864
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    You've got two operations here.
    The modulo operator
    and the Ternary operator
    The modulo is easy enough, it's maths like 2 + 2 == 4. In this case, 4 % 2 == 0.
    The Ternary operator is slightly different. It's of the form variable = (expression) ? truth-value : false-value;
    It is basically shorthand for
    if (expression) {
        variable = truth-value;
    } else {
        variable = false-value;
    }
    In this case, your expression is num % 2 == 0.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Optimistic Optimistic x 1 (list)

  25. Post #865
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    Code:
    class condition
    {
    public static void main( String[] args) {
    int num1 = 870;
    int num2 = 1001 ;
    String result ;
    result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; // dividing an even number will leave you with a whole number, for example 870 / 2 = 435 
    System.out.println(num1 + "is" + result); 
    result = (num2 % 2 != 0) ? "Odd" : "Even" ; // dividing an odd number will leave you with a number, and a remainder, for example 5 / 2 = 2.5 if it's inequal to 0 then it's obviously odd.. 
    System.out.println(num2 + " is " + result); }
    }
    Okay! Correct?

    I've figured that part out. But does it work like this 2 (Odd) != 0 (Even)? I know what i'm doing now I just don't understand what's representing Odd.

    != is inequal, so if it's != to 0 then it's odd..
    if it isn't then it's even..

    What is confusing me though, it's so hard to explain.. Like, how does it transmit it to being odd or even? like how does it make it show that?
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  26. Post #866
    ArgvCompany's Avatar
    June 2012
    549 Posts
    Code:
    class condition
    {
    public static void main( String[] args) {
    int num1 = 870;
    int num2 = 1001 ;
    String result ;
    result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; // dividing an even number will leave you with a whole number, for example 870 / 2 = 435 
    System.out.println(num1 + "is" + result); 
    result = (num2 % 2 != 0) ? "Odd" : "Even" ; // dividing an odd number will leave you with a number, and a remainder, for example 5 / 2 = 2.5 if it's inequal to 0 then it's obviously odd.. 
    System.out.println(num2 + " is " + result); }
    }
    Okay! Correct?
    It should be.
    Reply With Quote Edit / Delete Windows 7 Germany Show Events

  27. Post #867
    Gold Member
    Robber's Avatar
    January 2006
    6,204 Posts
    Code:
    class condition
    {
    public static void main( String[] args) {
    int num1 = 870;
    int num2 = 1001 ;
    String result ;
    result = ( num1 % 2 != 0 ) ? "Odd" : "Even" ; // dividing an even number will leave you with a whole number, for example 870 / 2 = 435 
    System.out.println(num1 + "is" + result); 
    result = (num2 % 2 != 0) ? "Odd" : "Even" ; // dividing an odd number will leave you with a number, and a remainder, for example 5 / 2 = 2.5 if it's inequal to 0 then it's obviously odd.. 
    System.out.println(num2 + " is " + result); }
    }
    Okay! Correct?

    I've figured that part out. But does it work like this 2 (Odd) != 0 (Even)? I know what i'm doing now I just don't understand what's representing Odd.

    != is inequal, so if it's != to 0 then it's odd..
    if it isn't then it's even..

    What is confusing me though, it's so hard to explain.. Like, how does it transmit it to being odd or even? like how does it make it show that?
    You have to look at each part of the expression.

    Code:
    result = (((num2 % 2) != 0) ? ("Odd") : ("Even")); // num2 = 7
    result = (((7    % 2) != 0) ? ("Odd") : ("Even")); // 7/2=3 and 1 remainder
    result = (((1       ) != 0) ? ("Odd") : ("Even")); // 1 is not equal to 0, that's true
    result = ((true           ) ? ("Odd") : ("Even")); // true means it will select the first "thing" (Odd)
    result = ("Odd"                                        );
    Reply With Quote Edit / Delete Windows 7 Austria Show Events Artistic Artistic x 2 (list)

  28. Post #868
    asdfghjkl.
    Erasus's Avatar
    May 2011
    2,149 Posts
    Code:
    class escape2
    {
    public static void main (String[] args) {
    String header = "\n\tLESSON PLAN FOR THE WEEK:\n";
    header += "\n\tMonday\t\tTuesday\t\tWednesday\tThursday\tFriday\n";
    header +="\t------\t\t-------\t\t----------\t--------\t------\n";
    String lessons = "\tBusiness\tPSE\t\tScience\t\tMaths\t\tHistory\n";
    lessons += "\tScience\t\tScience\t\tRE\t\tEnglish\t\tBusiness\n";
    lessons += "\tEnglish\t\tMaths\t\tGraphics\tScience\t\tICT\n";
    lessons += "\tICT\t\tICT\t\tHistory\t\tPE\t\tMaths\n";
    lessons += "\tEnrichment\tEnglish\t\tScience\t\tGraphics\tRE\n";
    System.out.print(header + lessons);}
    }
    Well, that was fucking horrible. I had to figure out which individual \t went where and then made sure it didn't misplace itself in the program. I finally figured it out and got it to work. It's my lesson plan for the week at school, I gave myself a self-assignment I suppose, just to see if it'd work. It did.

    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events

  29. Post #869
    Gold Member
    Lexic's Avatar
    March 2009
    6,123 Posts
    Code:
    class escape2
    {
    public static void main (String[] args) {
    String header = "\n\tLESSON PLAN FOR THE WEEK:\n";
    header += "\n\tMonday\t\tTuesday\t\tWednesday\tThursday\tFriday\n";
    header +="\t------\t\t-------\t\t----------\t--------\t------\n";
    String lessons = "\tBusiness\tPSE\t\tScience\t\tMaths\t\tHistory\n";
    lessons += "\tScience\t\tScience\t\tRE\t\tEnglish\t\tBusiness\n";
    lessons += "\tEnglish\t\tMaths\t\tGraphics\tScience\t\tICT\n";
    lessons += "\tICT\t\tICT\t\tHistory\t\tPE\t\tMaths\n";
    lessons += "\tEnrichment\tEnglish\t\tScience\t\tGraphics\tRE\n";
    System.out.print(header + lessons);}
    }
    Well, that was fucking horrible. I had to figure out which individual \t went where and then made sure it didn't misplace itself in the program. I finally figured it out and got it to work. It's my lesson plan for the week at school, I gave myself a self-assignment I suppose, just to see if it'd work. It did.
    At some point in the not too distant future, you will gaze once more upon this code with experienced eyes and gently weep.
    Reply With Quote Edit / Delete Windows 7 United Kingdom Show Events Agree Agree x 23Friendly Friendly x 1 (list)

  30. Post #870
    Person
    geel9's Avatar
    June 2008
    5,736 Posts
    Code:
    class escape2
    {
    public static void main (String[] args) {
    String header = "\n\tLESSON PLAN FOR THE WEEK:\n";
    header += "\n\tMonday\t\tTuesday\t\tWednesday\tThursday\tFriday\n";
    header +="\t------\t\t-------\t\t----------\t--------\t------\n";
    String lessons = "\tBusiness\tPSE\t\tScience\t\tMaths\t\tHistory\n";
    lessons += "\tScience\t\tScience\t\tRE\t\tEnglish\t\tBusiness\n";
    lessons += "\tEnglish\t\tMaths\t\tGraphics\tScience\t\tICT\n";
    lessons += "\tICT\t\tICT\t\tHistory\t\tPE\t\tMaths\n";
    lessons += "\tEnrichment\tEnglish\t\tScience\t\tGraphics\tRE\n";
    System.out.print(header + lessons);}
    }
    Well, that was fucking horrible. I had to figure out which individual \t went where and then made sure it didn't misplace itself in the program. I finally figured it out and got it to work. It's my lesson plan for the week at school, I gave myself a self-assignment I suppose, just to see if it'd work. It did.

    Now make a function to automatically space them! :science:
    Reply With Quote Edit / Delete Mac United States Show Events Agree Agree x 8Funny Funny x 2 (list)

  31. Post #871
    Gold Member
    dije's Avatar
    December 2008
    4,759 Posts
    I'm more productive during nights than days so I made perlin noise terrain:



    Edited:

    I also began working on some sort of water shader




    Off to bed!
    Reply With Quote Edit / Delete Windows 7 Sweden Show Events Artistic Artistic x 12Programming King Programming King x 1Winner Winner x 1Agree Agree x 1 (list)

  32. Post #872
    Gold Member

    October 2008
    3,838 Posts
    Playing around with Curses Sharp.

    Although the library is pretty terrible it's still easy to use. (Also it uses ordered dithering which means I had to completely type over this humongous matrix, sadly)
    Reply With Quote Edit / Delete Windows 7 United States Show Events Artistic Artistic x 7 (list)

  33. Post #873
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts
    I have been working for the past hours on re-creating breakout! I always liked the game and thought that maybe making it my way will show me a few things I have not done before.



    So far I got all this done.

    I'm using Love2D.

    I still have to do a few things, which I am not sure are possible with just one system. Like making it so the particles don't move with the emitter, and that when using phasing ( the orange ) previous particles don't change color as well.

    ( What are the tags to embed a webm video again? )
    Reply With Quote Edit / Delete Windows 7 France Show Events Winner Winner x 4 (list)

  34. Post #874
    jung3o's Avatar
    October 2011
    2,165 Posts
    Code:
    use [vid]
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  35. Post #875
    Pass along
    commander204's Avatar
    May 2008
    4,065 Posts

    use [vid]
    Thanks!
    Reply With Quote Edit / Delete Windows 7 France Show Events

  36. Post #876
    Gold Member
    GamingRobot32's Avatar
    January 2012
    155 Posts

    Tried to make terrain from 2d noise instead of 3d

    Can someone help me get proper terrain generation?
    Reply With Quote Edit / Delete Windows 7 United States Show Events Funny Funny x 6Disagree Disagree x 1 (list)

  37. Post #877
    voodooattack's Avatar
    October 2009
    1,994 Posts
    While you guys are on the subject of reverse engineering a format, what can you do if a game has compressed all of it's content into a single file? I'd always wanted to get the music and some of the geometry from Switchball, but all of it is compressed into a massive bin archive.
    Here, I decoded the file's structure for you:

    File format is small-endian.

    Strings are stored as a DWORD specifying the length followed by an ASCII string of said length; not null-terminated

    Code:
    0   - Signature (at offset 0): 32 bytes ("THIS IS A BATCH FILE" followed by zeroes)
    32 - DWORD: number of index entries.
    36 - File index starts here (8 bytes of index entry data followed by file name (string))
       DWORD file offset
       DWORD file size
    using System;
    using System.Collections.Generic;
    using System.IO;
    
    namespace batch_extract
    {
      class Program
      {
        static void Main(string[] args)
        {
          var file = File.OpenRead("switchball.batch");
          var reader = new BinaryReader(file);
          var indexTable = new Dictionary<string, Tuple<uint, uint>>();
    
          reader.ReadBytes(32);
          uint indexSize = reader.ReadUInt32();
          uint indexLen = 32;
    
          Console.WriteLine("Number of files in index table: " + indexSize);
    
          for (uint i = 0; i < indexSize; i++)
          {
            uint offset = reader.ReadUInt32();
            uint size = reader.ReadUInt32();
            uint fileNameLen = reader.ReadUInt32();
    
            byte[] fileNameArray = reader.ReadBytes((int)fileNameLen);
            string fileName = System.Text.Encoding.ASCII.GetString(fileNameArray);
    
            indexTable[fileName] = new Tuple<uint,uint>(offset, size);
            indexLen += 24 + fileNameLen;
          }
    
          foreach (var t in indexTable)
          {
            Console.WriteLine("Extracting: " + t.Key);
    
            file.Seek(t.Value.Item1, SeekOrigin.Begin);
            byte[] data = new byte[t.Value.Item2];
    
            int read = file.Read(data, 0, (int)t.Value.Item2);
    
            string dir = Path.GetDirectoryName(t.Key);
            if (!Directory.Exists(dir))
              Directory.CreateDirectory(dir);
    
            var extracted = File.Create(t.Key);
    
            extracted.Write(data, 0, read);
          }
    
          Console.WriteLine();
          Console.WriteLine(indexTable.Count + " files extracted.");
    
          Console.ReadLine();
        }
      }
    }
    

    As for individual files, my best guess is that they're packed with something proprietary. I couldn't detect any zlib headers using my tools; they seem to start with VNZ, followed by a DWORD that holds the size of the compressed file (including the header).

    Edited:

    I couldn't get it to work either, but I'm recreating that plugin in C#



    You've made me very very happy.
    god damn it, ninja'd by a long mile
    Reply With Quote Edit / Delete Windows 7 Egypt Show Events Winner Winner x 4Friendly Friendly x 1Optimistic Optimistic x 1 (list)

  38. Post #878
    Hack's Avatar
    March 2011
    261 Posts
    My Pre-alpha release trailer.

    Reply With Quote Edit / Delete Windows 7 Canada Show Events Winner Winner x 6 (list)

  39. Post #879
    Gold Member
    FoohyAB's Avatar
    July 2009
    945 Posts
    Here, I decoded the file's structure for you:

    File format is small-endian.

    Strings are stored as a DWORD specifying the length followed by an ASCII string of said length; not null-terminated

    As for individual files, my best guess is that they're packed with something proprietary. I couldn't detect any zlib headers using my tools; they seem to start with VNZ, followed by a DWORD that holds the size of the compressed file (including the header).

    Edited:



    god damn it, ninja'd by a long mile
    Though I ran into the same wall with that VNZ business, I found one thread on google asking about it for switchball also but it was never answered.
    Not to mention I've never done anything like this before and it takes me forever to get something working without reading the wrong number of bytes
    Reply With Quote Edit / Delete Windows 7 United States Show Events

  40. Post #880
    itty-bitty pretty kitty
    Dennab
    September 2008
    9,837 Posts
    Though I ran into the same wall with that VNZ business, I found one thread on google asking about it for switchball also but it was never answered.
    Not to mention I've never done anything like this before and it takes me forever to get something working without reading the wrong number of bytes
    Try opening it with StuffIt. It supports a bunch of old archives and encodings.
    Reply With Quote Edit / Delete Windows 7 United States Show Events