Forum

ASSIST, AMERICA'S ARMY COMMUNITY - RELIVE THE GLORY DAYS OF AMERICA'S ARMY 2.5

Author Topic: Need a pascal programming expert  (Read 7979 times)

0 Members and 1 Guest are viewing this topic.

Offline -{DG}-_Shadow

Need a pascal programming expert
« on: Tuesday, April 07, 2015, 17:24:28 PM »
Hi, I need a pascal programming expert to decompile the AAO Native functions. Does anyone know pascal here?

I looked at pascal and find it a strange programming language.

Offline teddy_grizzly_bear

  • Used to be known as nobody
  • Administrator
  • Epic Poster
  • *
  • Posts: 5,699
  • what are you looking at?
    • View Profile
  • AA: teddy_grizzIy_bear
Re: Need a pascal programming expert
« Reply #1 on: Tuesday, April 07, 2015, 17:32:25 PM »
Must be 6-7 years since I did anything in Pascal and I wasn't even an expert back then. From what I remember it's a kind of basic language that requires quite a lot from the programmer.
<image removed due to imgur stuff - probably for the best>

"Mathematics may be defined as the subject in which we never know what we are talking about, nor whether what we are saying is true." Bertrand Russell

Offline Possessed

  • bWpnRecoil == False;
  • Administrator
  • Epic Poster
  • *
  • Posts: 3,620
  • You suffer, but why?!
    • View Profile
  • AA: Possessed
Re: Need a pascal programming expert
« Reply #2 on: Tuesday, April 07, 2015, 17:55:07 PM »
Hi, I need a pascal programming expert to decompile the AAO Native functions. Does anyone know pascal here?

I looked at pascal and find it a strange programming language.
Contact ELiZ, he should know what you're looking for ;)
Messing with UTPT source?
These things I have spoken unto you, that in me ye might have peace. In the world ye shall have tribulation: but be of good cheer; I have overcome the world.
John 16:33


Offline Spanky

  • <?php echo $opinion .' is better.'; ?>
  • Administrator
  • Posts like a Spanky!
  • *
  • Posts: 10,893
    • View Profile
    • NatesComp.com
  • AA: tigobitties
Re: Need a pascal programming expert
« Reply #3 on: Tuesday, April 07, 2015, 18:45:56 PM »
Probably something you'd want to ask about on StackOverflow.

Glad to see you made it to the forums :)
It's like shaving your pubes to make your junk look bigger.
Might look bigger, but it aint.....

Offline ELiZ

Re: Need a pascal programming expert
« Reply #4 on: Tuesday, April 07, 2015, 20:18:14 PM »
Do you mean that you want to decompile the Calls in unrealscript like these by looking at the source of UTPT like possessed suggested?
Quote
native(4000) final Function InitRotRand (RotationRandomizer R);
native(4001) final Function Rotator CalcRotation (RotationRandomizer R);
native(4002) final Function Vector CalcDirection (RotationRandomizer R, Rotator BaseRot);
native final Function Int GetVersionWarfareEngine ();
native final Function Int GetVersionAGPMajor ();
native final Function Int GetVersionAGPMinor ();
native final Function Int GetVersionAGPTiny ();
native final Function Int GetPlatform ();
native final Function Bool IsDebugBuild ();
native final Function Int GetPrivateProfileInt (string Filename, string Section, string Key);
native final Function String GetPrivateProfileString (string Filename, string Section, string Key);
native final Function String GetBaseDir ();
native final Function Bool CreateDir (string sDirPath);
native final Function String GetSystemTimeForFileName ();
native final Function SetPrivateProfileInt (int Set, string Filename, string Section, string Key);
native final Function SetPrivateProfileString (string Set, string Filename, string Section, string Key);
native final Function SavePrivateProfile (string Filename);
native final Function String FLoad (string szInput);
native final Function String FUnload (string szInput);
native final Function Bool FOpen (string szFilename);
native final Function Bool FOpenWrite (string szFilename);
native final Function Bool FReadLine (out string szLine);
native final Function Bool FWriteLine (string szLine);
native final Function Bool FWrite (string szData);
native final Function Bool FClose ();
native final Function Bool FDelete (string Filename);
native final Function String Extract (string szInput, string szKey);
native final Function String Compress (string szInput, string szKey);
native final Function String GetInputKeyString (int iKey);
native final Function Int PrivateSet (string szCommand);
native final Function Bool LogFileOpen ();
native final Function Bool LogFileWrite (string szType, string szMessage, optional bool bFlush);
native final Function Bool LogFileClose ();
native final Function Bool PlatformIsMacOS ();
native final Function Bool PlatformIsUnix ();
native final Function Bool PlatformIsWindows ();
native final Function Bool PlatformIs64Bit ();


