RSS

Recognizing Various Code Obfuscation Techniqes

28 Dec

This is dedicated to anybody else that finds  ‘protected’  mods  annoying  could also concern people thate port mods or content to differnt version of the game.

This is a sketchy and foggy avenue to go down,  Since it could lead to stealing others works , But that not what this article concerns. This atricle is just for  average users to understand what there looking at  and advanced users to let them uderstand  what doing on in these mods if that what they wish to do.

All the tools in this post are already public knowledge and freely avalible in many ut sites.

Here i will talk about and explain the levels of code protection obfuscation people use protect .u script files. and how to identify them.

I understand if you protect your anti cheat engine , or some piece of your gametype to prevent cheating , Or if your mod is part of a commercal product and you want to protect your product ETC.  Tho are valide uses.

If you protect your files ( Especaly from modification and adjustment) people  wont be able to fix future issue that may pop up or port you work to a differnt gametype  or  platform.  – ‘contact the auther  for code’ dont work when the auther dosnt play unreal anymore. or himself dosnt have thew code anymore.

If I like your work , and I want to add  a feature to your mod and i cant. I will simply not use it and find another that works  as a base. You Lose me as a user.

example : i like jcoopz , but it doesnt have half the features that xcoop does so jcoop loses and i use xcoop for heavy  modded games.

I also like looking at others work for FUN.

I would cache some scriptfile and open it in notepad to see what wonderful magic you did. Mabye you use some ‘undocumneted’ funtions like allobjects  to replace textures, or I will discover how you embeded a dll into a file using mucis factory ?wtf?. Mabye you use some higher perfomace code then i used in some project , and i find a way to optimize my work just by looking at yours. I also like looking at comments and seeing how others write code and the varible name they choose. it says alot about a person.

so we get to the point of this article understanding code obfuscation…

code obfuscation mean that you hide what your code does of mask it in such a way that it the end user cant see whats going on.

There are like 3 or 4 levels of code protections , some simple , some requiring tools.

Method 1 : Delete text buffers ‘Remove Script Text’

This is pretty common ‘protection’. its not protection always. many people like to delete the code to save space in there mods.

If the authur left in the class definitions , you can somtime use ucc -batchdecompile to export fully working scripts anyway!

if not This is defetable using UTPT , Although it will only help you get a idea of the code , and many times it will decompile improperly.

You can rebuild the origianl work from this point, But you would need to decide whether it is worth your time or if your time would better be spent writing the script from scratch. You will need a pretty good understanting of how unrealscript works and what to expect from utpt if you decide to work from this  output.   The demcompile tends to eat  for loops and control structure and add gotos, But it is possible  in many cases to create working code from this..

this also makes it impossible for the unrealediter to compile anything else if  the package is loaded which is a huge detriment to using the editor for anything while you have these packages open.

example :

Method 2 : using a extenal tool

This is when it gets complex. You can get a tool online if you look hard enought that will make your work unrecoverable. I wont name it here  or give a link , but it basicly obfuscates the compiled machinecode in the file so decompiles  produce total rubish. but you could still extract the  class names

The thing about this is that you can selectivly obfuscate classes , so only your secrurity functions are hidden from view

Method 3:  obfuscating nametables using enctpted code

This is the same as method 2 except it overides or encrypts the name tables. which not only produces garbage , But chokes the decompiler into crahsing if the encrypted classes are attemped to be decompiled.

also if any attempts are made to rename the nametables  to allow the files to open( hex editor?) , you destroy export code in the proccess.

you can see this example by opening unrealintegrity227. The class name in he actor brower are cryptic names. or in utpt as a’ stream read error’

Methed 4 :

use the encrypted flag. I only ever saw this once but basicly it tells the decomiler ‘haha’ and it wont open. May be defetable with a hex editor… but i dont have a reason to find out.

————————————————————————

Well i explained this just incase somone cared and to better undersand what you see , I dont recommend you go run out and steal peoples work. there are cases where you may need to decopile code for re use or  to repair a buggy mod , or in the ripping  process or converting mods to work with your platform.

Advertisements
 
Leave a comment

Posted by on December 28, 2011 in off topic

 

Tags: , , , , , , , ,

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s