-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove blowfish.dll dependency #1566
base: develop
Are you sure you want to change the base?
Conversation
Nightly build for this pull request:
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- It should be discussed whether straws and pipes should be put into yrpp, and if yrpp should change its license
- iirc
BF
in BlowStraw and BlowPipe were something likeBlowfishEnginePtr *
and had a COM interface. So I assume you're redefining these 2 classes, then you might just use normal smart pointers.
|
If my analysis were correct, |
Actually, that's not the case, which is something I learnt experimentally. Since the code was borrowed from Vinifera, it originally contained Let's just leave legacy code as it is, there is 0 need to any anything about it. |
src/Blowfish/Hooks.Blowfish.cpp
Outdated
class FakeBlowfishEngine | ||
{ | ||
public: | ||
BlowfishEngine* CTOR_Proxy() { return new (reinterpret_cast<BlowfishEngine*>(this)) BlowfishEngine; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think keeping this makes any sense. It shouldn't be called anyway and is not correct since you get rid of the com interface.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As-is, it is indeed inconsequential. An alternative route we could take is NOT replacing BlowPipe and BlowStraw - then the contrstructor WOULD get called. Removing the com interface by itself is not a problem - all we would need to do is a few byte patches to change the amount of memory allocated from the small amount needed fo the COM proxy to the actual amount required for the class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just meant this part can be commented out because you didn't take the other route. btw you allocated with GameCreate but still deallocated with dll delete in blowpipe and blowstraw
/** | ||
* Skip loading BLOWFISH.DLL | ||
*/ | ||
DEFINE_JUMP(LJMP, 0x6BC33A, 0x6BC425); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can the win32 registry code at 6bc425 be skipped as well? I tried and there seems to be no side effect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why would you skip this? It is completely unrelated to Blowfish.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just asking, think you might know
…ce BlowfishEngine with RA source copy
f3267be
to
2eeab67
Compare
I've gone ahead and Note for @chaserli : It is absolutely valid to replace the COM proxy with the actual class, the only thing that needs to be taken into account is the memory allocation. Having done what I did, it works just fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where's the actual license change? :P
|
By default, the game's executable attempts to load blowfish.dll using COM and uses it for encryption and decryptio, which causes ceratin issues on modern operating systems. This PR removes the game's dependency on blowfish.dll.
This PR include code by CCHyper/tomsons26 from Vinifera which is derived from C&C Remastered Collection sources and is licensed under GPLv3, and as such, requires relicensing Phobos under GPL.