how do I edit cfe.bin ??

Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware
Goto page 1, 2  Next
Author Message
vronp
DD-WRT Novice


Joined: 13 Jul 2006
Posts: 17

PostPosted: Sun Jan 18, 2009 14:39    Post subject: how do I edit cfe.bin ?? Reply with quote
Hi all,

What tool do you recommend for editing cfe.bin ?

Any tutorials around ?

thanks
Sponsor
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 18, 2009 14:49    Post subject: Reply with quote
all you do do is simple edit/replace of macs using a hex editor.

There are plenty of free (freeware) hex editors available.

Anything more than that, you need to compile the source code.

_________________
[Moderator Deleted] Shocked
vronp
DD-WRT Novice


Joined: 13 Jul 2006
Posts: 17

PostPosted: Sun Jan 18, 2009 15:09    Post subject: Reply with quote
Thanks. But I should have posed a better question.

I understand the hex editor part but are there any tutorials about how one finds and changes the mac addresses?

thanks
KeithB
DD-WRT User


Joined: 22 Jun 2008
Posts: 489

PostPosted: Sun Jan 18, 2009 15:13    Post subject: Reply with quote
Tell us the hardware manufacturer/model, and the CFE version, and we can be more specific in what to look for. Very Happy Use a hex editor (I use frhed) to scroll through the cfe.bin file until you see what appears to be the MAC addresses. Depending on the hardware manufacturer, the first three hex pairs of the MAC addresses should be constant. You can search for those with many hex editors, or even search for the ASCII NVRAM variable names, like 'et0macaddr'.
_________________
2x Asus RT-AC68U
vronp
DD-WRT Novice


Joined: 13 Jul 2006
Posts: 17

PostPosted: Sun Jan 18, 2009 15:31    Post subject: Reply with quote
WRT54G v4

Not sure about the CFE version. I scp'd the cfe after I put V23SP2-std on the router.
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 18, 2009 16:06    Post subject: Reply with quote
They are close to the top of the file. About at offset 000010C1.

Labled et0macaddr=xx:xx:xx:xx:xx:xx, and il0macaddr= bla:bla:bla.

et0=whatever, and il0 = et0+1 (I think) Razz

_________________
[Moderator Deleted] Shocked
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11475
Location: Wherever the wind blows- North America

PostPosted: Sun Jan 18, 2009 19:03    Post subject: Reply with quote
barryware wrote:
They are close to the top of the file. About at offset 000010C1.

Labled et0macaddr=xx:xx:xx:xx:xx:xx, and il0macaddr= bla:bla:bla.

et0=whatever, and il0 = et0+1 (I think) Razz


Correct...but...there are some CFE's that don't use the et0macaddr and il0macaddr variables. They have a separate location for just the unit's MAC address.

WRT54Gv4 is a good example of this. Sometimes...its just trial and error when finding the correct variable to change.

