什么是Visual C ++。Net的交易? [英] Whats the Deal with Visual C++.Net?

查看:69
本文介绍了什么是Visual C ++。Net的交易?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我是一名经验丰富的C / C ++程序员(Unix背景),我希望用Visual Studio .Net获得
的速度。


我想在我的应用程序中使用遗留的C / C ++代码。但是,

我不知道如何从我的C ++ DLL中调用我的本机C ++函数。

混淆是这样的:我目前有Visual Studio 2003还不清楚

我是否应该使用托管扩展或C ++ / Interop?


我看过MSDN网站的一些示例代码。语法

看起来很奇怪 - 没有像C ++那样。


例如,我看到一个声明类型的变量:String ^

什么...?


这是什么意思?我认为这是MS生产过的最具ISO C ++兼容性的b $ b C +++。我在这里错过了一些东西吗?


最后,但并非最不重要的是,每个人(包括微软)都在考虑这个事实IL代码很容易被反转。是否有人在那里使用.Net和交付客户实际构建应用程序

?他们如何确保他们的IP

受到保护?似乎(AFAIK)甚至形式(即所有你的b $ b b表示逻辑)被编译成IL,这很容易被反转为b
。 MS会吃自己的狗粮吗?有没有人知道用.Net编写的任何商业MS应用程序实际编写为IL?


我将非常有兴趣听取您的意见。 />

PS:我知道即使是本机C二进制文件也可以通过一个足够长的黑客进行逆向工程 - 但这种安全级别由本机提供

二进制文件对我来说已经足够了。我会抓住机会。

Hi All,

I am a veteran C/C++ programmer (Unix background) and I want to get to
speed with Visual Studio .Net

I have legacy C/C++ code that I want to use in my application. However,
I''m not sure how to call my native C++ functions from my C++ DLLs. The
confusion is this: I currently have Visual Studio 2003 it is not clear
whether I should use managed extensions or C++/Interop?

I have had a look at some sample code from the MSDN site. The syntax
looks wierd - nothing like C++.

For example, I saw a variable declared of type: String ^
what the ...?

What does this mean?. I thought this was the most ISO C++ compatable
C+++ that MS has ever produced. Am I missing something here?

Lastly, but not the least, is the apparant casual nature with which
everyone (Microsoft included), is treating the fact that the IL code is
easily reversed. Is anyone out there actually building applications
using .Net and delivering to clients?. How do they ensure that their IP
is protected?. It seems (AFAIK) that even forms (i.e. all your
presentation logic) are compiled to IL, which can easily be reverse
engineered. Does MS eat its own dog food? Does anyone know of any
commercial MS application actual written in .Net and compiled as IL?

I will be very interested in hearing your comments.

PS: I know that even native C binaries can be reverse engineered by a
persistent enough hacker - but that level of security afforded by native
binaries is sufficient to me. I''ll take my chances with that.

推荐答案

Paul Tremblay写道:
Paul Tremblay wrote:
大家好,

我是一名经验丰富的C / C ++程序员(Unix背景),我想用Visual Studio获得速度.Net

我有遗留的C / C ++我想在我的应用程序中使用的代码。
但是,我不知道如何从我的C ++
DLL调用我的本机C ++函数。令人困惑的是:我目前有Visual Studio 2003它不清楚我是否应该使用托管扩展或C ++ / Interop?


为什么不保持原生一切?尽管产品名称中包含.NET,但您并不需要在

全部使用.NET。你仍然可以使用MFC或WTL或你选择的任何库来构建本机用户

接口。


如果你想要与本机代码互操作,你有三种选择:


1.托管C ++ IJW(它正常工作)。托管C ++可以简单地调用非托管的

C ++。

2. P / Invoke(平台调用)服务可用于调用来自

的本机代码任何.NET语言。

3. COM Interop服务可用于从任何.NET

语言调用本机代码。


其中,IJW是最快的,COM互操作是最慢的。

我看过MSDN网站上的一些示例代码。语法
看起来很奇怪 - 没有像C ++那样。

例如,我看到一个声明类型的变量:String ^
是什么......?


是的。您正在查看VC ++ 2005的文档,除了ISO C ++之外,它还实现了新的

语言。这种新语言称为C ++ / CLI。对于

VC ++ 2003,您需要查看Managed Extensions for C ++。应该

