Project Perfect Mod Forums
:: Home :: Get Hosted :: PPM FAQ :: Forum FAQ :: Privacy Policy :: Search :: Memberlist :: Usergroups :: Register :: Profile :: Log in to check your private messages :: Log in ::


The time now is Fri Nov 08, 2024 7:10 am
All times are UTC + 0
Some source code.
Moderators: Ares Support Team at PPM, Global Moderators, Red Alert 2 Moderators
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
Author Message
Neijwiert
Civilian


Joined: 18 Jan 2015

PostPosted: Sat Feb 26, 2022 3:58 pm    Post subject:  Some source code. Reply with quote  Mark this post and the followings unread

I had been bored and was messing around with the gamemd.exe of RA2 Yuri's Revenge. From that I have extracted some code (not providing all here as I think it would be duplicate) and some of that code is as I dubbed it 'cryptographic' related. Also an interesting one and that is some CD control/checking. I thought it might be useful for the Ares project I suppose, so here it is. Do with it as you please I only ask for some credit if it is used.

The zip contains code for the following stuff:
- CRC calculations
- Base64
- SHA1
- Blowfish Cipher Engine interface
- CD control stuff

Now, these classes are compiled for C++20 under visual studio 2022 with all warnings enabled. They are based on the actual reversed engineered source code, but some contain improvements, like safety issues and performance. For example: for the blowfish cipher engine I added in an improvement so that you do not need admin rights for the registry edit and in stead completely avoid the registry (this can be toggled in the code). They should be functionally the same though. I also have documented the code for the better part. I was actually working on the RSA cipher as well, but never finished it. If needed I can provide the addresses in the exe for all the known functions.



Some RA2 source code.zip
 Description:
Plain header and source files, nothing else

Download
 Filename:  Some RA2 source code.zip
 Filesize:  24.67 KB
 Downloaded:  52 Time(s)


Back to top
View user's profile Send private message
Neijwiert
Civilian


Joined: 18 Jan 2015

PostPosted: Sat Feb 26, 2022 9:16 pm    Post subject: Reply with quote  Mark this post and the followings unread

I also see that, by looking on GitHub, that you guys have a very incomplete INIClass and using jumps. I am also 99% sure that a lot of the functions belong in CCINIClass and not in INIClass. I can provide source code for INIClass, it is however 95% complete, missing the RSA functions and comments. Though my implementation uses a template class for Vector and StringClass to eliminate duplicate code.

The structures look as follows:

INIEntry : public Collections::Node<INIEntry*>
       char* m_Name;
       char* m_Value;
MarkupLine* m_LeadingMarkupLines;
char* m_Comment;
std::size_t m_DelimiterIndex;
std::size_t m_ValueStartIndex;
std::size_t m_CommentStartIndex;

INISection : public Collections::Node<INISection*>
       char* m_Name;
Collections::List<INIEntry*> m_EntryList;
Collections::IndexClass<std::uint32_t, INIEntry*> m_EntryIndex;
MarkupLine* m_LeadingMarkupLines;

MarkupLine
       char* m_Line;
MarkupLine* m_Next;

INIClass
       mutable const char* m_ArchivedSectionName;
mutable INISection* m_ArchivedSection;
CnC::Collections::List<INISection*> m_SectionList;
CnC::Collections::IndexClass<std::uint32_t, INISection*> m_SectionIndex;
MarkupLine* m_TrailingMarkupLines;

Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] Mark the topic unread ::  View previous topic :: View next topic
 
Share on TwitterShare on FacebookShare on Google+Share on DiggShare on RedditShare on PInterestShare on Del.icio.usShare on Stumble Upon
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © phpBB Group

[ Time: 0.1835s ][ Queries: 13 (0.0087s) ][ Debug on ]