reverting the Buffalo WZR-HP-G300NH2 to factory firmware?

Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC based Hardware
Goto page Previous  1, 2, 3, 4, 5, 6  Next
Author Message
cRACKmONKEY421
DD-WRT Novice


Joined: 19 Sep 2006
Posts: 46

PostPosted: Wed Dec 07, 2011 6:43    Post subject: Reply with quote
fyi2000 wrote:
cRACKmONKEY421 wrote:
sent DATA <block=1, 512 bytes>
received ERROR <code=0, msg=Unsupport MODEL>

Can you upload the first 512 bytes of the firmware?


OK I am in North America, and this is from the firmware that came on the CD. It is the same as the one on the North America CD on the Buffalo website. Also- diff between my "North America" firmware and the firmware on the Asia website for this router is nothing, so the firmwares are the same. I hope I chopped the firmware correctly. I used 'head -c 512 OFW > OFW.smaller'

I guess it would make just as much sense for me to try Buffalo branded dd-wrt firmwares, as I think the one I am playing with is encrypted anyway.... So just did that and got the exact same results with latest Buffalo branded DD-WRT download from Buffalo website with North America selected.
Sponsor
fyi2000
DD-WRT Guru


Joined: 04 Apr 2010
Posts: 642

PostPosted: Wed Dec 07, 2011 9:20    Post subject: Reply with quote
It's obvious that the file is not created for tftpboot because it doesn't contain a valid 512-byte header.

To create a file for reverting from DD-WRT to STOCK FIRMWARE,
access console and backup original mtd3:kernel and mtd4:rootfs.

If there's no way to access console from the stock firmware, you might try loading a generic OpenWrt ELF from U-Boot.

Buffalo WZR-HP-G300NH2 - OpenWrt Wiki - Boot Log
Quote:
Creating 7 MTD partitions on "flash":
0x000000000000-0x000000040000 : "u-boot"
0x000000040000-0x000000050000 : "u-boot-env"
0x000000050000-0x000000060000 : "art"
0x000000060000-0x000000160000 : "kernel"
0x000000160000-0x000001ff0000 : "rootfs"
mtd: partition "rootfs" set to be root filesystem
mtd: partition "rootfs_data" created automatically, ofs=2C0000, len=1D30000
0x0000002c0000-0x000001ff0000 : "rootfs_data"
0x000001ff0000-0x000002000000 : "user_property"
0x000000060000-0x000001ff0000 : "firmware"

_________________
DD-WRT Forum - Atheros Recommended Build
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Wed Dec 07, 2011 9:51    Post subject: Reply with quote
fyi2000 wrote:
It's obvious that the file is not created for tftpboot because it doesn't contain a valid 512-byte header.



It is not obvious at all.
Buffalo u-boot can handle 2 types of tftp files, Buffalo Airstation Open Format and Buffalo encrypted format when updating the firmware via tftp.

OpenWRT uses the open format, Buffalo and dd-wrt uses the encrypted format and the header looks structurally correct for an encrypted format file.
How do you backup original mtd3 and mtd4 on a router which has the dd-wrt firmware installed? Wink

_________________
Kernel panic: Aiee, killing interrupt handler!
cRACKmONKEY421
DD-WRT Novice


Joined: 19 Sep 2006
Posts: 46

PostPosted: Wed Dec 07, 2011 18:07    Post subject: Reply with quote
LOM wrote:
How do you backup original mtd3 and mtd4 on a router which has the dd-wrt firmware installed? Wink


I believe I have access to a family member's version 2 router with stock firmware. So as long as I can get that and figure out the rest, we might be in business. Thanks for the info and ideas.
fyi2000
DD-WRT Guru


Joined: 04 Apr 2010
Posts: 642

PostPosted: Wed Dec 07, 2011 19:29    Post subject: Reply with quote
LOM wrote:
fyi2000 wrote:
It's obvious that the file is not created for tftpboot because it doesn't contain a valid 512-byte header.



It is not obvious at all.
Buffalo u-boot can handle 2 types of tftp files, Buffalo Airstation Open Format and Buffalo encrypted format when updating the firmware via tftp.

