seemoo-lab / nexmon

The C-based Firmware Patching Framework for Broadcom/Cypress WiFi Chips that enables Monitor Mode, Frame Injection and much more
GNU General Public License v3.0
2.42k stars 453 forks source link

Samsung Galaxy S4 GT-I9515 (jfvelte) - __nex_driver_io: error #168

Open ssummer1337 opened 6 years ago

ssummer1337 commented 6 years ago

I am currently trying to install nexmon to my Samsung Galaxy S4 GT-I9515 (jfvelte), but I keep getting the following error when using

jfvelte:/ # nexutil -m2 __nex_driver_io: error

What I tried so far:

Am I missing out something ?

Why do I keep getting the "__nex_driver_io-error" ?

Best regards,

matthiasseemoo commented 6 years ago

Do you have root privileges, when you start nexutil?

On Tue, Jan 2, 2018 at 9:22 PM, ssummer1337 notifications@github.com wrote:

I am currently trying to install nexmon to my Samsung Galaxy S4 GT-I9515 (jfvelte), but I keep getting the following error when using

jfvelte:/ # nexutil -m2 __nex_driver_io: error

What I tried so far:

-

Using the app from play store, but regarding to the app my phone isn't supported.

Recompiling the app using kubuntu 16.10, the app crashes upon pressing the button. (I didn't investigate any further)

Lastly I tried replacing the firmware manually. I compiled the utilities and added 'nexmon' to /system/bin und libfakeioctl to /system/lib. Then I replaced the firmware in /system/etc/wifi/bcmdhd_sta.bin with the compiled patch. I disconnected from my AP und reloaded my wlan0 interface, but it still didn't work.

Am I missing out something ?

Why do I keep getting the "__nex_driver_io-error" ?

Best regards,

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/seemoo-lab/nexmon/issues/168, or mute the thread https://github.com/notifications/unsubscribe-auth/ALP_7uy2cP9VtH1g6GoZ3YMtMHTZqQKpks5tGo_8gaJpZM4RRCT9 .

-- Matthias Schulz Secure Mobile Networking Lab - SEEMOO

Email: matthias.schulz@seemoo.tu-darmstadt.de Web: http://www.seemoo.de/mschulz Phone (new): +49 6151 16-25478 Fax: +49 6151 16-25471

Department of Computer Science Center for Advanced Security Research Darmstadt Technische Universität Darmstadt Mornewegstr. 32 (Office 4.2.10, Building S4/14) D-64293 Darmstadt, Germany

ssummer1337 commented 6 years ago

Yeah, I used Termius as root

matthiasseemoo commented 6 years ago

Is your Wi-Fi interface name wlan0? Does nexutil -m0 work? Is your firmware running?

On Tue, Jan 2, 2018 at 10:53 PM, ssummer1337 notifications@github.com wrote:

Yeah, I used Termius as root

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/seemoo-lab/nexmon/issues/168#issuecomment-354884970, or mute the thread https://github.com/notifications/unsubscribe-auth/ALP_7kt67sHDaT4Ly_YVt9fjB04PWcMNks5tGqU7gaJpZM4RRCT9 .

-- Matthias Schulz Secure Mobile Networking Lab - SEEMOO

Email: matthias.schulz@seemoo.tu-darmstadt.de Web: http://www.seemoo.de/mschulz Phone (new): +49 6151 16-25478 Fax: +49 6151 16-25471

Department of Computer Science Center for Advanced Security Research Darmstadt Technische Universität Darmstadt Mornewegstr. 32 (Office 4.2.10, Building S4/14) D-64293 Darmstadt, Germany

ssummer1337 commented 6 years ago

Regarding to ifconfig my wlan0 is up, running and I am able to connect to a AP. Argument '-m0' doesn't work either. Running nexutil with '-m' results in the same error, but it returns "monitoring: 0", if that may help

JuniorJPDJ commented 6 years ago

Check in dmesg if path of firmware is correct. I with my i9505 am having weird problem.. It's something similar. I have to set wifi down, move original firmware to /system/etc/wifi/bcmdhd_sta.bin, set wifi up, set wifi down, move patched one and it works.. >__<

JuniorJPDJ commented 6 years ago

In which mode is interface after loading firmware? -m0? Because my driver crashes when I try to turn wifi on in android settings..

[ 2801.823089] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[ 2801.824096] CHIP VER = [0x1]
[ 2801.824127] ----- CHIP bcm4335_B0 -----
[ 2801.824127] dhdsdio_download_firmware: firmware path=/system/etc/wifi/bcmdhd_sta.bin, nvram path=/system/etc/wifi/nvram_net.txt
[ 2801.827026] _dhdsdio_download_firmware: dongle image file download failed
[ 2801.827087] dhd_net_bus_devreset: dhd_bus_devreset: -35
[ 2801.827178] ####btlock released, cookie: WiFi
[ 2801.827178] wl_android_wifi_on() bcm_bt_unlock
[ 2801.827178] dhd_open : wl_android_wifi_on failed (-35)
[ 2801.827178] wl_android_wifi_off in
[ 2801.827239] dhd_prot_ioctl : bus is down. we have nothing to do
[ 2801.827270] dhd_wl_ioctl: WLC_IOCTL: cmd: 3, ret = -1
[ 2801.827301] dhd_net_bus_devreset: dhd_bus_devreset: -35
[ 2801.827392] wifi_platform_set_power = 0
[ 2801.827423] ####ignore lock release,  cookie mismatch: WiFi owner ���� 
[ 2801.827423] check BCM4335, check_bcm4335_rev 
[ 2801.827423] /data/.rev file open error
[ 2801.827453] ------------------------------------------------
[ 2801.827453] ------------------------------------------------
[ 2801.827453] brcm_wlan_power Enter: power off

But when I set my interface up in terminal it works normal..

[ 3286.297637] F1 signature OK, socitype:0x1 chip:0x4335 rev:0x1 pkg:0x0
[ 3286.301757] DHD: dongle ram size is set to 786432(orig 786432) at 0x180000
[ 3286.304046] CHIP VER = [0x1]
[ 3286.304077] ----- CHIP bcm4335_B0 -----
[ 3286.304077] dhdsdio_download_firmware: firmware path=/system/etc/wifi/bcmdhd_sta.bin, nvram path=/system/etc/wifi/nvram_net.txt
[ 3286.585754] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[ 3286.850128] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[ 3286.858276] dhd_wl_ioctl: WLC_GET_VAR: cisdump, ret = -23
[ 3286.858276] [WIFI_SEC] dhd_check_module_cid: CIS reading failed, ret=-23
[ 3286.877014] Firmware up: op_mode=0x0015, MAC=98:21:1f
[ 3286.895629] [WIFI_SEC] sec_control_pm: POWER_VAL = 1 
[ 3286.895660] dhdcdc_set_ioctl: SET PM to 2
[ 3286.910858] dhd_wl_ioctl: WLC_SET_VAR: aibss_bcn_force_config, ret = -23
[ 3286.910858] dhd_preinit_ioctls Set aibss_bcn_force_config to 500, 5000, 5000 failed -23
[ 3286.940551] Firmware version = wl0: Mar  5 2015 16:46:55 version 6.30.171.24.64 (B0 Station/P2P)
[ 3286.940795] [WIFI_SEC] .wifiver.info already saved.
[ 3286.946380] dhd_wl_ioctl: WLC_SET_VAR: ampdu_hostreorder, ret = -23
[ 3286.946411] dhd_preinit_ioctls wl ampdu_hostreorder failed -23
[ 3286.950195] dhd_wl_ioctl: WLC_GET_VAR: pfnlbest, ret = -23
[ 3286.952941] dhd_wl_ioctl: WLC_GET_VAR: cisdump, ret = -23
[ 3286.952941] [WIFI_SEC] dhd_check_module_mac: Check module mac by legacy FW : 98:21:1f
[ 3286.953094] [WIFI_SEC] Check Mac address in .mac.info 
[ 3286.953124] ####btlock released, cookie: WiFi
[ 3286.953155] wl_android_wifi_on() bcm_bt_unlock
[ 3286.955505] CFG80211-INFO2) wl_cfg80211_attach_post : p2p0: p2p_dev_addr=9a:21:1f

