Move reusable FrontendKitWS code into own library. Fix small issue when determining fkNetcode INI path.

This commit is contained in:
Ray Koopa 2020-07-16 16:01:27 +02:00
parent 4e251959b3
commit a314377c13
22 changed files with 415 additions and 370 deletions

View File

@ -53,236 +53,94 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "fkNetcode", "tool\fkNetcode
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FrontendKitWS", "tool\FrontendKitWS\FrontendKitWS.vcxproj", "{E391EA12-B929-466C-932F-DEF72B8CEB5D}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "FrontendKitLib", "tool\FrontendKitLib\FrontendKitLib.vcxproj", "{068A8647-0A66-4E39-983B-43ACEAC5C937}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Debug|x64.ActiveCfg = Debug|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Debug|x64.Build.0 = Debug|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Debug|x86.ActiveCfg = Debug|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Debug|x86.Build.0 = Debug|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Release|Any CPU.Build.0 = Release|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Release|x64.ActiveCfg = Release|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Release|x64.Build.0 = Release|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Release|x86.ActiveCfg = Release|Any CPU
{DD76B6AA-5A5A-4FCD-95AA-9552977525A1}.Release|x86.Build.0 = Release|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Debug|Any CPU.Build.0 = Debug|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Debug|x64.ActiveCfg = Debug|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Debug|x64.Build.0 = Debug|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Debug|x86.ActiveCfg = Debug|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Debug|x86.Build.0 = Debug|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Release|Any CPU.ActiveCfg = Release|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Release|Any CPU.Build.0 = Release|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Release|x64.ActiveCfg = Release|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Release|x64.Build.0 = Release|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Release|x86.ActiveCfg = Release|Any CPU
{0D7F9DC3-7268-494E-BA1E-6C01525EB9AB}.Release|x86.Build.0 = Release|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Debug|Any CPU.Build.0 = Debug|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Debug|x64.ActiveCfg = Debug|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Debug|x64.Build.0 = Debug|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Debug|x86.ActiveCfg = Debug|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Debug|x86.Build.0 = Debug|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Release|Any CPU.ActiveCfg = Release|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Release|Any CPU.Build.0 = Release|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Release|x64.ActiveCfg = Release|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Release|x64.Build.0 = Release|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Release|x86.ActiveCfg = Release|Any CPU
{510EE83E-9C52-40FD-AC7E-C4981EBF4182}.Release|x86.Build.0 = Release|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Debug|x64.ActiveCfg = Debug|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Debug|x64.Build.0 = Debug|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Debug|x86.ActiveCfg = Debug|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Debug|x86.Build.0 = Debug|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Release|Any CPU.Build.0 = Release|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Release|x64.ActiveCfg = Release|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Release|x64.Build.0 = Release|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Release|x86.ActiveCfg = Release|Any CPU
{D9694108-539C-4DEE-B5DD-284208D48B46}.Release|x86.Build.0 = Release|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Debug|x64.ActiveCfg = Debug|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Debug|x64.Build.0 = Debug|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Debug|x86.ActiveCfg = Debug|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Debug|x86.Build.0 = Debug|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Release|Any CPU.Build.0 = Release|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Release|x64.ActiveCfg = Release|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Release|x64.Build.0 = Release|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Release|x86.ActiveCfg = Release|Any CPU
{AC9F52FA-F552-49E0-83AE-79759BF44FED}.Release|x86.Build.0 = Release|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Debug|x64.ActiveCfg = Debug|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Debug|x64.Build.0 = Debug|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Debug|x86.ActiveCfg = Debug|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Debug|x86.Build.0 = Debug|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Release|Any CPU.Build.0 = Release|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Release|x64.ActiveCfg = Release|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Release|x64.Build.0 = Release|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Release|x86.ActiveCfg = Release|Any CPU
{4E124BBA-15B5-422E-93D5-96EA7D4180F3}.Release|x86.Build.0 = Release|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Debug|x64.ActiveCfg = Debug|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Debug|x64.Build.0 = Debug|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Debug|x86.ActiveCfg = Debug|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Debug|x86.Build.0 = Debug|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Release|Any CPU.Build.0 = Release|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Release|x64.ActiveCfg = Release|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Release|x64.Build.0 = Release|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Release|x86.ActiveCfg = Release|Any CPU
{BBCECFCC-F2FD-4C4D-A6E9-CC7AA5F10FDD}.Release|x86.Build.0 = Release|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Debug|x64.ActiveCfg = Debug|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Debug|x64.Build.0 = Debug|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Debug|x86.ActiveCfg = Debug|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Debug|x86.Build.0 = Debug|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Release|Any CPU.Build.0 = Release|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Release|x64.ActiveCfg = Release|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Release|x64.Build.0 = Release|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Release|x86.ActiveCfg = Release|Any CPU
{BD8079D9-FDB5-4C7D-8AD4-C80ADC4A4B26}.Release|x86.Build.0 = Release|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Debug|x64.ActiveCfg = Debug|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Debug|x64.Build.0 = Debug|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Debug|x86.ActiveCfg = Debug|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Debug|x86.Build.0 = Debug|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Release|Any CPU.Build.0 = Release|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Release|x64.ActiveCfg = Release|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Release|x64.Build.0 = Release|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Release|x86.ActiveCfg = Release|Any CPU
{239763CD-B7C9-4E8B-A84B-8F24DECF6D7B}.Release|x86.Build.0 = Release|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Debug|Any CPU.Build.0 = Debug|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Debug|x64.ActiveCfg = Debug|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Debug|x64.Build.0 = Debug|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Debug|x86.ActiveCfg = Debug|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Debug|x86.Build.0 = Debug|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Release|Any CPU.ActiveCfg = Release|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Release|Any CPU.Build.0 = Release|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Release|x64.ActiveCfg = Release|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Release|x64.Build.0 = Release|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Release|x86.ActiveCfg = Release|Any CPU
{748D16FF-35C6-4249-A1E8-04B2D239C954}.Release|x86.Build.0 = Release|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Debug|x64.ActiveCfg = Debug|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Debug|x64.Build.0 = Debug|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Debug|x86.ActiveCfg = Debug|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Debug|x86.Build.0 = Debug|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Release|Any CPU.Build.0 = Release|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Release|x64.ActiveCfg = Release|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Release|x64.Build.0 = Release|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Release|x86.ActiveCfg = Release|Any CPU
{3AAC4992-DDB9-4175-82B9-C57F22E12FF6}.Release|x86.Build.0 = Release|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Debug|x64.ActiveCfg = Debug|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Debug|x64.Build.0 = Debug|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Debug|x86.ActiveCfg = Debug|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Debug|x86.Build.0 = Debug|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Release|Any CPU.Build.0 = Release|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Release|x64.ActiveCfg = Release|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Release|x64.Build.0 = Release|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Release|x86.ActiveCfg = Release|Any CPU
{EF308D4E-26A0-471C-B764-9C4EB713BEAE}.Release|x86.Build.0 = Release|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Debug|x64.ActiveCfg = Debug|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Debug|x64.Build.0 = Debug|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Debug|x86.ActiveCfg = Debug|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Debug|x86.Build.0 = Debug|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Release|Any CPU.Build.0 = Release|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Release|x64.ActiveCfg = Release|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Release|x64.Build.0 = Release|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Release|x86.ActiveCfg = Release|Any CPU
{351B93B0-301F-42E1-82A0-7FA217154F5D}.Release|x86.Build.0 = Release|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Debug|x64.ActiveCfg = Debug|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Debug|x64.Build.0 = Debug|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Debug|x86.ActiveCfg = Debug|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Debug|x86.Build.0 = Debug|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Release|Any CPU.Build.0 = Release|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Release|x64.ActiveCfg = Release|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Release|x64.Build.0 = Release|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Release|x86.ActiveCfg = Release|Any CPU
{392E4CA2-61D9-4BE1-B065-8801A9F102B8}.Release|x86.Build.0 = Release|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Debug|Any CPU.Build.0 = Debug|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Debug|x64.ActiveCfg = Debug|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Debug|x64.Build.0 = Debug|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Debug|x86.ActiveCfg = Debug|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Debug|x86.Build.0 = Debug|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Release|Any CPU.ActiveCfg = Release|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Release|Any CPU.Build.0 = Release|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Release|x64.ActiveCfg = Release|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Release|x64.Build.0 = Release|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Release|x86.ActiveCfg = Release|Any CPU
{212F8090-9775-4098-BD44-9ABC01FBE553}.Release|x86.Build.0 = Release|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Debug|x64.ActiveCfg = Debug|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Debug|x64.Build.0 = Debug|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Debug|x86.ActiveCfg = Debug|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Debug|x86.Build.0 = Debug|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Release|Any CPU.Build.0 = Release|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Release|x64.ActiveCfg = Release|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Release|x64.Build.0 = Release|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Release|x86.ActiveCfg = Release|Any CPU
{1FAB6B9F-2585-46DC-81C0-579DC808C389}.Release|x86.Build.0 = Release|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Debug|Any CPU.Build.0 = Debug|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Debug|x64.ActiveCfg = Debug|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Debug|x64.Build.0 = Debug|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Debug|x86.ActiveCfg = Debug|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Debug|x86.Build.0 = Debug|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Release|Any CPU.ActiveCfg = Release|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Release|Any CPU.Build.0 = Release|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Release|x64.ActiveCfg = Release|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Release|x64.Build.0 = Release|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Release|x86.ActiveCfg = Release|Any CPU
{13ABF717-5809-441D-A5D8-66E1EE75A390}.Release|x86.Build.0 = Release|Any CPU
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Debug|Any CPU.ActiveCfg = Debug|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Debug|x64.ActiveCfg = Debug|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Debug|x86.ActiveCfg = Debug|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Debug|x86.Build.0 = Debug|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Debug|Any CPU.Build.0 = Debug|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Release|Any CPU.ActiveCfg = Release|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Release|x64.ActiveCfg = Release|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Release|x86.ActiveCfg = Release|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Release|x86.Build.0 = Release|Win32
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1}.Release|Any CPU.Build.0 = Release|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Debug|Any CPU.ActiveCfg = Debug|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Debug|x64.ActiveCfg = Debug|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Debug|x86.ActiveCfg = Debug|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Debug|x86.Build.0 = Debug|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Debug|Any CPU.Build.0 = Debug|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Release|Any CPU.ActiveCfg = Release|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Release|x64.ActiveCfg = Release|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Release|x86.ActiveCfg = Release|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Release|x86.Build.0 = Release|Win32
{E391EA12-B929-466C-932F-DEF72B8CEB5D}.Release|Any CPU.Build.0 = Release|Win32
{068A8647-0A66-4E39-983B-43ACEAC5C937}.Debug|Any CPU.ActiveCfg = Debug|Win32
{068A8647-0A66-4E39-983B-43ACEAC5C937}.Debug|Any CPU.Build.0 = Debug|Win32
{068A8647-0A66-4E39-983B-43ACEAC5C937}.Release|Any CPU.ActiveCfg = Release|Win32
{068A8647-0A66-4E39-983B-43ACEAC5C937}.Release|Any CPU.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -307,6 +165,7 @@ Global
{13ABF717-5809-441D-A5D8-66E1EE75A390} = {0B9B0B74-3EB1-46A4-BCCC-F2D6AE59A9EE}
{C4138811-7CFA-4826-A3DD-AF2B618EAFC1} = {0B9B0B74-3EB1-46A4-BCCC-F2D6AE59A9EE}
{E391EA12-B929-466C-932F-DEF72B8CEB5D} = {0B9B0B74-3EB1-46A4-BCCC-F2D6AE59A9EE}
{068A8647-0A66-4E39-983B-43ACEAC5C937} = {0B9B0B74-3EB1-46A4-BCCC-F2D6AE59A9EE}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {1CD4EDE2-A5FB-4A58-A850-3506AB7E7B69}

