-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FIXED in Git 679c45f28] Unrar.dll - technical proposal for correct extraction and find for load algoritm used after Git-2ce8617ba #1116
Comments
Thanks for the good wishes and happy New Year to you as well. Yes, I'll improve this to use existing dll first. |
Thank you And once again you a Happy New Year! |
I rewrites src\AppTools.cpp DLL extract algorithm and added try check for Read Only folders:
Reasone for editing is minimized write's on Flash/SSD disks |
Test files for check open RAR 5.0 format - test-rar29.cbr - used RAR 2.9 format is supported the lib unaar and test-rar50.cbr used RAR 5.0 format (header signature 0x52 0x61 0x72 0x21 0x1a 0х00 0x00) not supported existing version lib unaar. |
I read Rar unpack code in to rar/rar rar.c (212):
and in the yard the 2019th year :) ps. - fix typo |
While the 32 and 64-bit DLLs are extracted to different randomdirs so there's no overlap, the main issues are loss of both self-containment and stealth portability. Loss of self-containment is obvious since the portable versions instead of extracting the UnRAR DLLs to the EXE's folder are extracting to Loss of stealth portability is due to the fact that closing neither the 32 or 64-bit portable version seems to wipe its associated randomdir (although the 64-bit version wipes the 32-bit one's randomdir and vice versa). So not only are the current 'portable' versions not truly self-contained, they're not even cleaning up after themselves. 😞 |
Fixed in Git 679c45f |
@kjk: So if I understand the changes correctly, the latest builds are no longer extracting any UnRAR DLLs at all and are relying on incorporating the UnRAR source itself into Sumatra? And if so, does this mean UnArr is no longer being used? While this seems fine and dandy, a matter of concern when it comes to relying on external sources is that if Sumatra experiences another prolonged development hiatus then in effect the UnRAR code inside (with bugs if any) will be 'frozen' too, despite the fact that newer UnRAR DLLs will continue to be released. External DLLs do have the advantage of allowing the user to simply substitute them with the latest API-compatible release... |
Yes to all that. However, in practice:
|
The format of the RAR container changes quite rarely (it changed in RAR 1.3, RAR 1.4, RAR 1.5, RAR 2.9 and RAR 5.0,) and the changes made to the UnRAR code are mostly service-based, which we see on WhatsNew.txt in ftp://Anonymous:[email protected]:@ftp.rarlabs.com:21/rar/UnRARDLL.exe, and the unrarsrc*.tar.gz sources are which can be download from ftp://Anonymous:[email protected]:@ftp.rarlabs.com:21/rar/unrarsrc-.tar.gz (current version 5.8.4 is the third digit is the current beta number), and the library itself has not changed much since 2013 (source UnRARDLL.exe/WhatsNew.txt, extract):
so I don’t think that we can encounter a hidden error in the code of the RAR5 unpacker, and if Yevgeny Roshal changes the format of the container, he will immediately lay out his new description and the source code of the new UnRAR and we can take this into account. |
I really wouldn't go so far as to declare with absolute certainty that the UnRAR code has no bugs or vulnerabilities whatsoever, but anyway, as long as any significant changes are incorporated into Sumatra on a timely basis I guess it's all good. :) Certainly one less thing for your average user who knows nothing of DLLs to contend with. |
Eugene is often the subject of WinRAR on forun.ru-board.com and I know how carefully he checks any suspicion of errors - they have practically no chance to go unnoticed, including the people who hunt them. And even an error occurs, until the next update of the unrar sources in the DLL / EXE is saved, and if it is easier to fix it ourselves and transfer the patch to Eugene, for which he will only be grateful. At least during the period of our acquaintance with him, I had an opinion about him as a very friendly, decent, and attentive person. |
@VictorVG: Eugene is definitely polite and a conscientious programmer. However no disrespect to him, but the very nature of the beast is such that any complex piece of software is bound to have bugs and vulnerabilities, and even open source (which WinRAR except for the UnRAR part isn't) cannot guarantee perfection. In short, let's not pretend that his programs have never suffered from any bugs at all (even long-term ones), and if you need proof you can check out various exploit/vulnerability DBs including 1, 2, 3 and 4 (not to mention those on the dark web where exploits are regularly bought and sold). Anyway, as I've said already above, we have nothing to worry about as long as Sumatra is under active maintenance and development and incorporates updated (bug-fixed) third-party components on a timely basis. |
Users make reasonable comments about the loss of portability of the program after Git 2ce8617 - the unrar.dll library is always unpacked in the %LOCALAPPDATA%\SumatraPDF\Extracted<randomdiir> directory even if it is in the same directory as the SumatraPDF executable.
To eliminate their comments, I propose to adjust the algorithm for searching and loading this DL like:
P.S.
And taking this opportunity, let me congratulate you on the upcoming New Year and wish you happiness, health and more good and interesting people on the path of life.
The text was updated successfully, but these errors were encountered: