Skip to content

error CS0019: Operator '>' cannot be applied to operands of type 'Image' and 'Image' #3465

Description

@greenozon

Erroneous output

			foreach (PdfName key in pdfDictionary.Keys)
			{
				PdfObject pdfObject = pdfDictionary.Get(key);
				PdfObject pdfObject2 = pdfReader.GetPdfObject(((PRIndirectReference)pdfObject).Number);
				if (smethod_2(pdfObject2) > Class13.image_0)
				{
					list_1.Add(smethod_2(pdfObject2));
				}
			}


IL:


			// PdfObject pdfObject2 = pdfReader.GetPdfObject(((PRIndirectReference)pdfObject).Number);
			IL_0074: ldloc.0
			IL_0075: ldloc.s 4
			IL_0077: castclass [itextsharp]iTextSharp.text.pdf.PRIndirectReference /* 010000F9 */
			IL_007c: callvirt instance int32 [itextsharp]iTextSharp.text.pdf.PdfIndirectReference::get_Number() /* 0A00020B */
			IL_0081: callvirt instance class [itextsharp]iTextSharp.text.pdf.PdfObject [itextsharp]iTextSharp.text.pdf.PdfReader::GetPdfObject(int32) /* 0A00020C */
			IL_0086: stloc.s 5
			// if (smethod_2(pdfObject2) > Class13.image_0)
			IL_0088: ldloc.s 5
			IL_008a: call class [System.Drawing]System.Drawing.Image ns0.DashboardForm::smethod_2(class [itextsharp]iTextSharp.text.pdf.PdfObject) /* 060000B5 */
			IL_008f: ldsfld class [System.Drawing]System.Drawing.Image ns0.Class13::image_0 /* 0400020F */
			IL_0094: cgt.un
			IL_0096: brfalse.s IL_00aa

error CS0019: Operator '>' cannot be applied to operands of type 'Image' and 'Image'

dnSpy gens OK code:

		foreach (PdfName pdfName in pdfDictionary.Keys)
		{
			PdfObject pdfObject = pdfDictionary.Get(pdfName);
			PdfObject pdfObject2 = pdfReader.GetPdfObject(((PRIndirectReference)pdfObject).Number);
			if (smethod_2(pdfObject2) != Class13.image_0)
			{
				this.list_1.Add(DashboardForm.smethod_2(pdfObject2));
			}
		}

Details

  • ILSpy version 9.1.0.7988+03b7444943e720b3134d296c0c8dd3876f8ea4ce
  • .NET version 8.0.15+50c4cb9fc31c47f03eac865d7bc518af173b74b7

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugDecompilerThe decompiler engine itselfObfuscatedProblem with obfuscated assembly. Note: We can't support every crazyness obfuscators come up with.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions