You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
LibLogger.WarnNewline($"\t\tCouldn't calculate coefficients for {signature}, got only 2 instructions but the last was {relevantInstructions[^1].Mnemonic}, not I32And or I32Add");
156
159
continue;
157
160
}
161
+
162
+
LibLogger.VerboseNewline($"\t\tCoefficients for {signature}: andWith {andWith}, addConstant {add}");
LibLogger.WarnNewline($"\t\tCoefficient for {signature} using I32Sub not I32Add, this may not work!");
178
183
}
184
+
185
+
LibLogger.VerboseNewline($"\t\tCoefficients for {signature}: andWith {andWith}, addConstant {add}");
179
186
}
180
187
elseif(disassembled.All(d =>d.MnemonicisWasmMnemonic.LocalGet or WasmMnemonic.CallIndirect or WasmMnemonic.End))
181
188
{
182
189
//No remapping
183
190
andWith=int.MaxValue;
184
191
add=0;
192
+
LibLogger.VerboseNewline($"\t\tAssuming index is not manipulated for dynCall_{signature} (method only contains LocalGet, CallIndirect, End instructions)");
//CallIndirect and everything before is just LocalGet, we assume not modified
205
+
LibLogger.VerboseNewline($"\t\tAssuming index is not manipulated for dynCall_{signature} (only LocalGet instructions before the CallIndirect)");
206
+
andWith=int.MaxValue;
207
+
add=0;
208
+
}elseif(disassembled.FindIndex(i =>i.Mnemonic==WasmMnemonic.CallIndirect)isvarcallIdx2 and >0&&disassembled[callIdx2-1]is{Mnemonic:WasmMnemonic.LocalGet,Operands:[(byte)0]})
209
+
{
210
+
//CallIndirect with LocalGet 0 just before, assume not modified - this is sketchy though
211
+
LibLogger.VerboseNewline($"\t\tAssuming index is not manipulated for dynCall_{signature} (LocalGet 0 instruction immediately before the CallIndirect)");
212
+
andWith=int.MaxValue;
213
+
add=0;
193
214
}
194
215
else
195
216
{
196
217
LibLogger.WarnNewline($"\t\tCouldn't calculate coefficients for {signature}, got {relevantInstructions.Length} instructions; expecting 4");
0 commit comments