是你的... / Microsoft Visual Studio .NET 2003 / vc7文件夹中的Word文档

名为managedextensionsspec.doc。这告诉你一切。虽然没有为Java编写JNI接口代码那么糟糕。

最后,但并非最不重要的是,具有明显的休闲性质<每个人(包括微软)都在考虑IL代码很容易逆转的事实。有人在那里实际构建应用程序
使用.Net并交付给客户吗?他们如何确保他们的IP受到保护?似乎(AFAIK)甚至形式(即你所有的演示逻辑)被编译成IL,可以很容易地反向设计。 MS会吃自己的狗粮吗?有谁知道任何实际用.Net写的商业MS应用程序并编译为IL?


没有完整的应用程序(我知道),但是大部分的Visual Studio

2005(在较小程度上,2003年和2002年) )用托管代码编写

(主要是较旧的托管C ++或新的C ++ / CLI)。


有商业应用程序运输是纯粹的。净。例如,

SourceGear Vault,一个源代码控制程序,是纯IL代码。


在这个问题上,你并不孤单。看看它在接下来的几年中如何发挥作用将会很有趣。注意Java有同样的问题 - 字节码

可以轻松地和机械地反向设计成可编译的源代码

代码。

我会非常有兴趣听取你的意见。

PS:我知道即使是原生的C二进制文件也可以由持久的黑客进行逆向工程 - 但是本机二进制文件提供的安全级别对我来说已经足够了。我会抓住机会。
Hi All,

I am a veteran C/C++ programmer (Unix background) and I want to get to
speed with Visual Studio .Net

I have legacy C/C++ code that I want to use in my application.
However, I''m not sure how to call my native C++ functions from my C++
DLLs. The confusion is this: I currently have Visual Studio 2003 it
is not clear whether I should use managed extensions or C++/Interop?
Why not just keep everything native? You''re not required to use .NET at
all, despite the .NET in the product name. You can still build native user
interfaces using MFC or WTL or any library of your choice.

If you do want to interop with native code, you have three choices:

1. Managed C++ IJW (It Just Works). Managed C++ can simply call unmanaged
C++.
2. P/Invoke (Platform Invoke) services can be used to call native code from
any .NET language.
3. COM Interop services can be used to call native code from any .NET
language.

Of these, IJW is the fastest and COM interop is the slowest.
I have had a look at some sample code from the MSDN site. The syntax
looks wierd - nothing like C++.

For example, I saw a variable declared of type: String ^
what the ...?

What does this mean?. I thought this was the most ISO C++ compatable
C+++ that MS has ever produced. Am I missing something here?
Yes. You''re looking at documentation for VC++ 2005, which implements a new
language in addition to ISO C++. That new language is called C++/CLI. For
VC++ 2003, you need to look at "Managed Extensions for C++". There should
be a Word document in your .../Microsoft Visual Studio .NET 2003/vc7 folder
called "managedextensionsspec.doc" that tells you all about it. It''s
painful, although not nearly as bad as writing JNI interface code for Java.
Lastly, but not the least, is the apparant casual nature with which
everyone (Microsoft included), is treating the fact that the IL code
is easily reversed. Is anyone out there actually building applications
using .Net and delivering to clients?. How do they ensure that their
IP is protected?. It seems (AFAIK) that even forms (i.e. all your
presentation logic) are compiled to IL, which can easily be reverse
engineered. Does MS eat its own dog food? Does anyone know of any
commercial MS application actual written in .Net and compiled as IL?
No entire applications (that I''m aware of), but large parts of Visual Studio
2005 (and to a lesser extent, 2003 and 2002) are written in managed code
(mostly either the older Managed C++ or the new C++/CLI).

There are commercial applications shipping that are pure .NET. For example,
SourceGear Vault, a source code control program, is pure IL code.

You''re not alone in this concern. It''ll be interesting to see how it plays
out over the next few years. Note that Java has the same problem - bytecode
can be easily and mechanically reverse-engineered into compilable source
code.

I will be very interested in hearing your comments.

PS: I know that even native C binaries can be reverse engineered by a
persistent enough hacker - but that level of security afforded by
native binaries is sufficient to me. I''ll take my chances with that.



" Paul Tremblay" < PT ******* @ hotmail.com>在消息中写道