View File

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|Win32">
<Configuration>Debug</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
<ProjectConfiguration Include="Release|Win32">
<Configuration>Release</Configuration>
<Platform>Win32</Platform>
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<VCProjectVersion>16.0</VCProjectVersion>
<Keyword>Win32Proj</Keyword>
<ProjectGuid>{068a8647-0a66-4e39-983b-43aceac5c937}</ProjectGuid>
<RootNamespace>FrontendKitLib</RootNamespace>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>StaticLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v142</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>MultiByte</CharacterSet>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<ImportGroup Label="ExtensionSettings">
</ImportGroup>
<ImportGroup Label="Shared">
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LinkIncremental>true</LinkIncremental>
<OutDir>bin\$(Configuration)\</OutDir>
<IntDir>obj\$(Configuration)\</IntDir>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<LinkIncremental>false</LinkIncremental>
<OutDir>bin\$(Configuration)\</OutDir>
<IntDir>obj\$(Configuration)\</IntDir>
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;FRONTENDKITLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>pch.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<ClCompile>
<WarningLevel>Level3</WarningLevel>
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;FRONTENDKITLIB_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PrecompiledHeader>Use</PrecompiledHeader>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<ForcedIncludeFiles>pch.h;%(ForcedIncludeFiles)</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableUAC>false</EnableUAC>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="src\fkConfig.cpp" />
<ClCompile Include="src\fkPatch.cpp" />
<ClCompile Include="src\fkUtils.cpp" />
<ClCompile Include="src\pch.cpp">
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Create</PrecompiledHeader>
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">Create</PrecompiledHeader>
</ClCompile>
<ClCompile Include="src\PEInfo.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\fkConfig.h" />
<ClInclude Include="include\fkPatch.h" />
<ClInclude Include="include\fkUtils.h" />
<ClInclude Include="include\PEInfo.h" />
<ClInclude Include="src\pch.h" />
</ItemGroup>
<ItemGroup>
<None Include="include\fkPatch.inl" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>

