No subject


Mon Oct 29 15:42:17 CDT 2007


entry calculated, with typical opcode sequences having a "weighting".
Just think of advanced heuristic detection methods of antivirus scanners and
you get the idea ;-).

Anyway, wine's builtin libraries differ in their signatures from windows entry
code and to make things worse, wine's +relay/+snoop feature heavily interferes
with the analyzer results. :-(

First I made some experiments with additional (dummy) function exports, small
__asm__ wrappers with opcode sequences to see how the distribution of opcodes
influences the analyzer results.
The result was rather disappointing.
I needed a large number of exports to gain some results but not significantly
enough to get below the "bad" threshold.

Then I came across the magic "0" value. As soon as I used this value either as
first .byte on API entry or init value for data export, the entry scan was
short circuited.
This value seemed to have the highest influence of all code/data sequences
used.
I added quite a number of data exports - aliased to initialized "0" value -
safe enough to let even wine's +relay work (remember: relay code influences
analyzer).
If you look at the patch don't get mad ;-)
You will see a crapload of named "__wine_safedisc2" data exports/aliases added
to wine builtin kernel32, user32 and gdi32.

For the record: http://bugs.winehq.org/show_bug.cgi?id=9926 which talks about
"problematic" gdi32 data exports (pfnPalette stuff) in SafeDisc 3.x.
SafeDisc 2.x code triggers SEH upon exported function pointers too but this is
gracefully handled. No harm at all.
I wonder if this is really a problem in SafeDisc 3.x ...

I thought about other possible solutions but found no one easier to implement
to prove my findings without hurting wine too much :-)
Making wrappers of the whole kernel32, user32, gdi32 named exports API just to
please the entry analyzer is not an option to me.

Another way could be the relocation of export table upon module loading,
expanding it at runtime by adding the required number of "statistics fakers"
(data exports with zero init).
This requires modifying the ntdll loader .. though i'm not sure if this
approach breaks other applications/braindamaged PE protection stuff which
expect certain conditions to be met (tables present at specific sections/memory
areas).

------------------------------
(2)

Well, take it as proof of concept. Play with it.

I tested my patch with a few SafeDisc 2.x games I have original media.
No cracks/no-cd patches were used.
Only official game patches were used.

Battlefield 1924 (1.6x) - SafeDisc 2.6/2.8
Road To Rome (BF1942 expansion) - SafeDisc 2.8
Battlefield Vietnam - SafeDisc 2.9

All of these work fine for me with the patch applied.

Please test this patch on many SafeDisc 2.x games as possible and report your
results (works or works not).
Make sure you have original media mounted and drive/data is visible within
wine.
If it fails for first time, the media might not ready yet, try again then (I
experienced this sometimes).

Use this link to verify what SafeDisc Version is used:
http://www.120search.net/ (alcohol software copy protection database)

Regards


-- 
Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all bug changes.



More information about the wine-bugs mailing list