Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Borderlands 2 [Status]
#1
As requested, I have taken a look at Borderlands 2. The package opens in the present public version but the functions are not decompiled at all.

I have made some progress(~2 hours) on the decompiling the BL2 functions, so far this is how it looks:
Code:
static final simulated function float FindDeltaAngle(float A1, float A2)
{
    @OBJECT[1] = A2 - A1;
    // End:0x45 Loop:False
    if(@OBJECT[1] > 3.14)
    {
        @OBJECT[1] = @OBJECT[1] - 3.14 * 2.00;
        // This is an implied JumpToken;
        goto J0x6f;
        // End:0x6f Loop:False
        if(@OBJECT[1] < -3.14)
        {
            @OBJECT[1] = @OBJECT[1] + 3.14 * 2.00;
        }
        return @OBJECT[1];
        return ReturnValue;        
    }
}

Many functions are decompiled perfectly except for those using Let tokens(Assigments =) and Local variables as you see there are none but in the UDK build there is at least one local variable named Delta, e.g:

Code:
static final simulated function float FindDeltaAngle(float A1, float A2)
{
    local float Delta;

    Delta = A2 - A1;
    // End:0x55 Loop:False
    if(Delta > 3.14)
    {
        Delta = Delta - 3.14 * 2.00;
    }
    // End:0x8b
    else
    {
        // End:0x8b Loop:False
        if(Delta < -3.14)
        {
            Delta = Delta + 3.14 * 2.00;
        }
    }
    return Delta;
}

For as far as I know the local variables seem to have just dissapeared, although they've added a new array at the beginning of the functions with values I haven't figured out yet, perhaps they are the replacement for local variables.


I suppose I'll have to test more functions to get an idea of those changes Cool
Reply
#2
Odd, discovered plenty of functions which still have locals that work fine, and others that don't.
Reply
#3
Nice Big Grin,

Question: Does Borderlands 2 have alot of things written in Unreal Script or is it just a massive collection of native function names?

I remember Singularity, probably one of the only games i know which has ALOT of things put into native code that could have been in the script easily (heh consoles). Tongue
Reply
#4
Borderlands 2 has 1426 classes and they are quite big :p
Reply
#5
I've been looking at Bordlands 2 a lot this week. Trying to figure out a few functions, would love to get the bytecode decompiling nicely.
Trying to fix up unhood to work properly is giving me a head ache.
Reply
#6
I have built the new developer version, you can give it a try http://eliotvu.com/files/UE-Explorer-1.2-Dev.rar

This version adds support for Borderlands 2 and Stargate Worlds.


Please report any issues here that you find with Borderlands 2, with the package, class, and function names.
Reply
#7
Hey eliot, love the program, but I seem to be having an issue with the Borderlands 2 classes... Few of them have any functions (it usually stops after variable declaration), and many classes have an exception similar to this:

Deserialization failed by the following exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Occurred on position:132/133

StackTrace: at UELib.UnrealPackage.GetIndexObject(Int32 objectIndex)
at UELib.Core.UClass.Deserialize()
at UELib.Core.UObject.BeginDeserializing()

Any help on this would be awesome Big Grin
Reply
#8
(10-03-2012, 08:40 AM)ratrace135 Wrote:  Hey eliot, love the program, but I seem to be having an issue with the Borderlands 2 classes... Few of them have any functions (it usually stops after variable declaration), and many classes have an exception similar to this:

Deserialization failed by the following exception:
Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

Occurred on position:132/133

StackTrace: at UELib.UnrealPackage.GetIndexObject(Int32 objectIndex)
at UELib.Core.UClass.Deserialize()
at UELib.Core.UObject.BeginDeserializing()

Any help on this would be awesome Big Grin

Did you try this with the new build I linked to in this thread?
Reply
#9
Yeah, when I load the package it has the build as "Borderlands 2", so I'm guessing that's good...
But the title bar still says UE Explorer 1.1.0.0 if that means anything (probably not) :p
Reply
#10
I didn't change the version number.
Are you sure you're opening the correct packages? Also make sure it's decompressed(Just incase).
Reply
#11
Umm, I've been playing around mostly with the code packages (AkAudio, Core, Engine, GameFramework, GearboxFramework, GFxUI, and WillowGame), not sure if there's a different package I should be loading...