View File

@ -0,0 +1,56 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<Filter Include="Source Files">
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
<Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions>
</Filter>
<Filter Include="Header Files">
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
</Filter>
<Filter Include="Resource Files">
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
</Filter>
</ItemGroup>
<ItemGroup>
<ClCompile Include="src\PEInfo.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\fkUtils.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\fkPatch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\fkConfig.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="src\pch.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="include\fkConfig.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\fkPatch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\fkUtils.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="src\pch.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="include\PEInfo.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="include\fkPatch.inl">
<Filter>Header Files</Filter>
</None>
</ItemGroup>
</Project>

View File

@ -1,18 +1,18 @@
#pragma once
#include <Windows.h>
typedef struct PEInfo
struct PEInfo
{
PEInfo(HMODULE hModule = 0);
void Reset(HMODULE hModule);
DWORD Offset(DWORD off);
BOOL PtrInCode(PVOID ptr);
BOOL PtrInData(PVOID ptr);
ULONG_PTR Offset(ULONG_PTR off);
BOOL IsCode(LPVOID ptr);
BOOL IsData(LPVOID ptr);
HANDLE Handle;
IMAGE_DOS_HEADER* DOS;
IMAGE_NT_HEADERS* NT;
IMAGE_FILE_HEADER* FH;
IMAGE_OPTIONAL_HEADER* OPT;
} *PPEInfo;
};

