title: I want to Convert a C++ code to vb.net
body: <p>This is the code for testing my shell-code in c++, I tried to convert it with a program but it didn't work,Thanks in advance for the answers</p>
  
  <pre><code>enter code here
  int main (int argc, char **argv)
  {
  
  int (*ret)();
  
  
  ret = (int(*)())shellcode;  
       (int)(*ret)();             
  }
  </code></pre>
  
  <p>and this is the resulted code when i use a program to convert but it didnt work in my visual studio 2010:</p>
  
  <p>enter code here</p>
  
  <pre><code>Imports System
  
  Shared Sub Main(ByVal args() As String)
  
  enter code here
  'C++ TO VB CONVERTER TODO TASK: This delegate declaration (converted from the original            function pointer) must be moved outside of this method:
  
  
  Private Delegate Function retDelegate() As Integer ' ret is a function pointer
  
  
  
  Dim ret As retDelegate
  
  
  
  ret = ()shellcode ' ret points to our shellcode
                                 ' shellcode is type caste as a function 
  CInt(Math.Truncate(ret())) ' execute, as a function, shellcode[]
  
  End Sub
  </code></pre>