yashsingh1/xdaforums huggingface dataset:
[Android Software/Hacking General [Developers Only]] fortenbt:
Okay, so I got it working. If anyone else is doing this, you can't use the cyanogenmod_tuna_defconfig or whatever you normally do when you build the kernel.

I had to:

$ make clean
$ make menuconfig

In the menu configuration, I went into [Device Drivers] --> [Network device support] --> [Wireless LAN], and I selected 'M' on "---Broadcom WiFi Driver for 4330"

I then exited the menu and saved my configuration when it asked.

I then did:

$ make

After the kernel finished making, I could do:

$ make modules SUBDIRS=drivers/net/wireless/bcmdhd

That created the dhd.ko.

However, after loading the new kernel, I tried using the config.sh script they provided. It seems to have a few typos in it for the 4330 devices. Can anyone confirm this? The firmware they provide in their repository (bcm4330_sta.bcmon.bin) seems to be referenced as fw_bcm4330.bcmon.bin in their script. This naming convention is the one used in the 4329 firmware, however, so I think it's just a typo. This makes sense because the rest of their script continues to reference bcm4329.ko instead of dhd.ko, etc.

After making the changes to the script, copying the files to my device, and running the script, I got the error: "error: SIOCGIFFLAGS (No such device)"

Checking my dmesg output shows:

<4>[ 2547.109771] ## wifi_probe
<4>[ 2547.109863] wifi_set_power = 1
<4>[ 2547.842834] wifi_set_carddetect = 1
<6>[ 2547.969421] mmc1: new high speed SDIO card at address 0001
<4>[ 2547.971954] dhdsdio_probe : no mutex held. set lock
<4>[ 2547.972290] F1 signature read @0x18000000=0x16444330
<4>[ 2547.977630] DHD: dongle ram size is set to 294912(orig 294912)
<3>[ 2547.979949] CFG80211-INFO2) wl_cfg80211_attach : wl_cfg80211_attach: wl = 0xc3381b20
<3>[ 2547.980194] CFG80211-INFO2) wl_create_event_handler : Enter
<3>[ 2547.980438] CFG80211-INFO2) wl_create_event_handler : wl = 0xc3381b20, wl->event_tsk = 0xc3381d34
<4>[ 2547.980773] wl_create_event_handler thr:265a created
<3>[ 2547.980773] CFG80211-INFO2) wl_event_handler : tsk Enter, tsk = 0xc3381d34
<3>[ 2547.980804] CFG80211-INFO2) wl_event_handler : DAEMONIZE completed
<3>[ 2547.980834] CFG80211-INFO2) wl_event_handler : tsk completed
<4>[ 2547.981323] wl_create_event_handler thr:265a started
<4>[ 2547.982666] dhd_attach thr:265b created
<4>[ 2547.982849] dhd_attach thr:265b started
<4>[ 2547.982971] dhd_attach thr:265c created
<4>[ 2547.983062] dhd_attach thr:265c started
<4>[ 2547.983276] dhd_attach thr:265d created
<4>[ 2547.983398] dhd_attach thr:265d started
<4>[ 2547.983489] dhd_early_suspend: enter
<4>[ 2547.983642] dhd_set_suspend: enter, value = 1 in_suspend=1
<4>[ 2547.983856] dhdsdio_probe: dhd_bus_start failed
<4>[ 2547.994476] Broadcom Dongle Host Driver: register interface [wlan0]dhdsdio_probe : the lock is released.