But yeah, the packages load (unlike the compressed ones), it's just that a lot of the classes are throwing an exception and not getting fully loaded...

Also, sorry if this is causing you trouble, I'm just really interested in the code for Borderlands 2 :p
Reply
#12
Most Classes/Functions decompile perfectly for me :/
Reply
#13
Have you tried Engine.u and decompiling the Actor class? That class decompiles 100% for me, even though it is marked red.
Reply
#14
FYI: I have updated the link with a new build. The new build fixes(red classes) the deserializing of classes for Borderlands 2 and many other games, while also other minor things, beware though components are broken due me trying new ways of detecting them.
Reply
#15
(10-19-2012, 06:49 AM)eliot Wrote:  FYI: I have updated the link with a new build. The new build fixes(red classes) the deserializing of classes for Borderlands 2 and many other games, while also other minor things, beware though components are broken due me trying new ways of detecting them.

Which other games are supposed to work now? i tried out Special Force 2 but it still freezes when i click on any class that is red.

EDIT: also tried out homefront, it still kills my ram when trying to load the main package gcgame.upk
Reply
#16
(10-21-2012, 11:04 PM)AR1911 Wrote:  
(10-19-2012, 06:49 AM)eliot Wrote:  FYI: I have updated the link with a new build. The new build fixes(red classes) the deserializing of classes for Borderlands 2 and many other games, while also other minor things, beware though components are broken due me trying new ways of detecting them.

Which other games are supposed to work now? i tried out Special Force 2 but it still freezes when i click on any class that is red.

EDIT: also tried out homefront, it still kills my ram when trying to load the main package gcgame.upk

I haven't uploaded the build which supports Special Force 2. Homefront is not supported.

Reply
#17
Hello eliot,

Thank you very much for this fantastic tool. I couldn't help but pledge my support via Paypal Smile

I also wanted to let you know that I tried the latest 1.2.0 preview build from the link above on Borderlands 2 and I found that pretty much everything from WillowGame, Core and Engine decompiled successfully.

The only meaningful package I am having problems with is Startup.upk. It seems like some ArrayProperties in Startup.upk keep throwing Index out of Bounds exceptions causing most if not all of the classes in Startup.upk to be non-decompilable.

Both option in the Export menu are then greyed out. I decompressed all UPK's with Gildor's tools, so that shouldn't be the problem. Just thought I'd let you know. Looking very much forward to the final 1.2.0 version!

Thanks again for making this tool public.

Andy
Reply
#18
(11-23-2012, 04:43 PM)andy Wrote:  Hello eliot,

Thank you very much for this fantastic tool. I couldn't help but pledge my support via Paypal Smile

I also wanted to let you know that I tried the latest 1.2.0 preview build from the link above on Borderlands 2 and I found that pretty much everything from WillowGame, Core and Engine decompiled successfully.

The only meaningful package I am having problems with is Startup.upk. It seems like some ArrayProperties in Startup.upk keep throwing Index out of Bounds exceptions causing most if not all of the classes in Startup.upk to be non-decompilable.

Both option in the Export menu are then greyed out. I decompressed all UPK's with Gildor's tools, so that shouldn't be the problem. Just thought I'd let you know. Looking very much forward to the final 1.2.0 version!

Thanks again for making this tool public.

Andy
Thank you for your support Cool


Great to know. Could you send me this Startup.upk file, I'd like to have a look at this issue, though it might not make it in 1.2 if the issue ain't obvious Undecided

Reply
#19
Startup.upk is THE main UPK file for Borderlands 2. If you have a Borderlands 2 installation already you can find it in BL2_INSTALL_DIR\WillowGame\CookedPCConsole\Startup.upk

If you don't have a BL2 install, I can send it to you, but it is about 15 MB in size.
Reply
#20
(12-07-2012, 12:00 AM)andy Wrote:  Startup.upk is THE main UPK file for Borderlands 2. If you have a Borderlands 2 installation already you can find it in BL2_INSTALL_DIR\WillowGame\CookedPCConsole\Startup.upk

If you don't have a BL2 install, I can send it to you, but it is about 15 MB in size.

I don't own BL2.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)