View File

@ -0,0 +1,36 @@
#pragma once
#include <Windows.h>
namespace fk
{
enum InsertJump
{
IJ_JUMP, // Insert a jump (0xE9) with patchJump
IJ_CALL, // Insert a call (0xE8) with patchJump
IJ_FARJUMP, // Insert a farjump (0xEA) with patchJump
IJ_FARCALL, // Insert a farcall (0x9A) with patchJump
IJ_PUSHRET, // Insert a pushret with patchJump
};
struct Patch
{
public:
ULONG_PTR position;
Patch(ULONG_PTR address, SIZE_T size);
~Patch();
void close() const;
template <class T> void write(const T& value);
static void nops(ULONG_PTR address, SIZE_T size);
static void jump(ULONG_PTR address, SIZE_T size, PVOID callee, DWORD jumpType);
private:
LPBYTE _address;
SIZE_T _size;
DWORD _oldProtect;
};
}
#include "fkPatch.inl"

View File

@ -0,0 +1,9 @@
namespace fk
{
template <class T>
void Patch::write(const T& value)
{
memcpy_s(_address + position, sizeof(T), &value, sizeof(T));
position += sizeof(T);
}
}

View File

@ -0,0 +1,20 @@
#pragma once
#include <stdexcept>
#include <Windows.h>
namespace fk
{
enum GameVersion
{
GAME_VERSION_NONE = -1,
GAME_VERSION_BR, // 1.05 Br
GAME_VERSION_EN, // 1.05 Du, En, Fr, It, Po, Sp, Sw
GAME_VERSION_GE, // 1.05
GAME_VERSION_NA, // 1.05
GAME_VERSION_SA, // 1.05
GAME_VERSION_TRY // 1.07 Trymedia
};
int getGameVersion(DWORD timeDateStamp);
std::string getErrorMessage(int error);
}

