Results 1 to 14 of 14
  1. #1
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    79

    Default Decompile .u files?

    I was wondering if there was a way to decompile .u files in Unreal Tournament III. A while ago I was working on a small mod called Villainous but after a hard drive crash on my main computer I lost all the source code to it; my old computer had the compiled .u file (I was using both computers to check my replication code to see if it was working... it wasn't).

    If it's impossible it really isn't a big deal, I would just like to avoid reprogramming what I had done so far.

    If anyone can help, the file I'm trying to decompile can be found here:
    http://kylestaves.com/wp-content/upl...3/villainous.u

    Thanks in advance!

  2. #2
    Iron Guard
    Join Date
    Apr 2008
    Posts
    542

    Default

    Yes, the code is in plain text at the end of the file. I believe the editor has a way to export it back to source files? Here's the first few.

    Code:
    class VilBotController extends UTBot;
    Code:
    /* 
        BattleTeamArena Copyright (C) 2007-2008 Nico de Vries.
    
        This file is part of BattleTeamArena.
    
        BattleTeamArena is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
    
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see http://www.gnu.org/licenses/.
    */ 
    
    class VilCopSpawnMessage extends UTTimerMessage;
    Code:
    class VilGetaway_SeqAction extends SequenceAction;
    
    // var() Object myObject;
    var() Controller Escapee;
    
    event Activated()
    {
    	local Villainous Vil;
    
    	Vil = Villainous(GetWorldInfo().Game);
    	Vil.KismetHack("VilGetaway");
    	//Vil.VilGRI (WorldInfo.GRI).bGetawayTriggered = true;
    }
    Code:
    /**
     * UTKillZVolume
     * Kills pawns using KillZ interface
     *
     *
    * Copyright 1998-2008 Epic Games, Inc. All Rights Reserved.
     */
    
    class VilGotawayVolume extends PhysicsVolume
        placeable;
    
    event PawnEnteredVolume(Pawn Other)
    {
    	Gotaway(Other);
    }
    
    simulated event Gotaway(Pawn Other)
    {
    	if ( VilPawn(Other) != None )
    	{
    		//Other.FellOutOfWorld(none);
    		VilPRI (Other.PlayerReplicationInfo).bGotAway = true;
    		VilPawn(Other).FellOutOfWorld(none);
    		VilPawn(Other).bStopDeathCamera = true;
    	}
    }
    Code:
    /*
    	Villainous Copyright (C) 2007 Kyle Staves.
    	
    	This file is the work of Kyle Staves, inDevs.net. However, much of the work
    	found throughout this modification is derived from the work of Nico de Vries
    	on his BattleTeamArena gametype modifications. I do not claim to have authored
    	every line of code, and I will do my best to comment chunks derived from other's
    	work (excluding that of Epic Games). 
    	
    	This file is part of Villainous.
    	
    	Villainous is free software: you can redistribute it and/or modify
        it under the terms of the GNU General Public License as published by
        the Free Software Foundation, either version 3 of the License, or
        (at your option) any later version.
    
        This program is distributed in the hope that it will be useful,
        but WITHOUT ANY WARRANTY; without even the implied warranty of
        MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
        GNU General Public License for more details.
    
        You should have received a copy of the GNU General Public License
        along with this program.  If not, see http://www.gnu.org/licenses/.
    
        This file also contains code that is derived from code which is
        Copyright 1998-2007 Epic Games, Inc. All Rights Reserved. That part 
        of the code is covered by the Epic license and not by the GPL.
    */
    
    class VilGRI extends UTGameReplicationInfo config (Villainous);
    
    // Server Side Data
    var int ElapsedTimeRoundOffset;
    
    // Client Side Data
    var VilPlayerController LocalPlayerController;
    var int RemainingRoundTime;
    
    // Data replicated from the server to the client
    var int RemainingTimeRoundOffset;
    var int CopSpawnTime;
    var bool bGetawayTriggered;
    var bool bRoundIsOver;
    var bool bGameIsOver;
    
    var globalconfig int VilRoundLength;
    var globalconfig int VilCopSpawnPulse;
    
    replication
    {
    	if (Role == ROLE_Authority)
    		RemainingTimeRoundOffset, CopSpawnTime, bRoundIsOver, bGameIsOver, 
    		bGetawayTriggered, VilRoundLength, VilCopSpawnPulse;
    }
    
    simulated function Timer() // Derived from UTGameReplicationInfo.uc
    {
    	local byte TimerMessageIndex;
    	local PlayerController PC;
    	
    	Super (GameReplicationInfo).Timer(); // Super.Super - from BTA, I have no idea what this comment means, should learn
    	
    	if (VilGRI (WorldInfo.GRI).VilRoundLength == 0) VilGRI (WorldInfo.GRI).VilRoundLength = 60;
    	if (VilGRI (WorldInfo.GRI).VilCopSpawnPulse == 0) VilGRI (WorldInfo.GRI).VilCopSpawnPulse = 15;
    	
    	Villainous (WorldInfo.Game).CheckEndHeist();
    	
    	if ( WorldInfo.NetMode == NM_Client )
    	{
    		if ( bWarmupRound && RemainingTime > 0 )
    			RemainingTime--;
    	}
    	
    	if (WorldInfo.NetMode != NM_DedicatedServer && MapVoteTimeRemaining > 0)
        {
        	MapVoteTimeRemaining--;
        }
    	
    	if ( bGetawayTriggered )
    	{
    	RemainingRoundTime = Min (300, Max (-1, RemainingTime - RemainingTimeRoundOffset));
    	}
    	else RemainingRoundTime = VilRoundLength;
    	
    	// check if we should broadcast a time countdown message, subset of UTGameReplicationInfo otherwise it would become annoying
    	if (WorldInfo.NetMode != NM_DedicatedServer && !bRoundIsOver && (bMatchHasBegun || bWarmupRound) && !bStopCountDown && !bMatchIsOver && Winner == None)
    	{
    		// Kyle: Round timer/message
    		switch (RemainingRoundTime)
    		{
    			case 0:
    				if (RemainingTime!=0) TimerMessageIndex = 17; // No double overtime message
    				break;
    			case 30:
    				TimerMessageIndex = 12;
    				break;
    			default:
    				if (RemainingRoundTime <= 5 && RemainingRoundTime > 0)
    				{
    					TimerMessageIndex = RemainingRoundTime;
    				}
    				break;
    		}
    		if (TimerMessageIndex != 0 && bGetawayTriggered)
    		{
    			foreach LocalPlayerControllers(class'PlayerController', PC)
    			{
    				PC.ReceiveLocalizedMessage(class'VilTimerMessage', TimerMessageIndex);
    			}
    		}
    		// CopSpawn Counter
    		if (CopSpawnTime <= 0) CopSpawnTime = VilCopSpawnPulse; else CopSpawnTime--;
    	} 	
    }
    
    /** determines whether we should process the given player's character data into a mesh
     * and if so, gets that started
     * @note: this can be called multiple times for a given PRI if more info is received (e.g. Team)
     * @param PRI - the PlayerReplicationInfo that holds the data to process
     * @param bTeamChange - if this is the result of a team change
     */
    simulated singular function ProcessCharacterData(UTPlayerReplicationInfo PRI, optional bool bTeamChange)
    {
    	local int i;
    	local bool bPRIAlreadyPresent, bDefaultCharParts, bLocalTeamChange;
    	local CreateCharStatus NewCharStatus;
    	local UTProcessedCharacterCache CharacterCache, OldestCharacterCache;
    	local UTPlayerReplicationInfo ReplacementUTPRI;
    
    	/* Kyle: unkilling this for now */
    	if (SkipAllProcessing())
    	{
    		return;
    	}
    
    	// Do nothing if CharData is not filled in
    	/* Kyle: unkilling this again */
    	if((PRI.CharacterData.FamilyID == "" || PRI.CharacterData.FamilyID == "NONE") && !PRI.IsLocalPlayerPRI())
    	{
    		return;
    	}
    
    	// see if this character is cached
     	foreach DynamicActors(class'UTProcessedCharacterCache', CharacterCache)
     	{
     		if (CharacterCache.GetCachedCharacter(PRI))
     		{
     			TotalPlayersSetToProcess++;
     			return;
     		}
     		else if (OldestCharacterCache != None)
     		{
     			OldestCharacterCache = CharacterCache;
     		}
     	}
    
    
    	// Kyle: kill this if we need to?
    	// we need to make sure we have called StartProcessingCharacterData() before we actually do anything
    	if (IsTimerActive('StartProcessingCharacterData'))
    	{
    		if (GetTimerRate('StartProcessingCharacterData') > 0.001)
    		{
    			SetTimer(0.001, false, 'StartProcessingCharacterData');
    		}
    		return;
    	}
    
    	/* Kyle: killing it for now
    	if(bProcessedInitialCharacters && bTeamChange && PRI.IsLocalPlayerPRI())
    	{
    		if( PRI.UpdateCustomTeamSkin() )
    		{
    			bLocalTeamChange = TRUE;
    		}
    	}
    	*/
    
    	// We don't allow non-local characters to be created once gameplay has begun.
    	// also skip nonlocal spectators (spectators can join later, so build local mesh anyway so at least player sees his/her own custom mesh)
    	/* Kyle: this is probably the main thing to kill
    	if (((bProcessedInitialCharacters && !WorldInfo.IsInSeamlessTravel()) || PRI.bOnlySpectator || bForceDefaultCharacter) && !PRI.IsLocalPlayerPRI())
    	{
    		ReplacementUTPRI = FindExistingMeshForFamily(PRI.CharacterData.FamilyID, PRI.GetTeamNum(), PRI);
    		if(ReplacementUTPRI != None)
    		{
    			PRI.SetCharacterMesh(ReplacementUTPRI.CharacterMesh, true);
    			PRI.CharPortrait = ReplacementUTPRI.CharPortrait;
    		}
    		else
    		{
    			PRI.SetCharacterMesh(None);
    		}
    
    		return;
    	}
    	*/
    
    	/* Kyle: Lets unkill this again... */
    	// Decrement count if this is a local player.
    	if(PRI.IsLocalPlayerPRI())
    	{
    		LocalPCsLeftToProcess.RemoveItem(PlayerController(PRI.Owner));
    	}
    	// If this isn't a local player, don't process it if we haven't got space.
    	else if((TotalPlayersSetToProcess + LocalPCsLeftToProcess.length) >= class'UTGame'.default.MaxCustomChars)
    	{
    		PRI.SetCharacterMesh(None);
    		return;
    	}
    
    	// Kyle: Disabling the if statement to see if SendCharacterProcessingNotification helps get replication functioning
    	//if (!bProcessedInitialCharacters)
    	//{
    		// make sure local players have been informed if we're running the initial processing
    		SendCharacterProcessingNotification(true);
    	//}
    
    	// remove any previous mesh and arms
    	 if(!bLocalTeamChange)
    	 {
    		PRI.SetCharacterMesh(None);
    	 }
    	// Kyle: unkilled this function
    
    	PRI.SetFirstPersonArmInfo(None, None);
    
    	// See if the parts you picked are actually the default char
    	bDefaultCharParts = (class'UTCustomChar_Data'.static.CharDataToString(PRI.CharacterData) == "B,IRNM,A,C,NONE,NONE,B,A,A,A,A,T,T");
    
    	// First see if this PRI is already present (eg may have changed team)
    	bPRIAlreadyPresent = false;
    	for(i=0; i<CharStatus.Length; i++)
    	{
    		// It is there - reset and abandon any merge work so far.
    		if(CharStatus[i].PRI == PRI)
    		{
    			//`log("PRI in use - resetting:"@PRI);
    			// Kyle: ResetCharMerge(i);
    			// only do arms if we've already done initial characters
    			// Kyle: CharStatus[i].bNeedsArms = (bProcessedInitialCharacters && !WorldInfo.IsInSeamlessTravel() && PRI.IsLocalPlayerPRI()) || bDefaultCharParts;
    
    			bPRIAlreadyPresent = true;
    		}
    	}
    
    	// Was not there - add to end of the array
    	if(!bPRIAlreadyPresent)
    	{
    		//`log("Adding PRI:"@PRI);
    		NewCharStatus.PRI = PRI;
    		// only do arms if we've already done initial characters
    		NewCharStatus.bNeedsArms = (bProcessedInitialCharacters && !WorldInfo.IsInSeamlessTravel() && PRI.IsLocalPlayerPRI());
    
    		// Special case - when you actually picked the parts for the fallback mesh - just use that! Go straight to loading arms.
    		if(!NewCharStatus.bNeedsArms && bDefaultCharParts)
    		{
    			NewCharStatus.bNeedsArms = TRUE;
    		}
    
    		CharStatus[CharStatus.length] = NewCharStatus;
    
    		// Increment count of total players set to process (if we are not just asking for arms)
    		//if(!NewCharStatus.bNeedsArms)
    		//{
    		//	TotalPlayersSetToProcess++;
    		//}
    		// Kyle: disabled, but replaced outside the if
    
    		// destroy oldest cached data to make sure we have enough room
    		if (OldestCharacterCache != None)
    		{
    			OldestCharacterCache.Destroy();
    			WorldInfo.ForceGarbageCollection();
    		}
    	}
    	
    		if(!NewCharStatus.bNeedsArms)
    		{
    			TotalPlayersSetToProcess++;
    		}
    
    	SetTimer(1.0 / 60.0, true, 'TickCharacterMeshCreation');
    
    	// Start the character creation timer.
    	StartCreateCharTime = WorldInfo.RealTimeSeconds;
    }

  3. #3
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    79

    Default

    Oh thank you so much! I feel so stupid now; I opened the .u file and saw that the top was not legible, but I didn't scroll down to see if anything was. Saved me a ton of time reworking the base of the mod, thank you so much!

  4. #4
    MSgt. Shooter Person
    Join Date
    Aug 2006
    Location
    Dear Ole' Blighty.
    Posts
    281

    Default

    you can acheive de-compile by making a batch file (& without using UnrealEd) like this : http://www.youtube.com/watch?v=DT0RJkPGdTU

    If thats a little hard to see/read :

    "C:\Program Files\Unreal Tournament 3\Binaries\UT3.exe" batchexport %1 class .uc "THE FOLDER WHERE YOU WANT THE FILES TO GO HERE(i.e. C:\DECOMPILED U FILES)\%~n1\Classes\"

    Once you have your batch file made just drag and drop a .u file onto it
    System Specs: Sinclair ZX80.
    --------------------------------
    Custom UT3 Ladder Volume HERE.

  5. #5

    Default

    Using the batch file (or editor) to export will also show you the defaultproperties, though any Begin Object blocks will also contain some extra stuff that you cannot compile.

  6. #6
    MSgt. Shooter Person
    Join Date
    Nov 2007
    Posts
    79

    Default

    Awesome, the batch file worked great - got my default properties back. Thanks again guys!

  7. #7
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    In my maps
    Posts
    336
    Gamer IDs

    Gamertag: idnewton

    Default

    it doesnt work. tried the batchexport, doesnt work. unlike others i know, i DID get the batch file to 'work', but it doesnt export EVERYTHING, and as im sure you know, if you dont export everything, you cant recompile. so. any other options? i need something that will export EVERYTHING. WotGreal failed at that so i dont know what to use next.
    Mass Map Pack (aka Team Stealth Jumbo UT3 Pack) is currently in beta phase, check it out here: http://forums.epicgames.com/threads/...eta?p=29851355
    Need help with mutator! http://forums.epicgames.com/threads/...or!?p=29782758

  8. #8
    MSgt. Shooter Person
    Join Date
    Aug 2012
    Posts
    84

    Default

    sorry for necro

    so then pretty much mysql in udk is thrashed because anyone can decompile and see connection info...

  9. #9
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    402

    Default

    What are you trying to do? MySQL connections are generally performed server sided. You can also use config fields so the values are not hardcoded.

    Try to use DLLBind and move the important code into DLLs.
    http://udn.epicgames.com/Three/DLLBind.html

  10. #10
    MSgt. Shooter Person
    Join Date
    Jan 2011
    Location
    In my maps
    Posts
    336
    Gamer IDs

    Gamertag: idnewton

    Default

    Actually, I was wrong. I've retried it many times but I can't even compile ANY mod, so I think it's on my end. I tried re-installing, but then lost interest in the mod and restored all my files and patches to play the game again. But when I was interested in doing this, I believe I came to the conclusion that you cannot compile a mod with the patched Unreal Tournament 3. This may be, and probably is, wrong, but thats what I think. Anyways, what matters is, my computer doesn't seem to be able to compile any mod, decompiled or built from scratch. So... SteelerWolf was right on.
    Mass Map Pack (aka Team Stealth Jumbo UT3 Pack) is currently in beta phase, check it out here: http://forums.epicgames.com/threads/...eta?p=29851355
    Need help with mutator! http://forums.epicgames.com/threads/...or!?p=29782758

  11. #11
    MSgt. Shooter Person
    Join Date
    Jun 2009
    Posts
    402

    Default

    What are you trying? The method is about to get the UnrealScript source code from a non-stripped binary file. Generally, there should be no intereset in having such files decompiled. What's your purpose? Maybe you can get in contact with the author, which will help a lot instead of recompiling (/stealing) somebody else's work.

    And there is a method in having binary files back into readable source.

  12. #12
    MSgt. Shooter Person
    Join Date
    Aug 2012
    Posts
    84

    Default

    decompressor http://www.gildor.org/down/30/umodel/decompress.zip
    decompiler http://eliotvu.com/portfolio/view/21/ue-explorer

    for any .u binary or stripped dont matter.

  13. #13

    Default

    Note that decompilers' primary goal is to create readable files. Those are different from the original files and often they won't even compile.
    Wormbo's UT/UT2004/UT3 mods | PlanetJailbreak | Unreal Wiki | Liandri Archives

    <elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
    <TNSe> nono
    <TNSe> its always funny to find code a week later you dont even remember writing
    <Pfhoenix> what's worse is when you have a Star Wars moment
    <Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
    Note that your questions via PMs will be ignored if they actually belong in the forum.

  14. #14
    MSgt. Shooter Person
    Join Date
    Aug 2012
    Posts
    84

    Default

    the files the decompiler produces are 1:1.


 

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Copyright ©2009-2011 Epic Games, Inc. All Rights Reserved.
Digital Point modules: Sphinx-based search vBulletin skin by CompletevB.com.