native-code

How to transform C code to JNI Code

☆樱花仙子☆ 提交于 2019-12-25 01:18:46
问题 I have C code ( testFile .c) that I want to used in Android App, using JNI. This code contains pure C code and it has many methods inside. Moreover, it also calls some C header files ( file1 .h, file2 .h). For example: testFile .c #include "file1.h" #include "file2.h" void myMethod1() { ... ... } void myMethod2() { ... ... } void myMethod3() { ... ... } Whether I have to transform whole of testFile .c to JNI code, or just transform some methods that will i used later (not all of them)? Should

Using kernel32 CreateThread/TerminateThread inside Azure Worker Role

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 17:25:11
问题 I have this code that I need to use, but what holds me back is that here it says that TerminateThread Applies to: desktop apps only . I wonder if I can use this code inside azure Worker role, specifically inside waiishost.exe process that I use to run the Worker thread in? [DllImport("Library.dll")] public static extern void InfiniteLoop(); [DllImport("kernel32")] private static extern int CreateThread( IntPtr lpThreadAttributes, UInt32 dwStackSize, IntPtr lpStartAddress, IntPtr param, UInt32

Configuring cygwin for building ndk project

你。 提交于 2019-12-24 16:41:10
问题 I have searched on the Internet a lot and I'm trying to build my ndk files and then include them to my Android project on eclipse. After searching on Internet I came to know that cygwin is required to build ndk project. I have downloaded the necessary files for cygwin, however I'm blank for the next step. i.e steps for how to build my ndk files on cygwin terminal and then include them to my eclipse android project. Kindly help me on these steps. Would be appreciated! 回答1: If you are using the

Could this C++ project be decompiled with such tools like a .NET Reflector?

时间秒杀一切 提交于 2019-12-24 16:06:43
问题 I use Microsoft Visual Studio 2012 and I want to write an application in native C++. Reason why I don't want to use Manged Code (.NET) because I don't want that my application was decompiled back to the Source Code with such tools like a .NET Reflector, but it would be nice if I still could use UI (CLR Windows Form) in my application. But when I'm adding UI (CLR Windows Form) to my Win32 Project this message pops up: Does that mean that from now all my project won't be compiled as a native

How do I catch c0000005 exception from native dll in c#

雨燕双飞 提交于 2019-12-24 00:55:11
问题 I'm working with a native dll that somewhere throws a c0000005 exception (access violation) and ends up crashing my web service until the service is recycled. Is there a way to catch the exception? 回答1: you can catch the exception using Microsoft SEH exception handler, but really you should fix whatever is wrong. Cheers & hth., 回答2: I agree with the others... Fix the problem, but sometimes you inherit code and you just want to catch an unexpected violation in production. In .net 4+ you can

Relation between the NDK version and the Android version

不打扰是莪最后的温柔 提交于 2019-12-23 17:22:21
问题 Is there any relation (constraint/compatibility restriction) between the version of the NDK used to compile the native code and the Android version running on the device where the APK is installed? For example, I compile the native code with Android NDK r7, I get the libraries and generate APK1; then I compile with NDK r10d, obtain the libraries and generate APK2. Is it any risk that I might get different behavior between APK1 and APK2 running on the same device? 回答1: Bugs are found and fixed

How can Android native code target multiple processor types?

时间秒杀一切 提交于 2019-12-23 10:02:32
问题 From what I understand, native code on Android is code that works directly with the processor of a specific device. So if I wanted to take advantage of a certain processor I would use native code. But what happens if I want to make an app that contains native code, but targets multiple processors? Do I have to make multiple apps, one for each architecture? Or is there a way to put multiple version of the native code in one app picking the one matching the processor of the device it runs on?

Sandboxing a program using WinAPI hooks

a 夏天 提交于 2019-12-22 18:34:14
问题 I'd like to sandbox a native code and use hooking of WinAPI and system functions to block or allow this program to perform some operations like reading/writing files, modify Windows registry, using an Internet connection. Is it a good and secure way to do so? How difficult would it be for that program to bypass such a security layer? 回答1: +1 to Hans, however if you are really into it then I can recommend Easyhook. I have personally used it successfully in Win XP, Vista and 7. I don't know how

Math inaccuracy in Javascript: safe to use JS for important stuff?

被刻印的时光 ゝ 提交于 2019-12-22 14:41:10
问题 I was bored, so I started fidlling around in the console, and stumbled onto this (ignore the syntax error): Some variable "test" has a value, which I multiply by 10K, it suddenly changes into different number (you could call it a rounding error, but that depends on how much accuracy you need). I then multiply that number by 10, and it changes back/again. That raises a few questions for me: How in accurate is Javascript? Has this been determined? I.e. a number that can be taken into account?

Math inaccuracy in Javascript: safe to use JS for important stuff?

我只是一个虾纸丫 提交于 2019-12-22 14:40:32
问题 I was bored, so I started fidlling around in the console, and stumbled onto this (ignore the syntax error): Some variable "test" has a value, which I multiply by 10K, it suddenly changes into different number (you could call it a rounding error, but that depends on how much accuracy you need). I then multiply that number by 10, and it changes back/again. That raises a few questions for me: How in accurate is Javascript? Has this been determined? I.e. a number that can be taken into account?