news:d8 ********** @ nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com ...

最后,但并非最不重要的是,
"Paul Tremblay" <pt*******@hotmail.com> wrote in message
news:d8**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com...
Lastly, but not the least, is the apparant casual nature with which
每个人(包括微软)都认为IL代码很容易被逆转。有人在那里实际使用
.Net建立应用程序并交付给客户吗?他们如何确保他们的知识产权受到保护?。
everyone (Microsoft included), is treating the fact that the IL code is
easily reversed. Is anyone out there actually building applications using
.Net and delivering to clients?. How do they ensure that their IP is
protected?.




这是一个很好的问题,我希望我能听到一个令人满意的

回答。 : - (


顺便问一下,你知道原生图像生成器 - ngen吗?

http://msdn.microsoft.com/library/ de ... torNgenexe.asp


它用于预先jit(在使用之前编译)IL到本机代码。

加上它应该使拆卸过程更加困难。在

下面,它应该是在每个最终用户身上做的事情

系统。


问候,





That''s a good question for which I wish I have ever heard a satisfying
answer. :-(

Just by the way, do you know about the Native Image Generator - ngen?

http://msdn.microsoft.com/library/de...torNgenexe.asp

It is used to pre-jit (compile in advance of use) the IL to native code. On
the plus-side it ought to make the disassembly process more difficult. On
the down-side it is something that is supposed to be done on each end-user''s
system.

Regards,
Will


>最后,但并非最不重要的是,
> Lastly, but not the least, is the apparant casual nature with which
每个人(包括微软)都是轻松的休闲性质,正在轻松地处理IL代码的事实有人在那里实际使用.Net和d构建应用程序
向客户传播?他们如何确保他们的知识产权受到保护?
这是一个很好的问题,我希望我听到过令人满意的答案。 :-(

顺便问一下,你知道原生图像生成器吗?ngen?
everyone (Microsoft included), is treating the fact that the IL code is
easily reversed. Is anyone out there actually building applications using .Net and delivering to clients?. How do they ensure that their IP is
protected?.
That''s a good question for which I wish I have ever heard a satisfying
answer. :-(

Just by the way, do you know about the Native Image Generator - ngen?


http://msdn.microsoft.com/library/ de ... torNgenexe.asp
它用于预先jit(在使用之前编译)IL到本机代码。
在正面它应该进行反汇编处理起来比较困难。对于不利的事情,应该在每个
最终用户的系统上完成。


http://msdn.microsoft.com/library/de...torNgenexe.asp
It is used to pre-jit (compile in advance of use) the IL to native code. On the plus-side it ought to make the disassembly process more difficult. On
the down-side it is something that is supposed to be done on each end-user''s system.




不要被愚弄无法管理的代码是不可能的逆向工程师。

这有点难,但是不值得努力浪费时间

保护你的代码。


非托管代码可以在几天内对当前工具进行反转设计如果有人真的想要的话,那么

不是小时。

使用您放入的时间保护新功能

使您的产品比竞争对手更好。


非专业代码的反向引擎可以轻松完成,因为专业

disasemblers查看可执行代码中的模式,以确定你使用的标准C ++函数是什么。除非您编写所有C ++代码,例如

文件处理,自己进行字符串处理,否则可以很容易地以

非常可读的形式进行反汇编。弱点仍然是WINAPI调用,如果你使用一个

的那些调用,那么反汇编程序会使这个可读的语句。


看看这个IDA Pro disassmebler:
http://www.datarescue.com/ idabase / index.htm



Don''t get fooled that unmanaged code is impossible te reverse engineer.
It is a little harder, but it is not worth the effort to lose time in
protecting your code.

Unmanaged code can with the current tools be reversed engineered in days if
not hours if someone really wants to.
Use the time that you would put in your protection for new functionality to
make your product even better than the competition.

Reverse enginering of unmanaged code can be easily done because professional
disasemblers look at patterns in the executable code to determin what
standard C++ function you have used. Unless you write all your C++ code like
file handling, string handling yourself, it can be easily disassembled in a
very readabel form. The weak point is still the WINAPI calls, if you use one
of those calls, then the disassembler makes this a readable statment.

Just look at this IDA Pro disassmebler:
http://www.datarescue.com/idabase/index.htm


这篇关于什么是Visual C ++。Net的交易?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