View Single Post
  #3  
Old 09-10-2016, 18:47
ahmadmansoor's Avatar
ahmadmansoor ahmadmansoor is offline
Coder
 
Join Date: Feb 2006
Location: Syria
Posts: 1,045
Rept. Given: 509
Rept. Rcvd 373 Times in 142 Posts
Thanks Given: 336
Thanks Rcvd at 407 Times in 119 Posts
ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399 ahmadmansoor Reputation: 300-399
Question

Hi Kurapica
this is from x64dbg src
do u have any solution for this :
vb.net Marshal List Of Compicated Structure and get Pointer for this List

Quote:
<StructLayout(LayoutKind.Sequential)> Structure ModuleInfo
Public base As Int64
Public size As Int64
Public entry As Int64
Public sectionCount As Integer
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAX_MODULE_SIZE)> Public name As String
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=MAX_PATH)> Public path As String
End Structure


Public Function cbModuleEnum(ByVal argc As Integer, ByVal argv() As String) As Boolean

Dim ModuleInfo_Strc As New List(Of ModuleInfo)
Dim modlist As IntPtr = Marshal.AllocHGlobal(Marshal.SizeOf(ModuleInfo_Strc)) ' New List(Of ModuleInfo) 'here is the error
Dim s As Boolean = GetList(ModuleInfo_Strc)
Marshal.PtrToStructure(modlist, ModuleInfo_Strc)
Return 1
End Function
Quote:
An unhandled exception of type 'System.ArgumentException' occurred in x.dll

Additional information: Type 'System.Collections.Generic.List`1[x.Script+ModuleInfo]' cannot be marshaled as an unmanaged structure; no meaningful size or offset can be computed.
so what the easy way to solve this problem
__________________
Ur Best Friend Ahmadmansoor
Always My Best Friend: Aaron & JMI & ZeNiX
Reply With Quote