Home

Awesome

How to build libportable source code?

Build!

Add libportable into Firefox?

Binary static injection,example:

setdll32 /d:portable32.dll mozglue.dll       // 32 bits firefox    
setdll64 /d:portable64.dll mozglue.dll       // 64 bits firefox    

Compiled from firefox's source code,patches example:

diff --git a/toolkit/library/nsDllMain.cpp b/toolkit/library/nsDllMain.cpp
--- a/toolkit/library/nsDllMain.cpp
+++ b/toolkit/library/nsDllMain.cpp
@@ -8,6 +8,16 @@
 #include "mozilla/Assertions.h"
 #include "mozilla/WindowsVersion.h"
 
+#if defined(_MSC_VER) && defined(TT_MEMUTIL)
+#if defined(_M_IX86)
+#pragma comment(lib,"portable32.lib")
+#pragma comment(linker, "/include:_GetCpuFeature_tt")
+#elif defined(_M_AMD64) || defined(_M_X64)
+#pragma comment(lib,"portable64.lib")
+#pragma comment(linker, "/include:GetCpuFeature_tt")
+#endif
+#endif /* _MSC_VER && TT_MEMUTIL */
+
 #if defined(__GNUC__)
 // If DllMain gets name mangled, it won't be seen.
 extern "C" {