Comments (3)
Hi!
Last Brida version released supports only Python 2. Currently I'm working on a major release with many improvement, among which support for Python 3. I will release the new version for HackInParis 2020 in June. Meanwhile you can make it work with Python 3 by replacing your res/bridaServicePyro.py file with the following one:
# -*- coding: utf-8 -*-
import frida
import codecs
import Pyro4
import sys
#reload(sys)
#sys.setdefaultencoding('utf-8')
class Unbuffered(object):
def __init__(self, stream):
self.stream = stream
def write(self, data):
self.stream.write(data)
self.stream.flush()
def writelines(self, datas):
self.stream.writelines(datas)
self.stream.flush()
def __getattr__(self, attr):
return getattr(self.stream, attr)
@Pyro4.expose
class BridaServicePyro:
def __init__(self, daemon):
self.daemon = daemon
def spawn_application(self,application_id,frida_script,remote):
self.application_id = application_id
self.frida_script = frida_script
if remote == True:
self.device = frida.get_remote_device()
else:
self.device = frida.get_usb_device()
self.pid = self.device.spawn([self.application_id])
self.session = self.device.attach(self.pid)
with codecs.open(self.frida_script, 'r', 'utf-8') as f:
source = f.read()
self.script = self.session.create_script(source)
self.script.load()
return
def resume_application(self):
self.device.resume(self.pid)
return
def reload_script(self):
with codecs.open(self.frida_script, 'r', 'utf-8') as f:
source = f.read()
self.script = self.session.create_script(source)
self.script.load()
return
def disconnect_application(self):
self.device.kill(self.pid)
return
def callexportfunction(self, methodName, args):
method_to_call = getattr(self.script.exports, methodName)
# Take the Java list passed as argument and create a new variable list of argument
# (necessary for bridge Python - Java, I think)
s = []
for i in args:
s.append(i)
return_value = method_to_call(*s)
return return_value
@Pyro4.oneway
def shutdown(self):
print('shutting down...')
self.daemon.shutdown()
# Disable python buffering (cause issues when communicating with Java...)
sys.stdout = Unbuffered(sys.stdout)
host = sys.argv[1]
port = int(sys.argv[2])
daemon = Pyro4.Daemon(host=host,port=port)
#daemon = Pyro4.Daemon(host='127.0.0.1',port=9999)
bs = BridaServicePyro(daemon)
uri = daemon.register(bs,objectId='BridaServicePyro')
print("Ready.")
daemon.requestLoop()
from brida.
same question...
from brida.
Fixed in Brida 0.4
from brida.
Related Issues (20)
- cannot process Chinese characters HOT 1
- to add -D flag to choose device while calling frida HOT 3
- Brida 0.5 - Exception with attach application HOT 3
- Is there any API in Brida? HOT 1
- Frida-compile - process is not defined HOT 1
- App spawned but error HOT 1
- unable to find method 'getplatform' HOT 2
- Why is the alarm timeout? HOT 4
- env: node: No such file or directory HOT 1
- error: unknown option '-x' HOT 6
- Exception with attach application HOT 5
- frida-compile: error: unrecognized arguments: -x
- Spawn Application function is not available HOT 5
- Custom plugin not shows encrypted or decrypted result HOT 4
- Exception with execute method HOT 9
- Exception with getting info Android/iOS HOT 6
- It will cause burpsuite to get stuck. HOT 2
- Entrypoint must be inside the project root (ERROR)
- there is an error when crypt response HOT 1
- Stop server did not work with last Java versions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from brida.