@@ -47,6 +47,7 @@ internal unsafe static Dictionary<int, string> Extract(JsonNode opcodeMapData, b
4747
4848 if ( ! ReadJSONInt ( opcodeMapData , "switchTableOffset_offset" , out var switchTableOffset_offset ) ) return [ ] ;
4949 if ( ! ReadJSONInt ( opcodeMapData , "switchTableCount_offset" , out var switchTableCount_offset ) ) return [ ] ;
50+ if ( ! ReadJSONInt ( opcodeMapData , "expectedSwitchTableCount" , out var expectedSwitchTableCount ) ) return [ ] ;
5051 if ( ! ReadJSONInt ( opcodeMapData , "defaultCaseAddr_offset" , out var defaultCaseAddr_offset ) ) return [ ] ;
5152 if ( ! ReadJSONInt ( opcodeMapData , "imageBaseOffset_offset" , out var imageBaseOffset_offset ) ) return [ ] ;
5253 if ( ! ReadJSONInt ( opcodeMapData , "switchTableDataOffset_offset" , out var switchTableDataOffset_offset ) ) return [ ] ;
@@ -63,6 +64,11 @@ internal unsafe static Dictionary<int, string> Extract(JsonNode opcodeMapData, b
6364
6465 var switchTableOffset = * ( sbyte * ) ( funcPtr + switchTableOffset_offset ) ;
6566 var switchTableCount = * ( int * ) ( funcPtr + switchTableCount_offset ) ;
67+ Console. WriteLine ( $ "Expected { expectedSwitchTableCount } entries, found { switchTableCount } ") ;
68+ if ( expectedSwitchTableCount != switchTableCount ) {
69+ Console . WriteLine ( "Switch table count mismatch, press any key to continue anyways" ) ;
70+ Console . ReadKey ( true ) ;
71+ }
6672 var defaultCaseAddr = offset + defaultCaseAddr_offset + Common . ExtractRIPOffsetFromPtr ( funcPtr + defaultCaseAddr_offset ) ;
6773 var imageBaseOffset = offset + imageBaseOffset_offset + Common . ExtractRIPOffsetFromPtr ( funcPtr + imageBaseOffset_offset ) ;
6874 var switchTableDataOffset = * ( int * ) ( funcPtr + switchTableDataOffset_offset ) ;
0 commit comments