View File

@ -7,25 +7,25 @@ PEInfo::PEInfo(HMODULE hModule)
void PEInfo::Reset(HMODULE hModule)
{
Handle = hModule == 0 ? GetModuleHandleA(0) : hModule;
Handle = hModule == 0 ? GetModuleHandleA(NULL) : hModule;
DOS = (IMAGE_DOS_HEADER*)Handle;
NT = (IMAGE_NT_HEADERS*)((DWORD)DOS + DOS->e_lfanew);
FH = (IMAGE_FILE_HEADER*)&NT->FileHeader;
OPT = (IMAGE_OPTIONAL_HEADER*)&NT->OptionalHeader;
}
DWORD PEInfo::Offset(DWORD off)
ULONG_PTR PEInfo::Offset(ULONG_PTR off)
{
return (DWORD)Handle + off;
}
BOOL PEInfo::PtrInCode(PVOID ptr)
BOOL PEInfo::IsCode(LPVOID ptr)
{
return DWORD(ptr) >= Offset(OPT->BaseOfCode)
&& DWORD(ptr) < Offset(OPT->BaseOfCode) + OPT->SizeOfCode;
}
BOOL PEInfo::PtrInData(PVOID ptr)
BOOL PEInfo::IsData(LPVOID ptr)
{
return DWORD(ptr) >= Offset(OPT->BaseOfData)
&& DWORD(ptr) < Offset(OPT->BaseOfData) + OPT->SizeOfInitializedData + OPT->SizeOfUninitializedData;

View File

@ -5,8 +5,9 @@ namespace fk
{
Config::Config(LPCSTR fileName)
{
DWORD length = GetModuleFileName(NULL, _filePath, MAX_PATH);
strcpy_s(strrchr(_filePath, '\\') + 1, MAX_PATH, fileName);
GetModuleFileName(NULL, _filePath, MAX_PATH);
char* sepIdx = strrchr(_filePath, '\\') + 1;
strcpy_s(sepIdx, MAX_PATH - (int)(sepIdx - _filePath), fileName);
}
void Config::get(LPCSTR category, LPCSTR key, BOOL& result, UINT fallback) const

View File

@ -0,0 +1,74 @@
#include "fkPatch.h"
#include <stdexcept>
namespace fk
{
Patch::Patch(ULONG_PTR address, SIZE_T size)
: _address(reinterpret_cast<LPBYTE>(address))
, _size(size)
, position(0)
{
if (!_address || !_size)
throw std::invalid_argument("Address and size must not be 0.");
if (!VirtualProtect(_address, _size, PAGE_EXECUTE_READWRITE, &_oldProtect))
throw std::exception("VirtualProtect failed, call GetLastError for more info.");
}
Patch::~Patch()
{
close();
}
void Patch::close() const
{
DWORD oldProtect;
if (!VirtualProtect(_address, _size, _oldProtect, &oldProtect))
throw std::exception("VirtualProtect failed, call GetLastError for more info.");
}
void Patch::nops(ULONG_PTR address, SIZE_T size)
{
fk::Patch patch(address, size);
while (size--)
patch.write<BYTE>(0x90);
}
void Patch::jump(ULONG_PTR address, SIZE_T size, PVOID callee, DWORD jumpType)
{
fk::Patch patch(address, size);
if (size >= 5 && address)
{
BYTE opSize, opCode;
switch (jumpType)
{
case IJ_PUSHRET: opSize = 6; opCode = 0x68; break;
case IJ_FARJUMP: opSize = 7; opCode = 0xEA; break;
case IJ_FARCALL: opSize = 7; opCode = 0x9A; break;
case IJ_CALL: opSize = 5; opCode = 0xE8; break;
default: opSize = 5; opCode = 0xE9; break;
}
if (size < opSize)
throw std::exception("Not enough space to patch opcode.");
patch.write(opCode);
switch (opSize)
{
case 7:
patch.write((ULONG)callee);
patch.write<WORD>(0x23);
break;
case 6:
patch.write((ULONG)callee);
patch.write<BYTE>(0xC3);
break;
default:
patch.write((ULONG)callee - address - 5);
break;
}
for (DWORD i = opSize; i < size; i++)
patch.write<BYTE>(0x90);
}
}
};

View File

@ -0,0 +1,43 @@
#include "fkUtils.h"
#include <string>
#include "fkPatch.h"
namespace fk
{
int getGameVersion(DWORD timeDateStamp)
{
switch (timeDateStamp)
{
case 0x3528DAFA: return GAME_VERSION_BR;
case 0x3528DCB1: return GAME_VERSION_EN;
case 0x3528DB52: return GAME_VERSION_GE;
case 0x3528DA98: return GAME_VERSION_NA;
case 0x3528DBDA: return GAME_VERSION_SA;
case 0x3587BE19: return GAME_VERSION_TRY;
}
return GAME_VERSION_NONE;
}
std::string getErrorMessage(int error)
{
if (error == ERROR_SUCCESS)
return std::string();
LPTSTR buffer = NULL;
const DWORD cchMsg = FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL,
error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPTSTR>(&buffer), 0, NULL);
if (cchMsg > 0)
{
std::string message(buffer);
LocalFree(buffer);
return message;
}
else
{
CHAR buffer[32];
sprintf_s(buffer, "Error code 0x%08X.", error);
return buffer;
}
}
}

View File

@ -0,0 +1,2 @@
// pch.cpp: source file corresponding to the pre-compiled header
// When you are using pre-compiled headers, this source file is necessary for compilation to succeed.

View File

@ -0,0 +1,14 @@
// pch.h: This is a precompiled header file.
// Files listed below are compiled only once, improving build performance for future builds.
// This also affects IntelliSense performance, including code completion and many code browsing features.
// However, files listed here are ALL re-compiled if any one of them is updated between builds.
// Do not add files here that you will be updating frequently as this negates the performance advantage.
#ifndef PCH_H
#define PCH_H
// add headers that you want to pre-compile here
#define WIN32_LEAN_AND_MEAN
#include <Windows.h>
#endif

View File

@ -51,8 +51,8 @@ END
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEVERSION 1,0,1,0
PRODUCTVERSION 1,0,1,0
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
@ -69,12 +69,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Syroot"
VALUE "FileDescription", "fkNetcode"
VALUE "FileVersion", "1.0.0.0"
VALUE "FileVersion", "1.0.1.0"
VALUE "InternalName", "fkNetcode.dll"
VALUE "LegalCopyright", "(c) Syroot, licensed under MIT"
VALUE "OriginalFilename", "fkNetcode.dll"
VALUE "ProductName", "fkNetcode"
VALUE "ProductVersion", "1.0.0.0"
VALUE "ProductVersion", "1.0.1.0"
END
END
BLOCK "VarFileInfo"

View File

@ -60,6 +60,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;_DEBUG;FKNETCODE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)..\FrontendKitLib\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -76,6 +77,7 @@
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>WIN32;NDEBUG;FKNETCODE_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<ConformanceMode>true</ConformanceMode>
<AdditionalIncludeDirectories>$(ProjectDir)..\FrontendKitLib\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -87,24 +89,18 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="fkConfig.cpp" />
<ClCompile Include="fkPatch.cpp" />
<ClCompile Include="fkUtils.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="PEInfo.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="fkConfig.h" />
<ClInclude Include="fkPatch.h" />
<ClInclude Include="fkUtils.h" />
<ClInclude Include="PEInfo.h" />
<ClInclude Include="resource.h" />
</ItemGroup>
<ItemGroup>
<None Include="fkPatch.inl" />
<ResourceCompile Include="fkNetcode.rc" />
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="fkNetcode.rc" />
<ProjectReference Include="..\FrontendKitLib\FrontendKitLib.vcxproj">
<Project>{068a8647-0a66-4e39-983b-43aceac5c937}</Project>
</ProjectReference>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@ -1,28 +0,0 @@
#include "fkPatch.h"
#include <stdexcept>
namespace fk
{
Patch::Patch(LPVOID lpAddress, SIZE_T dwSize)
: _lpAddress(static_cast<LPBYTE>(lpAddress))
, _dwSize(dwSize)
, dwPosition(0)
{
if (!_lpAddress || !_dwSize)
throw std::invalid_argument("Address and size must not be 0.");
if (!VirtualProtect(_lpAddress, _dwSize, PAGE_EXECUTE_READWRITE, &_flOldProtect))
throw std::exception("VirtualProtect failed, call GetLastError for more info.");
}
Patch::~Patch()
{
close();
}
void Patch::close() const
{
DWORD oldProtect;
if (!VirtualProtect(_lpAddress, _dwSize, _flOldProtect, &oldProtect))
throw std::exception("VirtualProtect failed, call GetLastError for more info.");
}
};

