That looks interesting, but I couldn't find out what type of file it was. The closest I got was "maybe some type of Ghost Recon mission script", without any explanation as to how those things work.
Purely going by the contents, I guess that
1 introduces an import
2 introduces a field declaration
3 introduces a method declaration
4 "opens" a class declaration
5 "closes" a class declaration
It's a little tricky to read it like this, I'm used to being able to select the text and see the corresponding bytes highlighted.
You are exactly right, with your explenation it is a ghost recon Advanced warfighter 2
Deisel script file, I have a console aplication that compiles file extention *.dsf to *.dxe
that is what you see in hex is the dxe file.
What I am working on is decompileing them back to dsf
here is some of the c# code I have so far:
private void Openfile(string file)
lastNode = new System.Windows.Forms.TreeNode(System.IO.Path.GetFileName(file_path));
var d = new dxe_dasm.Program.ScriptDecompiler();
d.FoundClassCallback = new dxe_dasm.Program.ScriptDecompiler();
d.FoundMethodCallback = new dxe_dasm.Program.ScriptDecompiler();
d.FoundMemberVarCallback = new dxe_dasm.Program.ScriptDecompiler();
d.FoundGlobalVarCallback = new dxe_dasm.Program.ScriptDecompiler();
d.FoundImportCallback = new dxe_dasm.Program.ScriptDecompiler();
d.FoundEndOfCassCallback = new dxe_dasm.Program.ScriptDecompiler();
d.DecompileHeader = file;
public void CallbackFoundMethod(string file)
public void CallbackFoundVarMember(string file)
public void CallbackFoundVarGlobal(string file)
public void CallbackFoundImport(string file)
public void CallbackFoundEndOfClass(string file)
static class Program
/// The main entry point for the application.
static void Main()
internal class ScriptDecompiler
public ScriptDecompiler FoundClassCallback;
public ScriptDecompiler FoundEndOfCassCallback;
public ScriptDecompiler FoundGlobalVarCallback;
public ScriptDecompiler FoundImportCallback;
public ScriptDecompiler FoundMemberVarCallback;
public ScriptDecompiler FoundMethodCallback;
internal object DecompileHeader
if (value == null)
throw new ArgumentNullException("file");
throw new NotImplementedException();
public string Decompile(object o)
throw new NotImplementedException();
some help with this would be great
my program will load a dxe file and decompile it bakk to dsf
I'm going to have to use some java code for the script enum though
I'm also studying up on decompilation_thesis Reverse Conpilation Techniques by Cristina Cifuentes
I will be applying alot of her techniques in the control flow graph
aswell as some techniques from Redgates .net decompiler
I hope some fellow programmers can help me with this task.
It would be easier to help if you had a specific problem that you needed help with, giving help at random harder.
But I can make a couple of remarks.
Making several instances of the decompiler to bind to the different callbacks is probably a bad thing. The decompiler object has to receive all those callbacks, otherwise it effectively only sees part of the script.
Import = 0x01,
Field = 0x02,
Class = 0x03,
Assembly = 0x04,
Script = 0x05
is weird. The flags attribute is meant to be used for enums that contains a bunch of power of two's that can be combined, and that's not what this enum is.
07 makes a string
2C seems to access named fields/functions
0E XX loads a field of a this object? XX is index of field?
06 starts the body of a function?
0A ends the body of a function?
29 4A has something to do with returning?
29 5B has something to do with branching?
I'm not sure about anything any more. Especially not what happens to integers. I've tried many forms of "return 12345" and the results are just .. weird.
I compile very simple code, then I change 1 thing in it and compile it again, then I look at what changed in the output.
As for integers, I've figured that out: there are no integers, only floats.
06 XX XX XX XX loads a 32bit floating point number, stored with the bytes in reversed order.
So 06 can't also be the start of a function, I'm not yet sure what's up.
16 is addition, it looks like it "pops" two things and pushes the result.
17 is subtraction
18 is multiplication
44584500 72000000 00000000 07E54100 // header stuff?
01 // import
756E6974 732E7479 7065732E 42617365 00 // import name
04 // class
54657374 00 // class name
02 // field
5F666972 737400 // field name
02 // field
5F736563 6F6E6400 // field name
03 // function def
50000000 // pointer to function code (little endian, add 0x10)
736F6D65 66756E63 74696F6E 00 // fundtion name
03 // function def
64000000 // pointer to function
6F746865 7266756E 6374696F 6E00 // function name
05 // end of class?
00 // ???
27 // ?? always seems to start a function, no idea what it does
00 // possibly an argument to the 27?
06 0000803F // load 1
0E 03 // load 3rd thingy of this-object (otherfunction)
2D 00 2F // probably something to do with invoking that function
19 // the division
29 63000000 // jump to 00000063 ?? (see label1)
0A // dunno, always seen near the end of a function
00 // dunno either, always at the end of a function, label1 points here
27 // already covered
06 0000803F // load 1
29 71000000 // jump to label2
0A // ??
00 // label2 points here
Label refs are little endian absolute addresses and start at 0 directly after the 16-byte header.
you see if I can get a good decompiler for the dxe files
I can add new vehicles to the game, like boats and new tanks
cause right now there are no boats in it and you can only mount
ground guns. You can't drive anything or mount any of the guns on the vehicles
but ai can, so that just means we will be able too
I have made new vehicles with 3ds max and right now I can only replace one of the ingame
vehicles, but I did manage to get the Stryker and apache working and they only worked
in the first version of the game but not in the 2nd version
if you've never seen it or tried it, it's an Awesome first person shooter
it uses XML files for the mission scrips so thats easy amd even comes with
a map editor so you can create your own missions
this game has been out for a long time and will never get old
because of the new missions
I have also modded all of the Grand theft auto versions aswell
well enough of that, I'm rammbling
check out Cristina Cifuentes reverse techniques now that is a smart woman
I have this code so far, and am having issues with lining up the information output correctly. I'm not sure what I'm doing wrong at the moment. It's mainly the bold section that I can't get to output correctly
There are a number of problems there, such as this:
for (int x = 0; x < NUM_DASHES; ++x) ;
Which does nothing.
And the very wasteful way you are assembling strings: they are immutable, remember, which means that each time you add two strings, you create a new, bigger string and copy both originals into it. You should consider looking at StringBuilder if you are going to do that in future.
But...as Mycroft said, a monospaced font and manual padding will work.
I just wouldn't do it.
Instead, I would use a DataGridView to display the data - it's a lot prettier, a lot more flexible, a lot friendlier for the user, and once you are used to it a lot easier to use.
Try it! Drag one onto your form, and give it 5 columns, with appropriate headings.
Then just add rows - MSDN will help you with an example.
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
i want to open emplyee profile by clicking datagrivew cell how it possible ? first i load all emplyees in datagribview and now i want to make click event on employee to show it profile in other form...
Add an event handler for the function you wish to capture: CellClick, CellDoubleClick etc. You can do this in the properties window of the DataGridView, or just double click in the cell in the Form Design window in Visual Studio.
In above sample project ,i can able to serialize the input data but after serialization successful i can't do deserialization ,it throws some exception.Please give some solution .If unable to deserialize hexadecimal to ascii from serialized data means why should you allow to serialize the ascii characters?
What's in your file that you serialize is not a representation of a hexadecimal value: it's the character-code "3," which is turned into a glyph when you see it on screen that looks like a super-scripted tiny "L." The CodeProject editor here will not display that character-code.
The writing process, whether you use StreamWriter or XmlWriter, cannot know your intent from such "raw" use of character codes outside the usual range.
The solution is to express your intent that the content is hexadecimal by using an Xml "legal" data format like
Which will serialize (if you use an XmlWriter) to:
<?xml version="1.0" encoding="utf-8"?><TestClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><No>25</No><Name>TestUser</Name><Address>No 4,East St</Address><AsciiCharactors> 1#x3;: a
The legal formats for Xml are provided in this document: [^]. Note the following:
"If the character reference begins with " &#x ", the digits and letters up to the terminating ; provide a hexadecimal representation of the character's code point in ISO/IEC 10646. If it begins just with " &# ", the digits up to the terminating ; provide a decimal representation of the character's code point."
If you used the format " &#x??; ":
... not able to display that format correctly using CodeProject's editor ...
You would get this as output (using XmlWriter):
<TestClass xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><No>25</No><Name>TestUser</Name><Address>No 4,East St</Address><AsciiCharactors> 1: a
“But I don't want to go among mad people,” Alice remarked.
“Oh, you can't help that,” said the Cat: “we're all mad here. I'm mad. You're mad.”
“How do you know I'm mad?” said Alice.
“You must be," said the Cat, or you wouldn't have come here.” Lewis Carroll
modified 15-Feb-14 5:39am.
Last Visit: 31-Dec-99 19:00 Last Update: 29-Jan-23 19:45