Skip to content

Commit

Permalink
Core.Utils: NewArm64 stop disassembling when an invalid instruction i…
Browse files Browse the repository at this point in the history
…s hit
  • Loading branch information
gompoc committed Aug 13, 2024
1 parent a297189 commit 3946e73
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Cpp2IL.Core/Utils/NewArm64Utils.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using Disarm;
Expand Down Expand Up @@ -35,7 +35,7 @@ public static List<Arm64Instruction> GetArm64MethodBodyAtVirtualAddress(ulong vi
var span = allBytes.AsSpan(pos, 4);
List<Arm64Instruction> ret = new();

while ((count == -1 || ret.Count < count) && !ret.Any(i => i.Mnemonic is Arm64Mnemonic.B))
while ((count == -1 || ret.Count < count) && !ret.Any(i => i.Mnemonic is Arm64Mnemonic.B || i.Mnemonic is Arm64Mnemonic.INVALID))
{
ret = Disassemble(span, virtAddress);

Expand Down

0 comments on commit 3946e73

Please sign in to comment.