Welcome!

Join our community of MMORPG enthusiasts and private server developers! By registering, you'll gain access to in-depth discussions on source codes, binaries, and the latest developments in MMORPG server files. Collaborate with like-minded individuals, explore tutorials, and share insights on building and optimizing private servers. Join us today and unlock the full potential of MMORPG server development!

Join Today!

[Delphi - Source] decrypt MuError.log

Joined
Jul 15, 2004
Messages
1,207
Reaction score
689
And here goes another LOLCODE..

mauka - [Delphi - Source] decrypt MuError.log - RaGEZONE Forums

Code:
unit Unit16;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;

type
  TForm16 = class(TForm)
    Memo1: TMemo;
    Button1: TButton;
    procedure FormCreate(Sender: TObject);
    procedure Button1Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form16: TForm16;

implementation

{$R *.dfm}

function Decrypt (var Buffer: TBytes): string;
const
 XorKey: array [0 .. 15] of Byte = ($7C, $BD, $81, $9F, $3D, $93, $E2, $56, $2A, $73, $D2, $3E, $F2, $83, $95, $BF);
var
 b: Byte;
 e: Integer;
begin
 e := 0;
 for b in Buffer do
  begin
   Result := Result + Chr(b xor XorKey[e mod 16]);
   inc(e, 1)
  end;
end;

procedure TForm16.Button1Click(Sender: TObject);
const
 MuError = 'C:\Program Files (x86)\WEBZEN\Mu\MuError.log';
var
 Fs: TStream;
 Buffer: TBytes;
begin
 try
  Fs := TFileStream.Create(MuError, fmOpenRead);
   try
    SetLength(Buffer, Fs.Size);
    Fs.Read(Buffer[0], Length(Buffer));
   finally
    Fs.Free;
   end;

  Memo1.Lines.Add(Decrypt(Buffer));
 except
  On E: Exception do
   Memo1.Lines.Add(Format('Failed to Open file with error: ',[E.Message]));
 end;
end;

procedure TForm16.FormCreate(Sender: TObject);
begin
 Memo1.Lines.Clear;
end;

end.

Did it for my own needs :glare:
 

Attachments

lol why you don't use this:

uses
Windows, Messages, SysUtils, Variants, Classes, Graphics,
Controls, Forms, Dialogs, StdCtrls;

instead of xxx.yyy ?

another thips for lazy peoples like me:

const
MuError = 'MuError.log';

Fs := TFileStream.Create(ExtractFilePath(paramstr(0))+MuError, fmOpenRead);
 
Last edited:
Ide auto add prefix to the Units
Code:
program Project10;

{$APPTYPE CONSOLE}

{$R *.res}

uses
  System.SysUtils;

begin
  try
    { TODO -oUser -cConsole Main : Insert code here }
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.
Code:
library Project10;

{ Important note about DLL memory management: ShareMem must be the
  first unit in your library's USES clause AND your project's (select
  Project-View Source) USES clause if your DLL exports any procedures or
  functions that pass strings as parameters or function results. This
  applies to all strings passed to and from your DLL--even those that
  are nested in records and classes. ShareMem is the interface unit to
  the BORLNDMM.DLL shared memory manager, which must be deployed along
  with your DLL. To avoid using BORLNDMM.DLL, pass string information
  using PChar or ShortString parameters. }

uses
  System.SysUtils,
  System.Classes;

{$R *.res}

begin
end.
U where thinking im add prefix manualy? xD
 
no i mean "why" asd :)

in all my project i always used only the class name like:
uses
SysUtils, Classes;

without the prefix (system.)
 
Im layze to explain, but prefixes is be cause of xPlatform etc..
reffer to guide if u wanna understand it


FM:
Code:
unit Unit18;

interface

uses
  System.SysUtils, System.Types, System.UITypes, System.Classes, System.Variants,
  FMX.Types, FMX.Controls, FMX.Forms, FMX.Dialogs;

type
  TForm18 = class(TForm3D)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form18: TForm18;

implementation

{$R *.fmx}

end.

Win:
Code:
unit Unit18;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs;

type
  TForm18 = class(TForm)
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form18: TForm18;

implementation

{$R *.dfm}

end.
 
Last edited:
i know that i mean why you still use the classes with the prefix fo their root :)
i'm coding with delphi from first release some thigs about it is known well :)
btw thanks for your share.
 
Back