Did it on request.. source and example without struct, nothing hard 2do struct for it and parse..
Ps. struct size is: ITEMTOOLTIP_BLOCK_SIZE
for me its looks like items.bmdCode:unit Unit19; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls; const ITEMTOOLTIP_SIZE = $2000; ITEMTOOLTIP_BLOCK_SIZE = $7C; type TForm19 = class(TForm) Button1: TButton; Log: TListView; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TBlock = array [0 .. ITEMTOOLTIP_BLOCK_SIZE -1] of Byte; PBlock = ^TBlock; TBlockRec = packed record ID: Word; Index: Word; Name: array [0 .. $63] of AnsiChar; Unk: array [0 .. $19] of Byte; end; PBlockRec = ^TBlockRec; TBlockArray = array [0 .. ITEMTOOLTIP_SIZE -1] of TBlock; PBlockArray = ^TBlockArray; TBlockRecArray = array of TBlockRec; var Form19: TForm19; implementation {$R *.dfm} function ReadBMDFile(const FileName: TFileName): TBytes; var Fs: TStream; begin Result := nil; try Fs := TFileStream.Create(FileName, fmOpenRead); try SetLength(Result, Fs.Size); Fs.Read(Result[0], Length(Result)); finally Fs.Free; end; except on E: Exception do MessageDlg('Failed to open file with error: ' + PWideChar(E.Message), mtError, [mbOK], 0); end; end; procedure Decrypt3Bytes (var Buffer: TBlock); const Key : array [0 .. 2] of Byte = ($FC, $CF, $AB); var i: Integer; begin for i := 0 to ITEMTOOLTIP_BLOCK_SIZE -1 do Buffer[i] := Buffer[i] xor Key[i mod 3]; end; function ToHex (Buffer: PByteArray; Size: Integer) :String; var i: integer; begin Result := ''; for i := 0 to Size - 1 do begin Result := Result + ' ' +IntToHex(Buffer[i],2); end; end; procedure TForm19.Button1Click(Sender: TObject); const FFFFFF = 'C:\Users\BMD - SMD\ItemTooltip_eng.bmd'; var Buffer: TBytes; BlockArray: TBlockArray; BlockRecArray: TBlockRecArray; I, E: Integer; S: string; begin Buffer := ReadBMDFile(FFFFFF); if Buffer = nil then Exit else begin BlockArray := PBlockArray(@Buffer[0])^; for i := 0 to ITEMTOOLTIP_SIZE -1 do Decrypt3Bytes(BlockArray[i]); for i := 0 to ITEMTOOLTIP_SIZE -1 do begin SetLength(BlockRecArray, High(BlockRecArray) +2); BlockRecArray[High(BlockRecArray)] := PBlockRec(@BlockArray[i])^; with Log.Items.Add do begin Caption := IntToStr(i); SubItems.Add(IntToStr(BlockRecArray[High(BlockRecArray)].ID)); SubItems.Add(IntToStr(BlockRecArray[High(BlockRecArray)].Index)); SubItems.Add(BlockRecArray[High(BlockRecArray)].Name); SubItems.Add(ToHex(@BlockRecArray[High(BlockRecArray)].Unk, $20)); end; end; end; end; end.
ItemLevelToolTip
Code:unit Unit19; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls; const ITEMLEVELTOOLTIP_SIZE = $80; ITEMLEVELTOOLTIP_BLOCK_SIZE = $66; type TForm19 = class(TForm) Log: TListView; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TBlock = array [0 .. ITEMLEVELTOOLTIP_BLOCK_SIZE -1] of Byte; PBlock = ^TBlock; TBlockArray = array [0 .. ITEMLEVELTOOLTIP_SIZE -1] of TBlock; PBlockArray = ^TBlockArray; TItemLevelToolLTip = packed record Unk0: Word; Name: array [0 .. $39] of AnsiChar; Unk1: array [0 .. $23] of Byte; end; PItemLevelToolLTip = ^TItemLevelToolLTip; TBlockRecArray = array of TItemLevelToolLTip; var Form19: TForm19; implementation {$R *.dfm} function ReadBMDFile(const FileName: TFileName): TBytes; var Fs: TStream; begin Result := nil; try Fs := TFileStream.Create(FileName, fmOpenRead); try SetLength(Result, Fs.Size); Fs.Read(Result[0], Length(Result)); finally Fs.Free; end; except on E: Exception do MessageDlg('Failed to open file with error: ' + PWideChar(E.Message), mtError, [mbOK], 0); end; end; procedure Decrypt3Bytes (var Buffer: TBlock); const Key : array [0 .. 2] of Byte = ($FC, $CF, $AB); var i: Integer; begin for i := 0 to ITEMLEVELTOOLTIP_BLOCK_SIZE -1 do Buffer[i] := Buffer[i] xor Key[i mod 3]; end; function ToHex (Buffer: PByteArray; Size: Integer) :String; var i: integer; begin Result := ''; for i := 0 to Size - 1 do begin Result := Result + ' ' +IntToHex(Buffer[i],2); end; end; procedure TForm19.Button1Click(Sender: TObject); const FFFFFF = 'C:\Program Files (x86)\WEBZEN\Mu\Data\Local\Eng\ItemLevelTooltip_eng.bmd'; var Buffer: TBytes; BlockArray: TBlockArray; BlockRecArray: TBlockRecArray; I, E: Integer; S: string; begin Buffer := ReadBMDFile(FFFFFF); if Buffer = nil then Exit else begin BlockArray := PBlockArray(@Buffer[0])^; for i := 0 to ITEMLEVELTOOLTIP_SIZE -1 do Decrypt3Bytes(BlockArray[i]); for i := 0 to ITEMLEVELTOOLTIP_SIZE -1 do begin SetLength(BlockRecArray, High(BlockRecArray) +2); BlockRecArray[High(BlockRecArray)] := PItemLevelToolLTip(@BlockArray[i])^; with Log.Items.Add do begin Caption := IntToStr(i); SubItems.Add(IntToStr(BlockRecArray[High(BlockRecArray)].Unk0)); SubItems.Add(BlockRecArray[High(BlockRecArray)].Name); SubItems.Add(ToHex(@BlockRecArray[High(BlockRecArray)].Unk1, $20)); end; end; end; end; end.
ItemtooltipText
Note! Reversed from current GMO client (S6 ep2 r ep3)Code:unit Unit21; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.ComCtrls; const ITEMTOOLTIPTEXT_SIZE = $200; ITEMTOOLTIPTEXT_BLOCK_SIZE = $104; type TForm21 = class(TForm) Log: TListView; Button1: TButton; procedure Button1Click(Sender: TObject); private { Private declarations } public { Public declarations } end; TBlock = array [0 .. ITEMTOOLTIPTEXT_BLOCK_SIZE -1] of Byte; PBlock = ^TBlock; TBlockArray = array [0 .. ITEMTOOLTIPTEXT_SIZE -1] of TBlock; PBlockArray = ^TBlockArray; TBlockRec = packed record ID: Word; Name: array [0 .. $63] of AnsiChar; end; PBlockRec = ^TBlockRec; TBlockRecArray = array of TBlockRec; var Form21: TForm21; implementation {$R *.dfm} function ReadBMDFile(const FileName: TFileName): TBytes; var Fs: TStream; begin Result := nil; try Fs := TFileStream.Create(FileName, fmOpenRead); try SetLength(Result, Fs.Size); Fs.Read(Result[0], Length(Result)); finally Fs.Free; end; except on E: Exception do MessageDlg('Failed to open file with error: ' + PWideChar(E.Message), mtError, [mbOK], 0); end; end; procedure Decrypt3Bytes (var Buffer: TBlock); const Key : array [0 .. 2] of Byte = ($FC, $CF, $AB); var i: Integer; begin for i := 0 to ITEMTOOLTIPTEXT_BLOCK_SIZE -1 do Buffer[i] := Buffer[i] xor Key[i mod 3]; end; procedure TForm21.Button1Click(Sender: TObject); const FFFFFF = 'C:\Program Files (x86)\WEBZEN\Mu\Data\Local\Eng\ItemTooltipText_eng.bmd'; var Buffer: TBytes; BlockArray: TBlockArray; BlockRecArray: TBlockRecArray; I, E: Integer; S: string; begin Buffer := ReadBMDFile(FFFFFF); if Buffer = nil then Exit else begin BlockArray := PBlockArray(@Buffer[0])^; for i := 0 to ITEMTOOLTIPTEXT_SIZE -1 do Decrypt3Bytes(BlockArray[i]); for i := 0 to ITEMTOOLTIPTEXT_SIZE -1 do begin SetLength(BlockRecArray, High(BlockRecArray) +2); BlockRecArray[High(BlockRecArray)] := PBlockRec(@BlockArray[i])^; with Log.Items.Add do begin Caption := IntToStr(i); SubItems.Add(IntToStr(BlockRecArray[High(BlockRecArray)].ID)); SubItems.Add(BlockRecArray[High(BlockRecArray)].Name); end; end; end; end; end.







Reply With Quote![[Delphi - Source] Decrypt ItemToolTip, ItemLevelTooltip, ItemtooltipText.bmd](http://ragezone.com/hyper728.png)



