-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[tool] 코드 및 바이너리를 추출할 때 파일 헤더의 정보를 변경할 수 있는 옵션 추가
코드 또는 바이너리를 추출할 때 코드에 바이너리 정보 또는 파일 헤더의 정보를 변경할 수 있다. - 추출된 코드의 리버전 정보, 해시값을 변경 - 추출된 바이너리의 파일 헤더의 리비전, 해시값을 변경 사용예) .\cremadev.exe get <address> <path> --database Default --replace-revision 0 --replace-hashvalue 0
- Loading branch information
Showing
7 changed files
with
142 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
tools/Ntreev.Crema.Commands/OptionProcessor/ReplaceOptionProcessor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
//Released under the MIT License. | ||
// | ||
//Copyright (c) 2018 Ntreev Soft co., Ltd. | ||
// | ||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
//documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
//rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
//persons to whom the Software is furnished to do so, subject to the following conditions: | ||
// | ||
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
//Software. | ||
// | ||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
//WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
//COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
//OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Ntreev.Crema.Runtime.Generation; | ||
using Ntreev.Crema.Runtime.Serialization; | ||
|
||
namespace Ntreev.Crema.Commands.OptionProcessor | ||
{ | ||
static class ReplaceOptionProcessor | ||
{ | ||
public static Tuple<GenerationSet, SerializationSet> Process(Tuple<GenerationSet, SerializationSet> metaData) | ||
{ | ||
var generationSet = metaData.Item1; | ||
var serializationSet = metaData.Item2; | ||
|
||
generationSet = Process(generationSet); | ||
serializationSet = Process(serializationSet); | ||
|
||
return new Tuple<GenerationSet, SerializationSet>(generationSet, serializationSet); | ||
} | ||
|
||
public static GenerationSet Process(GenerationSet generationSet) | ||
{ | ||
if (ReplaceSettings.ReplaceHashValue != null) | ||
{ | ||
generationSet.Revision = ReplaceSettings.ReplaceRevision; | ||
generationSet.TablesHashValue = ReplaceSettings.ReplaceHashValue; | ||
generationSet.TypesHashValue = ReplaceSettings.ReplaceHashValue; | ||
} | ||
|
||
return generationSet; | ||
} | ||
|
||
public static SerializationSet Process(SerializationSet serializationSet) | ||
{ | ||
if (ReplaceSettings.ReplaceRevision != long.MinValue) | ||
{ | ||
serializationSet.Revision = ReplaceSettings.ReplaceRevision; | ||
serializationSet.TablesHashValue = ReplaceSettings.ReplaceHashValue; | ||
serializationSet.TypesHashValue = ReplaceSettings.ReplaceHashValue; | ||
} | ||
|
||
return serializationSet; | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
//Released under the MIT License. | ||
// | ||
//Copyright (c) 2018 Ntreev Soft co., Ltd. | ||
// | ||
//Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated | ||
//documentation files (the "Software"), to deal in the Software without restriction, including without limitation the | ||
//rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit | ||
//persons to whom the Software is furnished to do so, subject to the following conditions: | ||
// | ||
//The above copyright notice and this permission notice shall be included in all copies or substantial portions of the | ||
//Software. | ||
// | ||
//THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE | ||
//WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
//COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
//OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.ComponentModel; | ||
using System.Linq; | ||
using System.Text; | ||
using System.Threading.Tasks; | ||
using Ntreev.Library.Commands; | ||
|
||
namespace Ntreev.Crema.Commands | ||
{ | ||
static class ReplaceSettings | ||
{ | ||
[CommandProperty] | ||
[DefaultValue((long)long.MinValue)] | ||
[Description("바이너리 파일 헤더의 Revision 값을 변경합니다.")] | ||
public static long ReplaceRevision | ||
{ | ||
get; set; | ||
} | ||
|
||
[CommandProperty("replace-hashvalue")] | ||
[DefaultValue(null)] | ||
[Description("바이너리 파일 헤더의 TablesHashValue, TypesHashValue 값을 변경합니다.")] | ||
public static string ReplaceHashValue | ||
{ | ||
get; set; | ||
} | ||
} | ||
} |