View File

@ -1,24 +0,0 @@
#pragma once
#include <Windows.h>
namespace fk
{
struct Patch
{
public:
DWORD dwPosition;
Patch(LPVOID lpAddress, SIZE_T dwSize);
~Patch();
void close() const;
template <class T> void write(const T& value);
private:
LPBYTE _lpAddress;
SIZE_T _dwSize;
DWORD _flOldProtect;
};
}
#include "fkPatch.inl"

View File

@ -1,10 +0,0 @@
namespace fk
{
template <class T>
void Patch::write(const T& value)
{
memcpy_s(_lpAddress + dwPosition, sizeof(T), &value, sizeof(T));
dwPosition += sizeof(T);
}
}

View File

@ -1,89 +0,0 @@
#include "fkUtils.h"
#include <string>
#include "fkPatch.h"
namespace fk
{
int getGameVersion(DWORD timeDateStamp)
{
switch (timeDateStamp)
{
case 0x3528DAFA: return GAME_VERSION_BR;
case 0x3528DCB1: return GAME_VERSION_EN;
case 0x3528DB52: return GAME_VERSION_GE;
case 0x3528DA98: return GAME_VERSION_NA;
case 0x3528DBDA: return GAME_VERSION_SA;
case 0x3587BE19: return GAME_VERSION_TRY;
}
return GAME_VERSION_NONE;
}
std::string getErrorMessage(int error)
{
if (error == ERROR_SUCCESS)
return std::string();
LPTSTR buffer = NULL;
const DWORD cchMsg = FormatMessageA(
FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_ALLOCATE_BUFFER, NULL,
error, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), reinterpret_cast<LPTSTR>(&buffer), 0, NULL);
if (cchMsg > 0)
{
std::string message(buffer);
LocalFree(buffer);
return message;
}
else
{
CHAR buffer[32];
sprintf_s(buffer, "Error code 0x%08X.", error);
return buffer;
}
}
void patchNops(ULONG dwAddr, SIZE_T dwPatchSize)
{
fk::Patch patch(reinterpret_cast<void*>(dwAddr), dwPatchSize);
while (dwPatchSize--)
patch.write<BYTE>(0x90);
}
void patchJump(PVOID pDest, SIZE_T dwPatchSize, PVOID pCallee, DWORD dwJumpType)
{
fk::Patch patch(pDest, dwPatchSize);
if (dwPatchSize >= 5 && pDest)
{
BYTE OpSize, OpCode;
switch (dwJumpType)
{
case IJ_PUSHRET: OpSize = 6; OpCode = 0x68; break;
case IJ_FARJUMP: OpSize = 7; OpCode = 0xEA; break;
case IJ_FARCALL: OpSize = 7; OpCode = 0x9A; break;
case IJ_CALL: OpSize = 5; OpCode = 0xE8; break;
default: OpSize = 5; OpCode = 0xE9; break;
}
if (dwPatchSize < OpSize)
throw std::exception("Not enough space to patch opcode.");
patch.write(OpCode);
switch (OpSize)
{
case 7:
patch.write((ULONG)pCallee);
patch.write<WORD>(0x23);
break;
case 6:
patch.write((ULONG)pCallee);
patch.write<BYTE>(0xC3);
break;
default:
patch.write((ULONG)pCallee - (ULONG)pDest - 5);
break;
}
for (DWORD i = OpSize; i < dwPatchSize; i++)
patch.write<BYTE>(0x90);
}
}
}