Anyone see anything that might be wrong? It looks to me like there are some errors in the driver for this device. Hopefully they or someone with more time can actually look into this and get it working for the Galaxy Nexus (I've been working on toro).
[Android Software/Hacking General [Developers Only]] sambwel:
Yeah, the script is incorrect. The one included in the bundle (gs2_bundle.zip) is different:

#!/system/bin/sh
CUR_DIR=`dirname $0`
CUR_DIR=`readlink -f $CUR_DIR`
DRIVER_NAME="dhd"
DRIVER_FLNM="dhd.ko"
FW_PATH="$CUR_DIR/bcm4330_sta.bcmon.bin"

IS_BCM_LOADED=`lsmod | grep $DRIVER_NAME | wc -l`

if [ $IS_BCM_LOADED == 1 ]; then
IS_BCM_PATCHED=`grep "bcmon_loaded" /proc/kallsyms | wc -l`
if [ $IS_BCM_PATCHED == 0 ]; then
echo Original module loaded. disabling WiFi
svc wifi disable
fi
fi
echo LOADING MODULE
rmmod $DRIVER_NAME 2>/dev/null
insmod $DRIVER_FLNM iface_name=wlan0 firmware_path=$FW_PATH nvram_path=/system/etc/wifi/nvram_net.txt
ifconfig wlan0 up

Make sure you haven't missed out anything else that needed changing, based on the above. Assuming you caught everything though, there may be issues with the firmware: https://code.google.com/p/bcmon/issues/detail?id=4
[Android Software/Hacking General [Developers Only]] stavfx:
keep up the good work! can't wait to see injection working on my S2! :)
[Android Software/Hacking General [Developers Only]] r3d4:
Great news! I can confirm this also works on HTC Desire.

See attachement for compiled version for Oxygen ROM 2.3.2.
[Android Software/Hacking General [Developers Only]] nafitte:
Can any1 plz compile this driver for galaxy s advance twrp kernel.
[Android Software/Hacking General [Developers Only]] sambwel:
Now that there have been updates to the bcm4329 source & firmware, I will be attempting to build a working version for Galaxy S i9000 again. I'll report back here if I get it working :)
[Android Software/Hacking General [Developers Only]] McRoy:
Hi!

Congratulations for the work!! Nice done guys!!

I try it on my Nexus One.

I put them in mode monitor, but I don't know how what i need to download and what I have to write on terminal to iniciate airodump-ng or any other aircrack-ng utililty. I must have all of them in the same folder?

Thank you!!!
[Android Software/Hacking General [Developers Only]] svrnmnd:
Any way this will work on the Droid 4?
[Android Software/Hacking General [Developers Only]] chris9983:
update please!!!!

Can't patch module on nexus 7. when I compiled kernel it didn't produce a zimage or DHD.ko module. help please.
[Android Software/Hacking General [Developers Only]] tutchthesky7:
Nothing after LOADING MODULE

after typing in sh setup.sh i get " Loading module" then nothing else happens after, typing iwconfig results in it saying not found, any help? running on galaxy s2, patched siyah kernal
[Android Software/Hacking General [Developers Only]] aspartame21:
Monitor Mode using Samsung Galaxy S2 (GT-I9100) Step by Step:

1. You have to root your device.

2. Flash CM 9.1.0.

3. Check out, your using originally cwm kernel included in the firmware you flashed.

4. Download bundle (zip with wi-fi monitor mode drivers and scripts).

5. Extract bundle files.

6. Open up the terminal.

7. Type

su
sh [COLOR="Gray"]pathToExtractedFilesFrom5thStep[/COLOR]/setup.sh

If you won't see an error it means you are in wifi monitor mode. To reset your stock wifi driver you should reboot your system or return it from terminal emulator.

How can I run aircrack-ng after getting monitor mode?

-Just download this and disassemble on your own (because I don't have any idea how to use it) or install backtrack/debian/ubuntu and use aircrack up there.
[Android Software/Hacking General [Developers Only]] Chsivic:
Does it only work on CM9.1.0 at this moment?
[Android Software/Hacking General [Developers Only]] Chsivic:
Did you find a solution for that?
[Android Software/Hacking General [Developers Only]] ferrer:
I tried this on my Samsung Galaxy Nexus running CM 9.1.0-maguro and get the following output:

shell@android:/sdcard/gs2_bundle # sh setup.sh

sh setup.sh

LOADING MODULE

insmod: init_module 'dhd.ko' failed (Exec format error)

dmesg shows:

<3>[ 319.865173] dhd: version magic '3.0.32-CM-ge9cef6c SMP preempt mod_unload

ARMv7 p2v8 ' should be '3.0.36-cyanogenmod-geb0f696 SMP preempt mod_unload ARMv7

Any clue on how to solve the kernel mismatch? insmod doesn't seem to let me force to load it :(

Any help would be appreciated!
[Android Software/Hacking General [Developers Only]] aspartame21:
I'm gonna upload installation pack. Be patient...
[Android Software/Hacking General [Developers Only]] Chsivic:
Alright... static linked binaries work... "ln -s iwconfig iwpriv" solves "Can't find wireless tools".
[Android Software/Hacking General [Developers Only]] aspartame21:
gimme a little time, i'll post new package
[Android Software/Hacking General [Developers Only]] fwayfarer:
I have been trying to compile this for stock cm10 kernel on at&t galaxy s3 for two days. I cannot figure this out. If anyone would be willing to help me it would be greatly appreciated. I'll be setting up a new compile environment from scratch in Ubuntu in case I ****ed up doing that.

Otherwise would someone please compile for the ATT galaxy s3 if I can't get any help? I'm reasonable with Linux but I literally cannot get this to compile.

Thanks
[Android Software/Hacking General [Developers Only]] nafitte:
Yes. We need a good tutorial. How to compile this driver for other devices.
[Android Software/Hacking General [Developers Only]] aspartame21:
http://xdaforums.com/showpost.php?p=27900338&postcount=3

---------- Post added at 08:55 PM ---------- Previous post was at 08:50 PM ----------

simple install wifi monitor mode with aircrack

I need someone to help with compiling driver to other kernels and devices
[Android Software/Hacking General [Developers Only]] fwayfarer:
Bro I am trying to compile the kernel object. Not the kernel. Even using make menuconfig I can't get it to load the source for the hacked .ko
[Android Software/Hacking General [Developers Only]] nafitte:
Yes we need a tutorial to compile the wifi driver. Not the CMW kernel or whole source code.
[Android Software/Hacking General [Developers Only]] aspartame21:
Memory Controller please help! We need tutorial in compling the driver
[Android Software/Hacking General [Developers Only]] aspartame21:
I found something. http://android-jotting.blogspot.com/2010/12/how-to-compile-android-device-driver-as.html
[Android Software/Hacking General [Developers Only]] z3nful:
Here's a general tutorial on compiling and installing kernel modules:

YOU NEED

----------

-64-bit Linux operating system

- kernel source code for the one your building your module for

- Module source

- Toolchain used to compile the kernel, usually the same one the developer used

Ill skip over the usual "How to use Linux" part, as you should already know how to use Linux if your messing with kernel stuff.

1. Setup Your Build Environment

--------------------------------

Create a folder in your home directory, and name it KERNEL (caps make it easier to get back to later). Go into that directory and create three more, TC, KERNEL, and WIFI (TC is for your toolchain). Copy your kernel source into KERNEL, your toolchain into TC, and the wifi module source into WIFI.

If you have enough space available, I recommend creating a backup folder of the source as well (mine is BKERNEL). Copy the kernel source there just in case you need to start from scratch (and you will, trust me lol).

As all devices are different and have different kernel setups and places to download everything, I also wont provide links to toolchains or sources, you need to find the correct ones yourself.

Once everything is in place, enter:

export ARCH=arm
export CROSS_COMPILE=/home/<yourusername/KERNEL/TC/bin/<toolchainnamewithfollowing->

An example CROSS_COMPILE variable would be:

export CROSS_COMPILE=/home/zen/KERNEL/TC/arm-linux-none-gnueabi-

In your terminal:

su
cd KERNEL/KERNEL/drivers/net/wireless
ls -l

Now look for your bcm device, the folder name will match one of the folders in the WIFI src directory.

For good measure, ls the bcm directory and remember what it looks like to compare to after coping the source across.

Next (assuming the bcm folder exists):

cp -rfv /home/<yourusername/KERNEL/WIFI<pocateyoursrcfolder>/<bcmfoldername> ./<bcmfoldername>

Compare the contents with ls against what you saw earlier, if its different, with alot of the same files, the copy went across right.

cd back to your KERNEL/KERNEL folder and your ready to go.

2. Compiling

-------------

Now you will need to setup the kernel source itself. You will need to do a full build of the kernel to ensure the modules are compiled correctly.

You will need to know which kernel .config to use as well. Refer to the kernel developers notes for the one you are compiling to get the proper one.

Once you know which config to use, enter this command:

cp arch/arm/config/<yourconfigname> ./.config
make clean
make menuconfig (if you want to check out settings, rename kernel and such)
make -j8
make modules

Assuming everything compiled correctly, Your new kernel is located at arch/arm/boot/zImage, and your kernel modules are located in their respective drivers/ location. (In this case, for the wifi drivers, its under drivers/net/wireless/<bcmfoldername>/<modulename>.ko)

Enjoy :)
[Android Software/Hacking General [Developers Only]] aspartame21:
Tnanks. Can you make a video tutorial on live example?
[Android Software/Hacking General [Developers Only]] z3nful:
Possibly in a few days/weeks, i typed that up real quick on break at work lol

I think i still have this project setup somewhere on my PC for my Xoom, if I do I might be able to get something up soon.
[Android Software/Hacking General [Developers Only]] SlamberGamer:
great job.. can u do it for s3?? pls :)
[Android Software/Hacking General [Developers Only]] fwayfarer:
im trying. its ****ing hard man. also it takes A TON of bandwidth just to download the kernel source and set up a build environment. then im having issues with ubuntu 12.04 being a prick for no good reason and trying to prevent me from installing the required packages.

so yeah, respect the devs more please. its not easy in any shape or form.
[Android Software/Hacking General [Developers Only]] fwayfarer:
i keep getting this error no matter what i try or do. path is correct in bashrc for arm-eabi- and using apt-get install gcc shows installed and fully up to date

make: arm-eabi-gcc: Command not found

CHK include/linux/version.h

CC scripts/mod/empty.o

arm-eabi-gcc: error: -pg and -fomit-frame-pointer are incompatible

make[2]: *** [scripts/mod/empty.o] Error 1

make[1]: *** [scripts/mod] Error 2

make: *** [scripts] Error 2

make: *** Waiting for unfinished jobs....
[Android Software/Hacking General [Developers Only]] z3nful:
Was the CROSS_COMPILE variable set right? that's something I usually see when I forgot that part.

Also, I've found that not using the bashrc file to set the path to the toolchain, just typing "export CROSS_COMPILE=yadayada" into the terminal made it easier to keep track of which toolchain I was using (I build kernels for all my devices, so i have quite a few different toolchains)
[Android Software/Hacking General [Developers Only]] fwayfarer:
yes the variable is set right. compiling for android is bull****, and there is zero support.

wondering if this isnt an epic troll, havent seen this work yet in person myself.

EDIT; fixed the variable, none of the guides explain this.

