Discussion:
unrar.dll refuses to advance to next file of multipart archive, throws ERAR_EOPEN
(too old to reply)
R.Wieser
2018-11-21 08:38:46 UTC
Permalink
Hello All,

I'm using unrar.dll to get a list of all files in a multi-part RAR archive.
The problem is that the listing ends (for all but the last fileparts) with
an ERAR_EOPEN error (which I assume means it couldn't find the next
filepart).

Does anyone know how what causes it, and ofcourse how to deal with it ?

Currently I do not even know how to get more info on that error, like maybe
the filename it tries to open.

By the way, the files are of the form *-1.bin, *-2.bin and *-3.bin.
Looking in those files seperatily seems to work.

Regards,
Rudy Wieser
JJ
2018-11-21 10:21:14 UTC
Permalink
Post by R.Wieser
Hello All,
I'm using unrar.dll to get a list of all files in a multi-part RAR archive.
The problem is that the listing ends (for all but the last fileparts) with
an ERAR_EOPEN error (which I assume means it couldn't find the next
filepart).
Does anyone know how what causes it, and ofcourse how to deal with it ?
Currently I do not even know how to get more info on that error, like maybe
the filename it tries to open.
By the way, the files are of the form *-1.bin, *-2.bin and *-3.bin.
Looking in those files seperatily seems to work.
Check what file it tries to open using Microsoft Process Monitor. I don't
know if Process Monitor still works on XP, but if it doesn't try its
predecessor, Microsoft/SysInternals File Monitor (or Filemon).

I don't know if this is related to your problem, but in SO, a user reported
that it fails when the archive has Unicode file name(s) in it. RAR supports
Unicode file names, so I don't know what happened exactly. Probably a bug in
the unpacker module.
R.Wieser
2018-11-23 11:12:11 UTC
Permalink
JJ,
Post by JJ
Check what file it tries to open using Microsoft Process Monitor
I've just done so, but I can't find a way to run-and-capture/view the file
access. I do not see any kind of log file either. In other words:
if-and-when it tries to open a file it goes way to fast for me to notice (if
it gets displayed at all that is).
Post by JJ
Post by R.Wieser
The problem is that the listing ends (for all but the last fileparts)
with an ERAR_EOPEN error (which I assume means it couldn't
find the next filepart).
I was wrong in the above assumption by the way: the ERAR_EOPEN is returned
by the RARProcessFile (using RAR_SKIP) function, after which the
RARReadHeader ends with the ERAR_END_ARCHIVE state. In other words, it
terminates normally - just not continuing with the next file.

I could also verify that it really is the very last (partial!) file in the
file, as it showed a "continues in next volume" flag (0x01) in the
RARHeaderData -> Flags field.


I also tried something else to see which files the program and/or dll
attempts to open, which involves injecting a DLL in the programs addres
space. But for some reason the program aborts (exit code -1 (minus one)
[1]) whenever I do such an injection, regardles of which DLL I'm injecting
(my own, or a windows standard one, like ws2_32). Do you have any idea
what could cause it ?

[1] I can see three message-loop events in the rarviewer program,
wm_setfont, wm_destroy and wm_ncdestroy.

Regards,
Rudy Wieser
JJ
2018-11-23 12:50:50 UTC
Permalink
Post by R.Wieser
I've just done so, but I can't find a way to run-and-capture/view the file
if-and-when it tries to open a file it goes way to fast for me to notice (if
it gets displayed at all that is).
If you're using Process Monitor, try using Filemon instead - since Process
Monitor it's only optimized for NT6+.
R.Wieser
2018-11-23 13:24:48 UTC
Permalink
JJ,
Post by JJ
If you're using Process Monitor, try using Filemon instead
According to the Microsoft site the former has replaced the latter - and
searching the web does not really turn up something my I can download.

I'm going to see if Microsofts "teaching hooks" can do something for me.

Regards,
Rudy Wieser
R.Wieser
2018-11-24 16:22:00 UTC
Permalink
This might be of interrest to non-programmers too, especially when they are
downloading from GOG (Good Old Games), where I encountered the files.
Post by R.Wieser
I'm using unrar.dll to get a list of all files in a multi-part RAR
archive. The problem is that the listing ends (for all but the last
fileparts) with an ERAR_EOPEN error (which I assume means it couldn't find
the next filepart).
Looking at which files the program (unrar.dll in particular) tried to open
it was easy to figure out :

The files are of the form *.0.5-1.bin, *.0.5-2.bin. But instead of the
last digit/value (the "1" and "2") being incremented by unrar.dll (and most
likely 7z and the origional installer too, both of which refused to work) it
incremented the "5" in the above.

In short: although the form "-?.bin" (-*.bin ?) is advertised as the
identifying pattern, someone somewhere bungled up and allowed something else
to be recognised instead. :-( :-)

Regards,
Rudy Wieser

Loading...