I see no other use, or do you have a c++ decompiler  someone wrote in pascal?

Offline -{DG}-_Shadow

Re: Need a pascal programming expert
« Reply #5 on: Wednesday, April 08, 2015, 01:52:19 AM »
what i basicly want is to know how the UT_Packages convert the array it generates to bytecodes.

The list i want: (can also be found in UnStack.h)
Code: [Select]
  EX_LocalVariable = $00;
  EX_InstanceVariable = $01;
  EX_DefaultVariable = $02;
  EX_UnknownVariable =$03; // TODO : {UT2003} unknown opcode
  EX_Return = $04;
  EX_Switch = $05;
  EX_Jump = $06;
  EX_JumpIfNot = $07;
  EX_Stop = $08;
  EX_Assert = $09;
  EX_Case = $0A;
  EX_Nothing = $0B;
  EX_LabelTable = $0C;
  EX_GotoLabel = $0D;
  EX_EatString = $0E;
  EX_Let = $0F;
  EX_DynArrayElement = $10;
  EX_New = $11;
  EX_ClassContext = $12;
  EX_Metacast = $13;
  EX_LetBool = $14;
  EX_Unknown_jumpover = $15;            // ??? only seen on old packages (v61) at end of functions and in mid of code
  EX_EndFunctionParms = $16;
  EX_Self = $17;
  EX_Skip = $18;
  EX_Context = $19;
  EX_ArrayElement = $1A;
  EX_VirtualFunction = $1B;
  EX_FinalFunction = $1C;
  EX_IntConst = $1D;
  EX_FloatConst = $1E;
  EX_StringConst = $1F;
  EX_ObjectConst = $20;
  EX_NameConst = $21;
  EX_RotationConst = $22;
  EX_VectorConst = $23;
  EX_ByteConst = $24;
  EX_IntZero = $25;
  EX_IntOne = $26;
  EX_True = $27;
  EX_False = $28;
  EX_NativeParm = $29;
  EX_NoObject = $2A;
  EX_Unknown_jumpover2 = $2B;           // ??? only seen on old packages (v61)
  EX_IntConstByte = $2C;
  EX_BoolVariable = $2D;
  EX_DynamicCast = $2E;
  EX_Iterator = $2F;
  EX_IteratorPop = $30;
  EX_IteratorNext = $31;
  EX_StructCmpEq = $32;
  EX_StructCmpNe = $33;
  EX_UnicodeStringConst = $34;
  // =$35
  EX_StructMember = $36;
  EX_Length = $37; // UT2003
  EX_GlobalFunction = $38;
  EX_RotatorToVector = $39; // maybe it is another thing??? an invisible conversion?
  EX_ByteToInt = $3A;
  EX_ByteToBool = $3B;
  EX_ByteToFloat = $3C;
  EX_IntToByte = $3D;
  EX_IntToBool = $3E;
  EX_IntToFloat = $3F;
  EX_BoolToByte = $40;
  EX_BoolToInt = $41;
  EX_Remove = $41; // redefined?
  EX_BoolToFloat = $42;
  EX_FloatToByte = $43;
  EX_DelegateCall = $43; // redefined?
  EX_FloatToInt = $44;
  EX_FloatToBool = $45;
  EX_StringToName = $46;                // not defined in UT source, but used in unrealscript
  EX_ObjectToBool = $47;
  EX_NameToBool = $48;
  EX_StringToByte = $49;
  EX_StringToInt = $4A;
  EX_StringToBool = $4B;
  EX_StringToFloat = $4C;
  EX_StringToVector = $4D;
  EX_StringToRotator = $4E;
  EX_VectorToBool = $4F;
  EX_VectorToRotator = $50;
  EX_RotatorToBool = $51;
  EX_ByteToString = $52;
  EX_IntToString = $53;
  EX_BoolToString = $54;
  EX_FloatToString = $55;
  EX_ObjectToString = $56;
  EX_NameToString = $57;
  EX_VectorToString = $58;
  EX_RotatorToString = $59;
  EX_StringToName2 = $5A; // a duplicated opcode found in XIII
  EX_Unknown5B =$5B; // un