That said...another really tricky unit is the Serial Flash CFE of a Netgear WGR614L unit. This has a totally separate loction for the MAC address on the flash chip (it isn't in the CFE)...and to make matters worse...the extracted data from this unit is Byteswapped Little Endian format...meaning you have to byteswap it first so you can read it...edit it...byteswap it back...then JTAG it back on.

So there is no easy answer to your question...but if you ask...we can probably point you in the right direction.

I use HexEditor (freeware)

For the Gv4 unit...the MAC address is actually located at Hex address 1E00

This unit is one of the ones that doesn't care about the et0 and il0 variables.

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 18, 2009 19:26    Post subject: Reply with quote
Red....

As long as you are here, which mac is what?

Meaning, the sticker on the box, that should be et0.. right?

_________________
[Moderator Deleted] Shocked
vronp
DD-WRT Novice


Joined: 13 Jul 2006
Posts: 17

PostPosted: Sun Jan 18, 2009 19:32    Post subject: Reply with quote
redhawk0,

I'm very glad you made this post because I had found those variables and the mac addresses shown made no sense to me whatsoever. That is to say, they didn't match the mac address on the bottom of the router (which is also shown in the DD-WRT GUI).

So, I'm assuming I'll find the matching mac somewhere else.

And because I'm a noob, I want to make sure I understand something. This CFE.BIN file is the original since I have not replaced it and I'll I've done is install DD-WRT per: http://www.dd-wrt.com/wiki/index.php/WRT54G_v4_Installation_Tutorial

In other words, the DD-WRT install does not involve replacing or modifying the CFE.BIN ??

While we are talking about this particular router, I should note that I installed v23 SP2 (09/15/06) std per the instructions referenced above. Does anyone know if it is safe to install a newer version?

thanks again !
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 18, 2009 19:47    Post subject: Reply with quote
I have found in certain devices, wap54G V3 for instance, the mac's in the cfe do not match the mac on the sticker. Running stock firmware, the mac's are correct no matter what the macs in the cfe are.

I installed dd-wrt on a wap and the macs were wrong and even more baffling, did not match the mac's in the cfe. I extracted the cfe, edited it, flashed it back and installed dd-wrt again and the mac's were then correct.

I donno... I believe this will plague mankind for years to come.

_________________
[Moderator Deleted] Shocked
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11475
Location: Wherever the wind blows- North America

PostPosted: Sun Jan 18, 2009 19:52    Post subject: Reply with quote
vronp wrote:
redhawk0,

I'm very glad you made this post because I had found those variables and the mac addresses shown made no sense to me whatsoever. That is to say, they didn't match the mac address on the bottom of the router (which is also shown in the DD-WRT GUI).

So, I'm assuming I'll find the matching mac somewhere else.

And because I'm a noob, I want to make sure I understand something. This CFE.BIN file is the original since I have not replaced it and I'll I've done is install DD-WRT per: http://www.dd-wrt.com/wiki/index.php/WRT54G_v4_Installation_Tutorial

In other words, the DD-WRT install does not involve replacing or modifying the CFE.BIN ??

While we are talking about this particular router, I should note that I installed v23 SP2 (09/15/06) std per the instructions referenced above. Does anyone know if it is safe to install a newer version?

thanks again !


LAN = MAC
WAN=MAC+1
WLAN=MAC+2

(the WAPv1 is an exception)

LAN = et0macaddr
WAN = il0macaddr

However, as stated above...there are excptions to this...there are CFE's that don't use these variables...they get the LAN MAC address from another location (like your V4)

firmware DOES NOT change the CFE....it may rewrite variables that are default in the CFE...but the CFE itself is NOT altered.

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11475
Location: Wherever the wind blows- North America

PostPosted: Sun Jan 18, 2009 19:59    Post subject: Reply with quote
barryware wrote:
I have found in certain devices, wap54G V3 for instance, the mac's in the cfe do not match the mac on the sticker. Running stock firmware, the mac's are correct no matter what the macs in the cfe are.

I installed dd-wrt on a wap and the macs were wrong and even more baffling, did not match the mac's in the cfe. I extracted the cfe, edited it, flashed it back and installed dd-wrt again and the mac's were then correct.

I donno... I believe this will plague mankind for years to come.


Correct...the WAP V3 unit, when we install the firmware overwrites the flash location where the original Linksys WAP stores the MAC address...the original Linky CFE does not use the et0 and il0 variables either....but since we overwrite the actual MAC address with dd-wrt firmware, the dd-wrt firmware defaults to what is written to in the CFE...in this case...the unused (linksys) et0 and il0 variables.

So...on a WAP unit...you can edit et0 and il0 variables to your actual MAC...reflash with JTAG...and install dd-wrt...then the unit will have a hardcoded MAC embedded in the CFE for dd-wrt to use.

This is EXACTLY what I tried to convey in the wiki for the WAP units....If I knew then what I know now about the variables...I could have added the WAPver=3 as a variable in the CFE as well....or the boardnum=2 for the WAPv1.0 unit that I have.

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 18, 2009 20:04    Post subject: Reply with quote
Red....

Don't want to argue or anything but when I was researching my quandary in regards to the mac's on my wap, there were several posts in the linksys forums in regards to mac's changing after a linksys firmware upgrade.

The solution was to contact linksys technical support and they would e-mail some type of utility that would fix it.

In my search for a cfe, I downloaded three different cfe's from three different sources and all had the same mac's as the one I had taken off my wap. It is possible that they all originated from the same source but the mac's in my cfe were the same as the ones I downloaded.

_________________
[Moderator Deleted] Shocked
redhawk0
DD-WRT Guru


Joined: 04 Jan 2007
Posts: 11475
Location: Wherever the wind blows- North America

PostPosted: Sun Jan 18, 2009 20:16    Post subject: Reply with quote
barryware wrote:
Red....

Don't want to argue or anything but when I was researching my quandary in regards to the mac's on my wap, there were several posts in the linksys forums in regards to mac's changing after a linksys firmware upgrade.

The solution was to contact linksys technical support and they would e-mail some type of utility that would fix it.

In my search for a cfe, I downloaded three different cfe's from three different sources and all had the same mac's as the one I had taken off my wap. It is possible that they all originated from the same source but the mac's in my cfe were the same as the ones I downloaded.


Correct...that is what I was trying to say...I guess I just didn't say it clearly.

The CFE's are all identical...there is another location in the flash chip (outside the CFE partition) where the MAC is stored. The utility from Linksys you are talking about, talks to the location outside the CFE. (Netgear did the exact same thing on this WGR614L that I have)

So for Linksys firmware...it reads that flash memory location...but dd-wrt looks for et0 and il0.

For some units where the et0 and il0 are not used in the CFE...but the MAC is still stored inside the CFE (this V4 for example)....the CFE gets the MAC...then generates all the rest of the required variables from that MAC address...then dd-wrt takes over and uses those variables.

I know....its all a bit confusing....and it makes it difficult to supply someone with a "customized" CFE also...unless you know where you are looking for each individual Make/Model/Version.

redhawk

_________________
I do NOT provide personal assistance through chat or phone....so please don't ask.
barryware
DD-WRT Guru


Joined: 26 Jan 2008
Posts: 13049
Location: Behind The Reset Button

PostPosted: Sun Jan 18, 2009 20:18    Post subject: Reply with quote
redhawk0 wrote:
barryware wrote:
Red....

Don't want to argue or anything but when I was researching my quandary in regards to the mac's on my warp, there were several posts in the linksys forums in regards to mac's changing after a linksys firmware upgrade.

The solution was to contact linksys technical support and they would e-mail some type of utility that would fix it.

In my search for a cfe, I downloaded three different cfe's from three different sources and all had the same mac's as the one I had taken off my wap. It is possible that they all originated from the same source but the mac's in my cfe were the same as the ones I downloaded.


Correct...that is what I was trying to say...I guess I just didn't say it clearly.

The CFE's are all identical...there is another location in the flash chip (outside the CFE partition) where the MAC is stored. The utility from Linksys you are talking about, talks to the location outside the CFE. (Netgear did the exact same thing on this WGR614L that I have)

So for Linksys firmware...it reads that flash memory location...but dd-wrt looks for et0 and il0.

For some units where the et0 and il0 are not used in the CFE...but the MAC is still stored inside the CFE (this V4 for example)....the CFE gets the MAC...then generates all the rest of the required variables from that MAC address...then dd-wrt takes over and uses those variables.

I know....its all a bit confusing....and it makes it difficult to supply someone with a "customized" CFE also...unless you know where you are looking for each individual Make/Model/Version.

redhawk


I am sure you didn't state it wrong. I have Alzheimer's moments from time to time Very Happy

_________________
[Moderator Deleted] Shocked
Goto page 1, 2  Next Display posts from previous:    Page 1 of 2
Post new topic   Reply to topic    DD-WRT Forum Forum Index -> Broadcom SoC based Hardware All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum