# MBR sent via mail in binary form



## Seeker (Sep 21, 2011)

I need to get my MBR back.
On a remote machine I've just did:

```
dd if=/dev/ada0 of=/MBR count=1
```
Then I did:

```
cat /MBR | mail -s 'ada0 MBR' me@my.mail
```

Now it is in binary form and I don't know, how to extract it from my email.
Yea, yea, I had to base64 encode it, but I've also drank a few beers and was pissed of with typing too long CMDs!

On home machine I've:

```
cp -v /var/mail/root/cur/1316634_bla_bla_rce.biz:2,S /save_MBR
```
Now when I '*vi /save_MBR*' and delete all header and subject and one empty line, I get:

```
# stat -f "%z" /save_MBR
26
```
MBR is of size 512.
Unedited file /save_MBR has 1012 bytes?!

So, anyone has any ideas?


----------



## vermaden (Sep 21, 2011)

```
# cat /MBR | mail -s 'ada0 MBR' me@my.mail
```

That is not a way to sent attachments mate, it should be like that:


```
# uuencode MBR MBR | mail -s 'ada0 MBR' me@my.mail
```

More here: http://www.shelldorado.com/articles/mailattachments.html


----------



## mbrumlow (Sep 21, 2011)

```
dd if=/dev/ada0 of=/MBR bs=512 count=1
```


----------



## Seeker (Sep 21, 2011)

*bs=512* is NOT needed to be specified, as it is a default.
Second, don't tell ma what I was supposed to do, as I've already said what I was supposed to do!

MBR is now, in body of mail, fully in binary code, so tell me, IF YOU KNOW IT, what am I supposed to do, to get MBR of 512 bytes back?
Extracted from email in file?
CMD?


----------



## redw0lfx (Sep 21, 2011)

Well, I decided to try it and see if I could offer some help. However, at least with my email client, there is a lot of data that is lost (replaced with white space) when the email is received in my inbox.  

Tried comparing the original file against what I received and no luck in finding a way to recreate the lost data.

Sorry to say, but I think your SOL.


----------



## vermaden (Sep 22, 2011)

Seeker said:
			
		

> MBR is now, in body of mail, fully in binary code, so tell me, IF YOU KNOW IT, what am I supposed to do, to get MBR of 512 bytes back?
> Extracted from email in file?
> CMD?



Its broken, even if You get something back, its still broken, after applying that to real MBR place You will end in unbootable system.


----------



## Seeker (Sep 22, 2011)

God dammit, I'm doomed!


Thx, for your help crew!


----------