I don't know why, but it's fixed...

@ssummer1337 are you using magisk? That's probably a thing what caused it to me.

ssummer1337 commented 6 years ago

@JuniorJPDJ Well I am just using Cyanogen Mod 14.1 with root. What do you mean with magisk ?

JuniorJPDJ commented 6 years ago

Magisk is systemless moding framework. There is my script which loads patch only when I want to use it, try it, it fixed my problems:

https://gist.github.com/JuniorJPDJ/fe61e85102b2e388c455001ec76ba3f8

Try it

ssummer1337 commented 6 years ago

Thanks for the script, but the errors seems to be laying around somewhere here: https://github.com/seemoo-lab/nexmon/blob/4397f70eff408697ce26b416278ceacd4ff1d39b/utilities/libnexio/libnexio.c#L110

I think it isn't being caused by my way of installation, I guess there is some kind of problem with the kernel.

JuniorJPDJ commented 6 years ago

I was getting similar errors when there was a problem with loading firmware. Look in your dmesg if it is being loaded and check hash of file if it is original or patched one, maybe something undone your patch and you are trying to use nexmon util at unpached (as in my case).

ghost commented 6 years ago

Hi ssummer1337, did you solve this "__nex_driver_io" problem by now? It seems my problem is similar with yours. Could you kindly give me some suggestions? @ssummer1337

ssummer1337 commented 6 years ago

@PtOH unfortunately I was not able to fix the problem. I think I have got some kind of hardware defect, but thats only an assumption.

Anyways, If you are able to fix the problem please notify me.

ghost commented 6 years ago

@ssummer1337 I work it out! Without any smart try, I just repeat all compiling and installing procedures on another host system--Ubuntu 14.04 (x86_64), and no more error! Hopefully it may also work for you. :-)