Coder Social home page Coder Social logo

frida-clr's People

Contributors

oleavr avatar riverar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

frida-clr's Issues

How can i use custom port for frida-clr

Hi,

When I connected to frida-server, I found that it connects to 127.0.0.1:27042 by default, but I want to use a custom port, similar to frida.get_device_manager().add_remote_device("host:port") of frida-python,Is there a similar function in frida-clr。please help me。

thanks!

Ubuntu support

Can the the CLR bindings be compiled and used with .NET Core on Ubuntu? If yes, can you post instructions? Thanks

How to use frida with C#

Hi i want to use frida with C# to create application that inject code into a game, but i was not able to run this app, it ask for missing assembly and i do have Frida.dll

System.OutOfMemoryException when I use more Task

I use script.post with 31 threads (31 Android devices) and it runs stably. However, from the 32nd thread onwards, I encounter a System.OutOfMemoryException. The memory gets filled up because the Script is not being released. I've tried various solutions: reducing the number of concurrent threads, adding delay time after each script.post, but none have resolved the issue. It would be great if CLR had an rpc method like Python. I apologize if my English is not good.

The process was terminated due to an unhandled exception

Using a really simple test to check that I'm able to hook anything in my target application.
Android 11, Pixel 2, rooted and successfully able to use frida-trace and frida cli to get hooks into the application.

	DeviceManager deviceManager;
	deviceManager = new DeviceManager(Dispatcher.CurrentDispatcher);
	var devices = deviceManager.EnumerateDevices();
	var usbDevice = devices.Where(d => d.Type == DeviceType.Usb).SingleOrDefault();
	if (usbDevice != null)
	{
		uint targetProcessPid = usbDevice.Spawn(applicationToSpawnName, null, null, null, null);
		Thread.Sleep(TimeSpan.FromSeconds(1));
		var session = usbDevice.Attach(targetProcessPid);
		usbDevice.Resume(targetProcessPid);
		var clientScript = session.CreateScript(File.ReadAllText(@"C:\Temp\js\poc.js"));
		clientScript.Message += ClientScriptMessageHandler;
		clientScript.Load();
		Thread.Sleep(Timeout.Infinite);
	}	

My .js is just a simple output to make sure the script is loaded and Java.perform is being called:

Java.perform(function () {
	console.log("hello");
});

I've tried a couple of different methods for pausing the thread / waiting while my output is received by the handler, but the process dies every time with the error The process was terminated due to an unhandled exception.

The eventlog records the .net runtime crash:

Application: test-frida.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentException
   at System.Runtime.InteropServices.GCHandle.InternalCheckDomain(IntPtr)
   at System.Runtime.InteropServices.GCHandle.FromIntPtr(IntPtr)
   at <Module>.msclr.gcroot<Frida::Script ^>.->(msclr.gcroot<Frida::Script ^>*)
   at <Module>.Frida.?A0x6d48abc7.OnScriptMessage(_FridaScript*, SByte*, _GBytes*, Void*)

and

Faulting application name: test-frida.exe, version: 1.0.0.0, time stamp: 0x57158fd2
Faulting module name: KERNELBASE.dll, version: 10.0.22000.918, time stamp: 0xb42fa627
Exception code: 0xe0434352
Fault offset: 0x000000000004474c
Faulting process ID: 0x6a18
Faulting application start time: 0x01d8ddade22a9c8a
Faulting application path: C:\projects\sandbox\frida-test\test-frida.exe
Faulting module path: C:\WINDOWS\System32\KERNELBASE.dll
Report ID: aa6a7c05-f113-41f4-ab01-5d558b52fbed
Faulting package full name: 
Faulting package-relative application ID: 

I'm referencing the 64bit version of the frida clr .dll downloaded at the same time as the frida-server which is running fine on the device.

Windows 10 BadImageFormatException

I've tried both dowloading from the build site and (sucessfully) compiling form source, and this is what I get when i run (after slightly altering due to implicit type conversion error) the HelloFrida example...

image

I'm using Windows 10 Pro, 64-bit. If you (all) need more information I'd be happy to give you more.

Why does frida-clr depend on WPF?

Hi,

I was just wondering why frida-clr depends on WPF libraries to use (namely System.Windows.Threading)? With the advancement of .NET/.NET Core over the years, is this still necessary? The use of Forms seems like more than what's required for normal Frida usage and it makes using things like Script.Post really unintuitive.

Error opening project?

Hi!

When I try to open this project in Visual Studio, I get the following error message:

image

Is there something that I'm doing wrong?

is there a pre-built version of Frida?

hi! on opening of example project, I can see there is a "frida" reference, but was unable to find this file. tried the "frida-clr-15.1.24-windows-x86_64.dll" but not able to reference it. any ideas?

.Net 4.0 frida-clr-12.9.4 Exception

I wanted to create a small C# utility but I'm getting a file not found exception at runtime. I grabbed the latest x64 clr release from Github and added it as a reference in my project.

Environment: Win10 x64, .NET 4.0, frida 12.9.4, build-arch x64

Repro test-case:

using System;
using Frida;

namespace Londor
{
	class Program
	{
		public static void FridaGetDevices()
		{
			DeviceManager dm = new DeviceManager(System.Windows.Threading.Dispatcher.CurrentDispatcher);
			Device[] devices = dm.EnumerateDevices();
			foreach(Device d in devices)
			{
				Console.WriteLine("Device: " + d.Name);
			}
		}

		static void Main(string[] args)
		{
			FridaGetDevices();
		}
	}
}

Compile:

1>------ Rebuild All started: Project: Londor, Configuration: Release x64 ------
1>  Londor -> C:\Users\b33f\Tools\Dev\Frida-CLR-Test\Londor\Londor\bin\x64\Release\Londor.exe
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========

Runtime:

C:\Users\b33f>C:\Users\b33f\Tools\Dev\Frida-CLR-Test\Londor\Londor\bin\x64\Release\Londor.exe

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'Frida, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
   at Londor.Program.FridaGetDevices()
   at Londor.Program.Main(String[] args) in C:\Users\b33f\Tools\Dev\Frida-CLR-Test\Londor\Londor\Program.cs:line 26

Am I missing a dependency here?

Error with examples/HelloFrida

Hi. I'm trying to get the HelloFrida example working. Whenever I try to debug it, I get the following exception in Visual Studio:

"System.BadImageFormatException {"Could not load file or assembly 'Frida.dll' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)"}".

The project builds successfully into a .exe, but whenever I try to open it I get:

"The exception unknown software exception (0xe0434352) occurred in the application at location 0x7670c52d."

I've also tried using the 64 bit .DLL but get a different exception:

"System.AccessViolationException {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}".

Is there something I'm doing wrong or missing?
Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.