this is the error i now get when trying to make

arm-none-eabi-gcc: error: -pg and -fomit-frame-pointer are incompatible
[Android Software/Hacking General [Developers Only]] z3nful:
I was able to get a (semi) working module for my HD2, but I couldn't fully test it with the time I had. The main problem I had with it is that when leaving wifi range, the phone wouldn't disconnect from the AP, and that I was getting odd errors with iwconfig (problems with the iwconfig binary, not driver).
[Android Software/Hacking General [Developers Only]] fwayfarer:
oh ****, i had oracle-java7 packages on the box which were taking over the java6 calls and ruining my compile.

im trying a gs3 cm10 build as we speak.

EDIT;

still wont build right.it will build for other .config fine but when i pull a .config from my device with adb and try to use it, it fails.

this is the tutorial i was using

http://wiki.cyanogenmod.com/wiki/Building_Kernel_from_source

EDIT2;

im just running a compile against a default .config, i doubt it will work once i throw it on the device but i cant get it to run using the .config i pulled from my device, always kicks the incompatible error

arm-eabi-gcc: error: -pg and -fomit-frame-pointer are incompatible
[Android Software/Hacking General [Developers Only]] fwayfarer:
So theres really no experienced kernel dev who will touch this? The ****
[Android Software/Hacking General [Developers Only]] aspartame21:
all kernels and toolchains in http://github.com/
[Android Software/Hacking General [Developers Only]] fwayfarer:
I don't want to sound mean but I think anyone taking a serious shot at this already knows that

