Remove "castclass System.String" if present
This commit is contained in:
parent
42ff75c7ff
commit
d6f3ff64b9
|
@ -34,6 +34,13 @@ namespace de4dot.code {
|
||||||
int ldstrIndex = callResult.callStartIndex;
|
int ldstrIndex = callResult.callStartIndex;
|
||||||
block.replace(ldstrIndex, num, Instruction.Create(OpCodes.Ldstr, (string)callResult.returnValue));
|
block.replace(ldstrIndex, num, Instruction.Create(OpCodes.Ldstr, (string)callResult.returnValue));
|
||||||
|
|
||||||
|
// If it's followed by castclass string, remove it
|
||||||
|
if (ldstrIndex + 1 < block.Instructions.Count) {
|
||||||
|
var instr = block.Instructions[ldstrIndex + 1];
|
||||||
|
if (instr.OpCode.Code == Code.Castclass && instr.Operand.ToString() == "System.String")
|
||||||
|
block.remove(ldstrIndex + 1, 1);
|
||||||
|
}
|
||||||
|
|
||||||
// If it's followed by String.Intern(), then nop out that call
|
// If it's followed by String.Intern(), then nop out that call
|
||||||
if (ldstrIndex + 1 < block.Instructions.Count) {
|
if (ldstrIndex + 1 < block.Instructions.Count) {
|
||||||
var instr = block.Instructions[ldstrIndex + 1];
|
var instr = block.Instructions[ldstrIndex + 1];
|
||||||
|
|
Loading…
Reference in New Issue
Block a user