Offline -{DG}-_Shadow

Re: Need a pascal programming expert
« Reply #6 on: Wednesday, April 08, 2015, 01:53:31 AM »
The list generated by utpt:
Code: [Select]
NativeFunctions_: array[0..228] of TNativeFunction = (
    {0000} (Index:00112;Format:nffOperator    ;OperatorPrecedence:040;Name:'$'                      ), // Core.u (aao)
    {0001} (Index:00113;Format:nffFunction    ;OperatorPrecedence:000;Name:'GotoState'              ), // Core.u (aao)
    {0002} (Index:00114;Format:nffOperator    ;OperatorPrecedence:024;Name:'=='                     ), // Core.u (aao)
    {0003} (Index:00115;Format:nffOperator    ;OperatorPrecedence:024;Name:'<'                      ), // Core.u (aao)
 ...
    );

Offline -{DG}-_Shadow

Re: Need a pascal programming expert
« Reply #7 on: Wednesday, April 08, 2015, 01:55:00 AM »
The code that generates this array:
Code: [Select]
for a:=0 to package.ExportedCount-1 do
                     if lowercase(package.Exported[a].UTClassName)='function' then
                        begin
                        obj:=TUTObjectClassFunction(package.Exported[a].UTObject);
                        obj.UTClassName;
                        try
                          obj.ReadObject;
                        except
                          on e:exception do
                             begin
                             msg:=format('Exception in function %s.%s'#13#10+e.message,[extractfilename(sr.name),package.Exported[a].UTobjectname]);
                             memo.lines.add (msg);
                             //application.messagebox (pchar(msg),'ERROR',mb_ok);
                             end;
                        end;
                        if ((obj.functionflags and FUNC_Native)<>0) and
                           ((obj.functionflags and FUNC_Event)=0){ and
                           (obj.NativeIndex<>0)} then
                           begin
                           indice:=inttostr(obj.NativeIndex);
                           precedence:=obj.OperatorPrecedence;
                           //if precedence=0 then precedence:=255;
                           nombre:=obj.friendlyname;
                           if (obj.functionflags and FUNC_Operator)<>0 then
                              begin
                              if (obj.functionflags and FUNC_PreOperator)<>0 then
                                 formato:='nffPreOperator'
                              else if precedence=0 then
                                 formato:='nffPostOperator'
                              else
                                 formato:='nffOperator';
                              end
                           else
                              formato:='nffFunction';
                           if cuenta>high(juegos[high(juegos)]) then setlength(juegos[high(juegos)],length(juegos[high(juegos)])*2);
                           with juegos[high(juegos)][cuenta] do
                                begin
                                index:=strtointdef(indice,-1);
                                format:=formato;
                                operatorprecedence:=precedence;
                                name:=nombre;
                                package:=extractfilename(sr.name);
                                end;
                           inc(cuenta);
                           end;
                        obj.ReleaseObject;
                        end;
                 package.free;
                 e:=findnext(sr);
                 end;

However, this array is used further in the code and is propably converted to bytes. However i do not understand enough of pascal to decrypt it.




Offline Possessed

  • bWpnRecoil == False;
  • Administrator
  • Epic Poster
  • *
  • Posts: 3,620
  • You suffer, but why?!
    • View Profile
  • AA: Possessed
Re: Need a pascal programming expert
« Reply #8 on: Wednesday, April 08, 2015, 01:58:18 AM »
I have the tokens for 2.6 at home, I will try to find them elsewhere
These things I have spoken unto you, that in me ye might have peace. In the world ye shall have tribulation: but be of good cheer; I have overcome the world.
John 16:33


Offline -{DG}-_Shadow

Re: Need a pascal programming expert
« Reply #9 on: Wednesday, April 08, 2015, 02:05:28 AM »
I also have those, but 2.6 has different tokens. I think the tokens are simulair to unreal tournament, but not 100% sure.

Offline ELiZ

Re: Need a pascal programming expert
« Reply #10 on: Wednesday, April 08, 2015, 03:48:08 AM »
I did some Pacal 25 years ago, along with another classic language Fortran as a part of a class I took.
However that will not help a lot since the pasted code is not all that is needed, there is more classes, as reading the code from the functions, and also the class definitions are missing.

I have a complete list of the 289 native functions, and the corresponding info(iNative,OperatorPrecedence and type).

But I will need some information first, the most critical would be, what do you need it for?

Offline ELiZ

Re: Need a pascal programming expert
« Reply #11 on: Wednesday, April 08, 2015, 04:10:26 AM »
As seen here from a SS in UTPT, INative,OperatorPresedence and Functionflags are in the end of the function, so you will have to be able to read the code statements to be able to get to right location inside the function to be able to read those properties. The only "easy" part to read is the FriendlyName("++" or "--"), since that is the 6:th index from the start of the function.

Offline NoBigDeal

  • Loyal Member
  • ****
  • Posts: 410
  • Banned
    • View Profile
Re: Need a pascal programming expert
« Reply #12 on: Thursday, April 09, 2015, 14:35:59 PM »
The code that generates this array:
Code: [Select]
for a:=0 to package.ExportedCount-1 do
                     if lowercase(package.Exported[a].UTClassName)='function' then
                        begin
                        obj:=TUTObjectClassFunction(package.Exported[a].UTObject);
                        obj.UTClassName;
                        try
                          obj.ReadObject;
                        except
                          on e:exception do
                             begin
                             msg:=format('Exception in function %s.%s'#13#10+e.message,[extractfilename(sr.name),package.Exported[a].UTobjectname]);
                             memo.lines.add (msg);
                             //application.messagebox (pchar(msg),'ERROR',mb_ok);
                             end;
                        end;
                        if ((obj.functionflags and FUNC_Native)<>0) and
                           ((obj.functionflags and FUNC_Event)=0){ and
                           (obj.NativeIndex<>0)} then
                           begin
                           indice:=inttostr(obj.NativeIndex);
                           precedence:=obj.OperatorPrecedence;
                           //if precedence=0 then precedence:=255;
                           nombre:=obj.friendlyname;
                           if (obj.functionflags and FUNC_Operator)<>0 then
                              begin
                              if (obj.functionflags and FUNC_PreOperator)<>0 then
                                 formato:='nffPreOperator'
                              else if precedence=0 then
                                 formato:='nffPostOperator'
                              else
                                 formato:='nffOperator';
                              end
                           else
                              formato:='nffFunction';
                           if cuenta>high(juegos[high(juegos)]) then setlength(juegos[high(juegos)],length(juegos[high(juegos)])*2);
                           with juegos[high(juegos)][cuenta] do
                                begin
                                index:=strtointdef(indice,-1);
                                format:=formato;
                                operatorprecedence:=precedence;
                                name:=nombre;
                                package:=extractfilename(sr.name);
                                end;
                           inc(cuenta);
                           end;
                        obj.ReleaseObject;
                        end;
                 package.free;
                 e:=findnext(sr);
                 end;

However, this array is used further in the code and is propably converted to bytes. However i do not understand enough of pascal to decrypt it.




I believe, this snippet comes from Antonio Cordero NativeFunctionArrayGenerator - you're trying to rewrite?
What if you could change the world by changing your perspective of it?
Would you?

Offline -{DG}-_Shadow

Re: Need a pascal programming expert
« Reply #13 on: Friday, April 10, 2015, 18:11:17 PM »
thanks for the replies,

it is indeed the NativeFunctionArrayGenerator from Antonio Cordero. I am not trying to rewrite, just trying to understand how it finds what the uscript bytes mean.

ELIZ, looks like you know a bit about this. so if we continue on your example the ++

Code: [Select]
    {0025} (Index:00137;Format:nffPreOperator ;OperatorPrecedence:000;Name:'++'                     ), // Core.u (aao)
    {0027} (Index:00139;Format:nffPostOperator;OperatorPrecedence:000;Name:'++'                     ), // Core.u (aao)
    {0051} (Index:00163;Format:nffPreOperator ;OperatorPrecedence:000;Name:'++'                     ), // Core.u (aao)
    {0053} (Index:00165;Format:nffPostOperator;OperatorPrecedence:000;Name:'++'                     ), // Core.u (aao)


How would i now know, looking at utpt and these native function, what the byte meaning is in uscript??

Does it mean 0x01, 0x34, 0x02 and 0x00 mean something  in uscript bytes?

Offline -{DG}-_Shadow

Re: Need a pascal programming expert
« Reply #14 on: Friday, April 10, 2015, 19:05:39 PM »
I think i almost got it. now just need to find a way to verify if the offsets are actually the byte opcodes

Code: [Select]
pFunction inative:0X70 int:112 offset:0X0 Fullname: Function Core.Object.Concat_StrStr
pFunction inative:0X71 int:113 offset:0X1 Fullname: Function Core.Object.GotoState
pFunction inative:0X72 int:114 offset:0X2 Fullname: Function Core.Object.EqualEqual_ObjectObject
pFunction inative:0X73 int:115 offset:0X3 Fullname: Function Core.Object.Less_StrStr
pFunction inative:0X74 int:116 offset:0X4 Fullname: Function Core.Object.Greater_StrStr
pFunction inative:0X75 int:117 offset:0X5 Fullname: Function Core.Object.Enable
pFunction inative:0X76 int:118 offset:0X6 Fullname: Function Core.Object.Disable
pFunction inative:0X77 int:119 offset:0X7 Fullname: Function Core.Object.NotEqual_ObjectObject
pFunction inative:0X78 int:120 offset:0X8 Fullname: Function Core.Object.LessEqual_StrStr
pFunction inative:0X79 int:121 offset:0X9 Fullname: Function Core.Object.GreaterEqual_StrStr
pFunction inative:0X7a int:122 offset:0Xa Fullname: Function Core.Object.EqualEqual_StrStr
pFunction inative:0X7b int:123 offset:0Xb Fullname: Function Core.Object.NotEqual_StrStr
pFunction inative:0X7c int:124 offset:0Xc Fullname: Function Core.Object.ComplementEqual_StrStr
pFunction inative:0X7d int:125 offset:0Xd Fullname: Function Core.Object.Len
pFunction inative:0X7e int:126 offset:0Xe Fullname: Function Core.Object.InStr
pFunction inative:0X7f int:127 offset:0Xf Fullname: Function Core.Object.Mid
pFunction inative:0X80 int:128 offset:0X10 Fullname: Function Core.Object.Left
pFunction inative:0X81 int:129 offset:0X11 Fullname: Function Core.Object.Not_PreBool
..... (more)
« Last Edit: Friday, April 10, 2015, 20:00:47 PM by -{DG}-_Shadow »

 

Download Assist

×

Download Game Client

Important: Battletracker no longer exists. However, old Battletracker accounts may still work. You can create a new 25Assist account here

Download Server Manager