OpenWRT uses the open format, Buffalo and dd-wrt uses the encrypted format and the header looks structurally correct for an encrypted format file.

Thank you for correcting me.
LOM wrote:
How do you backup original mtd3 and mtd4 on a router which has the dd-wrt firmware installed? :wink:

I referred to stock/original firmware, shouldn't I? Question is, why bother doing so if there's an easier way to revert to stock firmware? Why doesn't WZR-HP-G300NH2 accept an encrypted format file came from the support CD?

So far there's only one report with successful reverting to stock firmware but without further explanation.
afrmx wrote:
I apparently found the mistake on this solution, it never mentions that the tftp put request should be done in binary mode, while the default is ascii. When done in ascii I always got the unsupport model error, once I changed it to binary it worked on the first try. Good Luck.

Excuse me that I thought I can help but actually I can't. So please continue without my presence.

_________________
DD-WRT Forum - Atheros Recommended Build
cRACKmONKEY421
DD-WRT Novice


Joined: 19 Sep 2006
Posts: 46

PostPosted: Thu Dec 08, 2011 3:25    Post subject: Reply with quote
fyi2000 wrote:
Excuse me that I thought I can help but actually I can't. So please continue without my presence.


I think you can. I don't know WTF I'm doing and I have a version 2 with original Buffalo branded DD-WRT firmware right in front of me.

fyi2000 wrote:
To create a file for reverting from DD-WRT to STOCK FIRMWARE,
access console and backup original mtd3:kernel and mtd4:rootfs.


Need help with that part. I'll keep googling for now.

...... OK, I downloaded everything in /dev/mtd/ from a new, never flashed v2 router. Now moving on to figure out what to do with that. Could I just put 'cat mtd3.dump > /dev/mtdblock3' (and mtd4) on the device that I want to revert? I probably won't try that yet. I'm patient. Playing many games between all this. I guess I might as well post the files in case it could help anyone else.


Last edited by cRACKmONKEY421 on Fri Dec 09, 2011 7:12; edited 1 time in total
fyi2000
DD-WRT Guru


Joined: 04 Apr 2010
Posts: 642

PostPosted: Thu Dec 08, 2011 14:43    Post subject: Reply with quote
cRACKmONKEY421 wrote:
I think you can. I don't know WTF I'm doing and I have a version 2 with original Buffalo branded DD-WRT firmware right in front of me.

You must be very very brave to trust me.

There's something wrong with the files you dump. Please execute "cat /proc/mtd ; dmesg".

_________________
DD-WRT Forum - Atheros Recommended Build
cRACKmONKEY421
DD-WRT Novice


Joined: 19 Sep 2006
Posts: 46

PostPosted: Fri Dec 09, 2011 7:16    Post subject: Reply with quote
Has 8 total, not 7
Uploaded the nvram. Good thing it didn't have anything. I removed it anyway.
Code:

root@DD-WRT:~# cat /proc/mtd ; dmesg
dev:    size   erasesize  name
mtd0: 00050000 00010000 "RedBoot"
mtd1: 01f80000 00010000 "linux"
mtd2: 00b54000 00010000 "rootfs"
mtd3: 01330000 00010000 "ddwrt"
mtd4: 00010000 00010000 "nvram"
mtd5: 00010000 00010000 "FIS directory"
mtd6: 00010000 00010000 "board_config"
mtd7: 02000000 00010000 "fullflash"
mtd8: 00010000 00010000 "uboot-env"


I think that's all you want to see.. let me know if not.

I guess kernel is linux, but I attached 1, 2, and 3 anyway.

**Edit: Attachment removed. All you need is mtd1. I attached later.


Last edited by cRACKmONKEY421 on Sat Dec 10, 2011 11:41; edited 1 time in total
fyi2000
DD-WRT Guru


Joined: 04 Apr 2010
Posts: 642

PostPosted: Fri Dec 09, 2011 14:44    Post subject: Reply with quote
Hi there. I'm not that crazy to download that "40.99 MB" thing. Just give me "dmesg" and the first 512-byte of mtd1:linux.

