C# Pk2 Reader (Including sourcecode)
Hey guys,
today I want to release my Pk2Reader to you.
It's based on "bloodman"'s original class.
I Added alot of methods/functions to it and cleaned it up totaly.
[Features]
- Read .pk2 files with any Blowfish key
- Extract file(s) out of it
- Work around with .pk2 files
[Bugs]
- Nothing found (yet)
[Available Functions/Methods]
Quote:
- ExtractFile(File File, string OutputPath) (+1 overflow)
Extract any file out of the .pk2 and save it to HDD
Quote:
- GetFileExtension(File File) --> string (+1 overflow)
Return the file extension of any file located inside the .pk2 (e.g ".txt")
Quote:
- GetRootFiles() --> List<File>
Returns a list of all files within the root folder
Quote:
- GetRootFolders() --> List<Folder>
Returns a list of all folders within the root folder
Quote:
- GetFiles(string ParentFolder) --> List<File>
Returns a list of all files within a specific folder
Quote:
- GetSubFolders(string ParentFolder) --> List<Folder>
Returns a list of all folders within a specific folder
Quote:
- FileExists(string Name) --> Boolean
Returns if the file you've been searching for exsist inside the .pk2
Quote:
- GetFileBytes(string Name) --> Byte[] (+1 overflow)
Returns the requested file as Byte[]
Quote:
- GetFileText(string Name) --> string (+1 overflow)
Returns the file text (e.g in itemdata_XY.txt)
Quote:
- GetFileStream(string Name) --> System.IO.Stream (+1 overflow)
Returns the stream of a file (e.g Image.FromStream(this_function))
Quote:
- GetFileNames() --> List<string>
Returns a list with all filenames
Download:
Compiled (.dll)
PK2Reader.dll - Localhostr
Source (.zip)
PK2Reader.zip - Localhostr
Example (.zip)
[C#] using System; using System.Collections.Generic; using System.Linq; using Syst - Pastebin.com
Mini.pk2 (used in example)
Mini.pk2 - Localhostr
(Blowfishkey = "test")
Conclusion:
I hope it helps you to create your own .pk2 extractor. Feel free to add your own stuff and post it into this thread. Also feel free to add me to your skype contacts: MrLordschaft.
Thanks for reading.
PS: If you know how to code a writer, please tell me.
Re: [Release] C# Pk2 Reader (Including sourcecode)
1 Attachment(s)
Re: [Release] C# Pk2 Reader (Including sourcecode)
Nice release. Here you can find the C++ source of the writer (editor). All credits goes to pushedx
Would be nice if you could code it in C#.
Re: C# Pk2 Reader (Including sourcecode)
Okay guys, has been long.
I added alot new stuff in 1.3, fixed bugs and alot more.
Changelog:
- Added: public long GetFolderSize(string Folder), public bool FolderCointainsFiles(Folder Folder), public int GetFolderFileCount(Folder Folder) public Icon GetFileIcon(string Name)
- Fixed: GetFullFilePath.
- Improved: Error handling.
Have fun!
Download (.dll)
https://lh.rs/YjlbwYvr4y7g
Download (.zip) [Source]
https://lh.rs/202kC04ueRFG
Re: C# Pk2 Reader (Including sourcecode)
nice update, waiting for you to finish the file/folder delete :D
Re: C# Pk2 Reader (Including sourcecode)