Hi,
I've seen in some assemblies the following issue:
when a class implements some interface, the implemented methods cant be private, dont know if its up to protector or smth else. Is it possbile to add analysis in Refl to make these methods public?
example
source module with issues
=================
using System;
using System.Runtime.InteropServices;
public class c000806 : afv, IDisposable
{
private int f000002;
private int f00002f;
private IntPtr f000058;
public c000806(int A_0)
{
this.f000058 = Marshal.AllocCoTaskMem(A_0);
this.f000002 = A_0;
}
public void Dispose()
{
if (this.f000058 != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(this.f000058);
this.f000058 = IntPtr.Zero;
GC.SuppressFinalize(this);
}
}
~c000806()
{
this.Dispose();
}
public int m00000c()
{
return this.f00002f;
}
private int m000025(int A_0)
{
if (A_0 > this.f000002)
{
return -2147483645;
}
this.f00002f = A_0;
return 0;
}
private int m000025(out int A_0)
{
A_0 = this.f000002;
return 0;
}
public void m00003f(int A_0)
{
if (this.f00002f > this.f000002)
{
throw new ArgumentException("Cannot be greater than maximum buffer size");
}
this.f00002f = A_0;
}
private int m00055e(IntPtr A_0, IntPtr A_1)
{
if (A_0 != IntPtr.Zero)
{
Marshal.WriteIntPtr(A_0, this.f000058);
}
if (A_1 != IntPtr.Zero)
{
Marshal.WriteInt32(A_1, this.f00002f);
}
return 0;
}
public void m0009b5(byte[] A_0, int A_1)
{
this.m00003f(A_1);
Marshal.Copy(A_0, 0, this.f000058, A_1);
}
public void m000d5c(byte[] A_0, int A_1)
{
Marshal.Copy(this.f000058, A_0, A_1, this.m00000c());
}
}
interface
================
using System;
using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("59eff8b9-938c-4a26-82f2-95cb84cdc837"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), SuppressUnmanagedCodeSecurity]
public interface afv
{
[PreserveSig]
int m000025(int A_0);
[PreserveSig]
int m000025(out int A_0);
[PreserveSig]
int m00055e(IntPtr A_0, IntPtr A_1);
}
issues
================
Error 3 'c000806' does not implement interface member 'afv.m000025(int)'. 'c000806.m000025(int)' cannot implement an interface member because it is not public.
Error 2 'c000806' does not implement interface member 'afv.m000025(out int)'. 'c000806.m000025(out int)' cannot implement an interface member because it is not public.
Error 1 'c000806' does not implement interface member 'afv.m00055e(System.IntPtr, System.IntPtr)'. 'c000806.m00055e(System.IntPtr, System.IntPtr)' cannot implement an interface member because it is not public. \NS371857150\c000806.cs 4 14
I've seen in some assemblies the following issue:
when a class implements some interface, the implemented methods cant be private, dont know if its up to protector or smth else. Is it possbile to add analysis in Refl to make these methods public?
example
source module with issues
=================
using System;
using System.Runtime.InteropServices;
public class c000806 : afv, IDisposable
{
private int f000002;
private int f00002f;
private IntPtr f000058;
public c000806(int A_0)
{
this.f000058 = Marshal.AllocCoTaskMem(A_0);
this.f000002 = A_0;
}
public void Dispose()
{
if (this.f000058 != IntPtr.Zero)
{
Marshal.FreeCoTaskMem(this.f000058);
this.f000058 = IntPtr.Zero;
GC.SuppressFinalize(this);
}
}
~c000806()
{
this.Dispose();
}
public int m00000c()
{
return this.f00002f;
}
private int m000025(int A_0)
{
if (A_0 > this.f000002)
{
return -2147483645;
}
this.f00002f = A_0;
return 0;
}
private int m000025(out int A_0)
{
A_0 = this.f000002;
return 0;
}
public void m00003f(int A_0)
{
if (this.f00002f > this.f000002)
{
throw new ArgumentException("Cannot be greater than maximum buffer size");
}
this.f00002f = A_0;
}
private int m00055e(IntPtr A_0, IntPtr A_1)
{
if (A_0 != IntPtr.Zero)
{
Marshal.WriteIntPtr(A_0, this.f000058);
}
if (A_1 != IntPtr.Zero)
{
Marshal.WriteInt32(A_1, this.f00002f);
}
return 0;
}
public void m0009b5(byte[] A_0, int A_1)
{
this.m00003f(A_1);
Marshal.Copy(A_0, 0, this.f000058, A_1);
}
public void m000d5c(byte[] A_0, int A_1)
{
Marshal.Copy(this.f000058, A_0, A_1, this.m00000c());
}
}
interface
================
using System;
using System.Runtime.InteropServices;
using System.Security;
[ComImport, Guid("59eff8b9-938c-4a26-82f2-95cb84cdc837"), InterfaceType(ComInterfaceType.InterfaceIsIUnknown), SuppressUnmanagedCodeSecurity]
public interface afv
{
[PreserveSig]
int m000025(int A_0);
[PreserveSig]
int m000025(out int A_0);
[PreserveSig]
int m00055e(IntPtr A_0, IntPtr A_1);
}
issues
================
Error 3 'c000806' does not implement interface member 'afv.m000025(int)'. 'c000806.m000025(int)' cannot implement an interface member because it is not public.
Error 2 'c000806' does not implement interface member 'afv.m000025(out int)'. 'c000806.m000025(out int)' cannot implement an interface member because it is not public.
Error 1 'c000806' does not implement interface member 'afv.m00055e(System.IntPtr, System.IntPtr)'. 'c000806.m00055e(System.IntPtr, System.IntPtr)' cannot implement an interface member because it is not public. \NS371857150\c000806.cs 4 14