私はdotPeekとがmscorlib.dllを逆コンパイルし、メソッド内私はそれ私も、オープンソースの.NETのコアに、この方法を探している
string s = ReplaceInternal(oldValue, newValue);
見つけることができませんReplaceInternalメソッドの呼び出しがありますGITは運がない。
この方法で、何が内側になっているところ教えてください?
私はdotPeekとがmscorlib.dllを逆コンパイルし、メソッド内私はそれ私も、オープンソースの.NETのコアに、この方法を探している
string s = ReplaceInternal(oldValue, newValue);
見つけることができませんReplaceInternalメソッドの呼び出しがありますGITは運がない。
この方法で、何が内側になっているところ教えてください?
にexternのC++コードはここにあります。
https://github.com/gbarnett/shared-source-cli-2.0/blob/master/clr/src/vm/comstring.cpp
ライン1578はhttp://referencesource.microsoft.com/下の参照元を見て、機能がどのように動作するかを確認するには
FCIMPL3(Object*, COMString::ReplaceString, StringObject* thisRefUNSAFE, StringObject* oldValueUNSAFE, StringObject* newValueUNSAFE)
http://www.codeproject.com/Articles/1014073/Fastest-method-to-trim-all-whitespace-from-Strings?fid=1888684&df=90&mpp=25&prof=False&sort=Position&view=Thread&spc=Relaxed&fr=76 – Veener
見hereを持って、あなたはこれをわかります。このメソッドは、別のDLLで、外部に実装されていること
// This method contains the same functionality as StringBuilder Replace.
// The only difference is that
// a new String has to be allocated since Strings are immutable
[System.Security.SecuritySafeCritical] // auto-generated
[ResourceExposure(ResourceScope.None)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
private extern String ReplaceInternal(String oldValue, String newValue);
extern
キーワードmeansを。言われて、それも(恐らくC++で)管理されていないDLLで書かれてもよいこと
、それは、このモジュールによって使用されます。したがって、通常はマネージコードで行うように、このコードを逆コンパイルしたり、表示したりすることはできません。更新
は少し検索した後、私はcoreclrプロジェクトに対応するコードを見つけました:
https://github.com/dotnet/coreclr/blob/master/src/classlibnative/bcltype/stringnative.cpp
ありがとう、ありがとう、 "another.dll"はどこですか?私は内部を見たいですか、彼の名前は何ですか? –
を持っています。 mscorlib
ため
Serach、System.String
に行き、Replace
と一見のためのserach:http://referencesource.microsoft.com/#mscorlib/system/string.cs,69fc1d0aa6df8a90,references
[ 'ReplaceInternal'](http://referencesource.microsoft.com/#mscorlib/system/string.cs,35ab9efe11757286)イスト'extern'なので、それはおそらく"アンマネージド "なネイティブのC++コードとして実装されています。詳細は、[P/Invoke](https://en.wikipedia.org/wiki/Platform_Invocation_Services)を参照してください。 –
あなたは逆コンパイルする必要はありません、@ http://referencesource.microsoft.com/#mscorlib/system/string.cs,69fc1d0aa6df8a90 – Bob