View File

@ -1,32 +0,0 @@
#pragma once
#include <stdexcept>
#include <Windows.h>
namespace fk
{
enum GameVersion
{
GAME_VERSION_NONE = -1,
GAME_VERSION_BR, // 1.05 Br
GAME_VERSION_EN, // 1.05 Du, En, Fr, It, Po, Sp, Sw
GAME_VERSION_GE, // 1.05
GAME_VERSION_NA, // 1.05
GAME_VERSION_SA, // 1.05
GAME_VERSION_TRY // 1.07 Trymedia
};
enum InsertJump
{
IJ_JUMP, // Insert a jump (0xE9) with patchJump
IJ_CALL, // Insert a call (0xE8) with patchJump
IJ_FARJUMP, // Insert a farjump (0xEA) with patchJump
IJ_FARCALL, // Insert a farcall (0x9A) with patchJump
IJ_PUSHRET, // Insert a pushret with patchJump
};
int getGameVersion(DWORD timeDateStamp);
std::string getErrorMessage(int error);
void patchNops(ULONG dwAddr, SIZE_T dwPatchSize);
void patchJump(PVOID pDest, SIZE_T dwPatchSize, PVOID pCallee, DWORD dwJumpType = IJ_JUMP);
}

View File

@ -3,6 +3,7 @@
#include <WinInet.h>
#include <winsock.h>
#include "fkConfig.h"
#include "fkPatch.h"
#include "fkUtils.h"
#include "PEInfo.h"
@ -135,19 +136,19 @@ bool __stdcall patchResolveIP(LPSTR buffer, int bufferLength)
void patch(PEInfo& pe, int gameVersion)
{
fk::patchJump((PVOID)pe.Offset(0x00001799), 5, &patchResolveIP, fk::IJ_JUMP); // replace IP resolve with web service
fk::Patch::jump(pe.Offset(0x00001799), 5, &patchResolveIP, fk::IJ_JUMP); // replace IP resolve with web service
if (gameVersion == fk::GAME_VERSION_TRY)
{
fk::patchNops(pe.Offset(0x00053B96), 5); // prevent overriding IP with user name
fk::patchNops(pe.Offset(0x00054693), 5); // prevent overriding IP with NAT IP
fk::patchNops(pe.Offset(0x00054635), 11); // useless sleep when connecting to server
fk::Patch::nops(pe.Offset(0x00053B96), 5); // prevent overriding IP with user name
fk::Patch::nops(pe.Offset(0x00054693), 5); // prevent overriding IP with NAT IP
fk::Patch::nops(pe.Offset(0x00054635), 11); // useless sleep when connecting to server
}
else
{
fk::patchNops(pe.Offset(0x00053E96), 5); // prevent overriding IP with user name
fk::patchNops(pe.Offset(0x00054935), 11); // useless sleep when connecting to server
fk::patchNops(pe.Offset(0x00054993), 5); // prevent overriding IP with NAT IP
fk::Patch::nops(pe.Offset(0x00053E96), 5); // prevent overriding IP with user name
fk::Patch::nops(pe.Offset(0x00054935), 11); // useless sleep when connecting to server
fk::Patch::nops(pe.Offset(0x00054993), 5); // prevent overriding IP with NAT IP
}
}
@ -163,9 +164,9 @@ BOOL WINAPI DllMain(HMODULE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
int version = fk::getGameVersion(pe.FH->TimeDateStamp);
if (version == fk::GAME_VERSION_NONE)
{
MessageBox(NULL, "fkNetcode is incompatible with your game version. Please run the 1.05 patch or "
"1.07 release of Worms 2. Otherwise, you can delete the module to remove this warning.",
"fkNetcode", MB_ICONWARNING);
MessageBox(NULL, "fkNetcode is incompatible with your game version. Please run the 1.05 patch or 1.07 "
"release of Worms 2. Otherwise, you can delete the module to remove this warning.", "fkNetcode",
MB_ICONWARNING);
}
else
{