BTW, you can remove the files you upload so far. At the end I'll help you to create just one file that can be write to the flash directly.

_________________
DD-WRT Forum - Atheros Recommended Build
LOM
DD-WRT Guru


Joined: 28 Dec 2008
Posts: 7647

PostPosted: Fri Dec 09, 2011 15:09    Post subject: Reply with quote
the mtd1.dump is the complete firmware, ie kernel followed by rootfs. It starts with a normal u-boot header so it is a plain (not encrypted) firmware which you can use on your bricked router.
_________________
Kernel panic: Aiee, killing interrupt handler!
cRACKmONKEY421
DD-WRT Novice


Joined: 19 Sep 2006
Posts: 46

PostPosted: Fri Dec 09, 2011 18:37    Post subject: Reply with quote
fyi2000 wrote:
Hi there. I'm not that crazy to download that "40.99 MB" thing. Just give me "dmesg" and the first 512-byte of mtd1:linux.


LOL! You'd be crazy to download a 41MB file? It takes about 70 seconds on my sub-par DSL. I feel like that comment came straight from 1992, you time traveler Wink
I can chop it down later if LOM's suggestion doesn't work.

LOM wrote:
the mtd1.dump is the complete firmware, ie kernel followed by rootfs. It starts with a normal u-boot header so it is a plain (not encrypted) firmware which you can use on your bricked router.


Woohoo! I'll give it a try tonight and let you all know.
TheLastBoyScout
DD-WRT Novice


Joined: 25 Aug 2011
Posts: 21

PostPosted: Fri Dec 09, 2011 19:22    Post subject: Reply with quote
If it works, please post the file....


I would love to flash the buffalo version of 17798 on to my wzr-hp-g300nh2....

Ive tried everything I can to get any version of tftp to work and nothing is seeing my router.

Maybe someone else can assist me or tell me where Im going wrong.....

the only issue that I can seem to find is that for some reason, no matter how many 30/30/30 resets i do, everything comes back up showing a 192.168.1.1 ip address with 192.168.1.100 being the starting ip.

any help at all would be appreciated....
fyi2000
DD-WRT Guru


Joined: 04 Apr 2010
Posts: 642

PostPosted: Fri Dec 09, 2011 19:30    Post subject: Reply with quote
LOM is right about it. I forgot that with DD-WRT V24 preSP2 you only need the mtd "linux". "dmesg" should be able to explain that. Maybe LOM can add a 28-byte DD-WRT header to it so that you can upload it via DD-WRT WebGUI.
_________________
DD-WRT Forum - Atheros Recommended Build
cRACKmONKEY421
DD-WRT Novice


Joined: 19 Sep 2006
Posts: 46

PostPosted: Sat Dec 10, 2011 4:29    Post subject: Reply with quote
Didn't quite work yet. When I TFTP mtd1.dump, it actually accepts the file and allows me to send the whole thing. But that's as far as it gets. Eventually the DIAG light turns off, and the router comes up with what was already on it--a newer, community version of dd-wrt. So although the TFTP server accepts the file, it appears to get rejected somewhere down the line.

Close, but no cigar.
TheLastBoyScout
DD-WRT Novice


Joined: 25 Aug 2011
Posts: 21

PostPosted: Sat Dec 10, 2011 4:50    Post subject: Reply with quote
cRACKmONKEY421 wrote:
Didn't quite work yet. When I TFTP mtd1.dump, it actually accepts the file and allows me to send the whole thing. But that's as far as it gets. Eventually the DIAG light turns off, and the router comes up with what was already on it--a newer, community version of dd-wrt. So although the TFTP server accepts the file, it appears to get rejected somewhere down the line.

Close, but no cigar.


nice work still. keep it up! Laughing
Goto page Previous  1, 2, 3, 4, 5, 6  Next Display posts from previous:    Page 3 of 6
Post new topic   Reply to topic    DD-WRT Forum Index -> Atheros WiSOC 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 cannot attach files in this forum
You cannot download files in this forum