Also as of my last visit there was NOT a d2att cm10 compatible kernel there.
[Android Software/Hacking General [Developers Only]] pilililo2:
Monitor Mode working on SGS2!!

Well i got monitor mode to work on my GT-I9100 perfectly, even though it says Mode:Managed, its in Monitor Mode, Airodump works perfectly :)) do you guys think you can get Packet Injection working on the BCM4330 chipsets?? :eek: im so impatient :D
[Android Software/Hacking General [Developers Only]] :
really? How ? Please do a tutorial about it or create a new subject and let me know about it...

---------- Post added at 06:43 PM ---------- Previous post was at 06:32 PM ----------

dear pililo2 please send me the s3 module for monitor mode compiled PLEASE pllliiiz
[Android Software/Hacking General [Developers Only]] pilililo2:
I said SGS2, GT-I9100, its galaxy S 2! not s3
[Android Software/Hacking General [Developers Only]] :
Hahaha i saw it gt-I9300 sryy :p
[Android Software/Hacking General [Developers Only]] ferrer:
Hi,

I think I could progress a bit further on compiling the module for the Galaxy Nexus (GSM version).

Now the module loads but still outputs an error (dmesg):

<4>[ 2351.054840] wl_android_wifi_off in

<4>[ 2351.058624] dhdsdio_isr : bus is down. we have nothing to do

<4>[ 2351.062133] wifi_set_power = 0

<4>[ 2351.585632] =========== WLAN placed in RESET ========

<4>[ 2358.116577]

<4>[ 2358.116577] Dongle Host Driver, version 5.90.195.75

<4>[ 2358.116577] Compiled in drivers/net/wireless/bcmdhd on Oct 29 2012 at 15:38:42

<4>[ 2358.116912] wl_android_wifi_on in

<4>[ 2358.117004] wifi_set_power = 1

<4>[ 2358.640289] =========== WLAN going back to live ========

<4>[ 2358.640472] sdio_reset_comm():

<4>[ 2358.664794] F1 signature read @0x18000000=0x16844330

<4>[ 2358.675140] DHD: dongle ram size is set to 294912(orig 294912)

<4>[ 2358.734649] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.

<4>[ 2358.890075] wifi_get_mac_addr

<4>[ 2358.899291] Firmware up: op_mode=1, Broadcom Dongle Host Driver mac=a0:0b:ba:dd:23:4e

<4>[ 2358.928894] Firmware version = wl0: Nov 11 2011 17:49:28 version 5.90.125.94.1

<4>[ 2359.018249] wl_host_event: Invalid ifidx 0 for wl0

Any clue why?

Any help would be highly appreciated :)
[Android Software/Hacking General [Developers Only]] aspartame21:
In file included from arch/arm/kernel/asm-offsets.c:*16:

/home/aspartame21/android/kern*el/dreamkernel-ics/arch/arm/in*clude/asm/cacheflush.h:19:22: error: mach/smc.h:﻿ No such file or directory

make[1]: *** [arch/arm/kernel/asm-offsets.s*] Error 1

make: *** [prepare0] Error 2

make: *** Waiting for unfinished jobs.... HOSTLD scripts/mod/modpost

what's the problem???
[Android Software/Hacking General [Developers Only]] Pons:
Look for that file and line number, then look for the missing file, or take out that search.
[Android Software/Hacking General [Developers Only]] aspartame21:
I downloaded full kernel pack (toolchians included also). What kind of file I can miss?
[Android Software/Hacking General [Developers Only]] Pons:
/home/aspartame21/android/kern*el/dreamkernel-ics/arch/arm/in*clude/asm/[B]cacheflush.h:19:22: error: mach/smc.h:﻿ No such file or directory[/B]

It's missing something. And just because you downloaded the full kernel source, doesn't mean yours has it. And it tells you what you're missing, so try and look for it.
[Android Software/Hacking General [Developers Only]] aspartame21:
For example, I use dorimax kernel. I have to donwload cm10 and patch it with dorimax? If you have any experience, please, tell me how what I need to build dorimax kernel?
[Android Software/Hacking General [Developers Only]] pilililo2:
Has anyone got the monitor mode working on SGS2 with CM10 and CM10 kernel? Cause i got it working on CM9 but i would like to update to jellybean soon :)
[Android Software/Hacking General [Developers Only]] djxtabay:
If anyone with a Galaxy Nexus using CM10 can achieve it please start a thread in the applications/theme or devlopment forum. Many users will be interested and we have many developpers who will be able to help ;)
[Android Software/Hacking General [Developers Only]] Pons:
Sorry, I don't have your device, nor have I even heard of this dorimax kernel (probably because one doesn't exist for my device).
[Android Software/Hacking General [Developers Only]] aspartame21:
Just tell me. You want to build kernel from custom kernel source. What do you need for it? Custom kernel source, toolchains. That's all or you need originally device/AOSP kernel source?
[Android Software/Hacking General [Developers Only]] :
i offer 100$ to the one that will build wifi monitor mode module for s3!
[Android Software/Hacking General [Developers Only]] X10_minipro:
Why would you do that?

And your name doesn't fit with what you just wrote. I thought crackers would be good with this kind of stuff. And if I weren't, I would try to learn. Gonna try this for sgs 1 in a couple of days
[Android Software/Hacking General [Developers Only]] fwayfarer:
Very few people in the USA have the $1000 international galaxy s3 so you're going to be waiting a while

For clarification I was trying to build for ATT galaxy s3 with a callsign of d2att
[Android Software/Hacking General [Developers Only]] :
Euh it costs 600$ bro...

---------- Post added at 08:12 AM ---------- Previous post was at 08:10 AM ----------

Im kingofcracking in all wifi stuff and spoofing and network hacking... but Im new to Android ! This is why I am not really a developper and wanted someone to build s3 wifi monitor mode module for me..
[Android Software/Hacking General [Developers Only]] X10_minipro:
Not trying to blame you or anything, just curios...

If you are a "kingofcracking" in all kinds of wifi stuff such as network penetration etc, then you are pretty familiar with linux?

I guess it is not gonna be hard to do it then?

I am a beginner at network stuff, learned a little linux over the months I have done it, and I am thinking of doing this when I get home. Not to the s3 but to the s1, thats why I am wondering, what I know it can not be that difficult, sure a couple of hours reading and learning, and I am sure I have to start over a couple of times. But why not try it yourself since I guess you are familiar with these stuff? And save your money?
[Android Software/Hacking General [Developers Only]] :
hahaha ;) the problem is that I want to do it on my rooted s3; without cynanogen mod; and I dont want to touch any of my file; and I prefer to have a .ko file already built :P... Because it may not work if I build it with my kernel 3.15... And for your info I am very familiar with all wireless stuff command... but I am not strong at programming and I ve never heard about kernel until I bought my android phone! (Btw for the money I was joking...:P):S ...

So I went to this forum to see if someone can help me building a module for my phone...

And if you want me to say the truth I didnt understand the tuto for cross-compiling for making a module for my phone... ;) So please can someone explain to me with details how to do it on s3... Thank you... and sorry for my weakness in programming i am just 15 and if you wanna ask me questions about cracking networks ... I am there !:thumbup::)
[Android Software/Hacking General [Developers Only]] pilililo2:
Well the blogspot these 3 devs opened hasnt had an update since a month, neither has this thread, i was hoping for injection on the BCM4330 :( since I already got monitor mode working.
[Android Software/Hacking General [Developers Only]] :
Be patient cat... euh sorry man!:P
[Android Software/Hacking General [Developers Only]] icebreaker101010:
It is working for samsung galaxy note n7000? Or there is anybody who make it work on note n7000 ?

Thanks,:)