N++ Ceritfication: Find Invalid MAC address - mac-address

Someone please explain this for me: for N+ certification, I can not use my phone, notes or books (during the test) but I am asked to determine which MAC address is invalid. All are valid to me but I am being told by N+ that C is invalid. How can I tell which are fake and which ones are correct?
A. AA:CE:58:FD:90:08
B. 44:98:3E:F8:33:23
C. 56:AD:BX:89:55:54
D. 94:9E:FE:EE:8C:DF

Values in MAC address must be valid hexadecimal numbers. BX is not so C is not a valid MAC.

Related

Print a code128 barcode starting with the character 'C'

I've written label printing software (Windows, WPF, C#, .net 4.5) that happily prints barcodes with a Datamax H-Class printer, with one exception, when printing a barcode that starts with the character C
When I attempt this, the barcode is truncated up until the first numeric character within it.
Lower case c works fine, but as some of our model codes do start with C, I need to find a way to work around this.
I guess there must be some sort of escape character that would allow this? But I've not managed to find it via Google.
I'm not 100% sure it's a code128 issue either, could it be related to the Datamax H-Class printer, the Datamax Windows C# SDK or possibly the code128 font we're using on the printer?
Sorry the details are so vague, any help or advice on what to check next would be very much appreciated.
Update.
Just in case this is of any use (I doubt it though sadly) the code I'm using to send barcodes to the printer (successfully in the case of all barcode strings not starting with C ) is as follows:
ParametersDPL paramDPL = new ParametersDPL();
paramDPL.Align = ParametersDPL.Alignment.Left;
paramDPL.Rotate = ParametersDPL.Rotation.Rotate_270;
paramDPL.IsUnicode = false;
paramDPL.TextEncoding = Encoding.ASCII;
paramDPL.WideBarWidth = 7;
paramDPL.NarrowBarWidth = 4;
paramDPL.SymbolHeight = 60;
//if the stockCode starts with 'C' the barcode will be truncated
docDPL.WriteBarCode("E", String.Format("{0} {1}", stockCode, serialNumber), COL_1, ROW_5, paramDPL);
The ParametersDPL object is from the Datamax C# SDK. The only possible problem I could see with the code is perhaps the setting of the IsUnicode or TextEncoding properties, but I've experimented with them quite a bit to no effect. None of the other properties on the ParametersDPL seemed like likely culprits either.
I'm unfamiliar with Datamax PCL, but the symptoms suggest that the "C" is being used to select subalphabet "C" of code128. It might be useful to try a stock code starting "A" or "ZB" and see whether the "A" or "B" disappears. If it does, then the first character may be being used to select a subalphabet ("A" is caps-only ASCII, "B" is no-controls ASCII.)
You'd then need to look very closely at Datamax PCL format - it may be that there's a (possibly opional) formatting character there, which makes it leading-character-sensitive. Perhaps forcing in a leading "B" would cure the problem.

OllyDbg 2.01 - Finding a command referencing a static string

I've taken up cracking and reverse-engineering recently with the help of OllyDbg 2.01 and crackmes executables.
So in this particular crackme, I was scrolling through the commands and noticed a PUSH with an ASCII string "&File" (it's a menu string) :
So I thought : "If I can find this information by simply scrolling, surely there must be an automatic way to find a command referencing a particular string".
So I get to the top of the program, hit CTRL+B and search for ASCII "File" to hopefully find it again :
After hitting OK, OllyDbg doesn't find the earlier PUSH. Instead, I get this :
Mmmh.. Okay, that's not what I expected, but let's see what's in there. so I right click => Follow in Dump, and I get this :
So yeah, we found our string in the dump. However, I still haven't found my original PUSH. You can also notice that the string's address is the same as the PUSH's argument (40512C).
As a last try, I right click on the letter at address 40512C, select "Find References", but nope : no reference found.
So TL ; DR question : how do I automatically find a command referencing a string ? Because obviously I'm not gonna scroll the whole command stack everytime I want to find a string.
PS : the string doesn't appear in "referenced text strings" either.
Thanks in advance for your help.
EDIT : okay so I found a solution. I searched the code for "2C 51 40 00" which is the address backward, and i found my PUSH again. It's a bit hacky, anyone with a more efficient solution is welcome to share.
So, there are multiple ways to do this. What I prefer is the following :
Ctrl+G and go to your string in the dump. (0x0040512C) Select the first byte and hit Ctrl+R. This will give you a list where the particular string is referenced. You could also place a hardware breakpoint on the first byte of the string "&" and then you will break every time something accesses it. You could also search for constants (the address or the ascii characters themselves).
By the way there is a subsite dedicated for reverseengineering :)

Convert to E164 only if possible?

Can I determine if the user entered a phone number that can be safely formatted into E164?
For Germany, this requires that the user started his entry with a local area code. For example, 123456 may be a subscriber number in his city, but it cannot be formatted into E164, because we don't know his local area code. Then I would like to keep the entry as it is. In contrast, the input 089123456 is independent of the area code and could be formatted into E164, because we know he's from Germany and we could convert this into +4989123456.
You can simply convert your number into E164 using libphonenumber
and after conversion checks if both the strings are same or not. If they're same means a number can not be formatted, otherwise the number you'll get from library will be formatted in E164.
Here's how you can convert
PhoneNumberUtil phoneUtil = PhoneNumberUtil.getInstance();
String formattedNumber = phoneUtil.format(inputNumber, PhoneNumberFormat.E164);
Finally compare formattedNumber with inputNumber
It looks as though you'll need to play with isValidNumber and isPossibleNumber for your case. format is certainly not guaranteed to give you something actually dialable, see the javadocs. This is suggested by the demo as well, where formatting is not displayed when isValidNumber is false.
I also am dealing with this FWIW. In the context of US numbers: The issue is I'd like to parse using isPossibleNumber in order to be as lenient as possible, and store the number in E164. However then we accept, e.g. +15551212. This string itself even passes isPossibleNumber despite clearly (I think) not being dialable anywhere.

cryptocoin address generation

Recently have been looking at crypto currencies, mostly Bitcoin and Dogecoin. I'm using this source for my project. I've got Bitcoin to work perfectly, and since the Bitcoin gem did not have native support for Dogecoin I had to self-implement it.
Also noticed that another githubber had opened tried to implement dogecoin support, which as of now did not generating address correctly.
The problem seems to be in this particular line. (corresponding to the format of the crypto address)
:address_version => "30"
:address_version = PUBKEY_ADDRESS in base58.h
base58.h
PUBKEY_ADRESS contains value 30.
Specifying this particular number will give address beginning with letter 'L' (litecoin address), where Dogecoin requires 'D'.
Does this have anything to do with Doge using scrypt, I have no technical expertise in this field. How do I go about generating dogecoin pubkey/private key pair?
30 in decimal will give you a address begins with a letter D
30 in hexadecimal (48 in decimal) will give you a address begins with letter L
I think that bitcoin-ruby first changes PUBKEY_ADDRESS from hexa to decimal so :address_version should be 1E (30 in decimal)

Function / algorithm to return fixed value for input range

I want to implement an algorithm / function (a kind of license algorithm), let's call it F1, which returns a fixed key for a full range of input values, say mac addresses.
And then implement the inverse function (say F2), which should return true if the 2 inputs are:
- The previously generated key from F1
- A valid input mac address that belongs to the address range provided previously to F1
To be more specific about why I want to do:
I'm implementing a SW code for BT (Bluetooth) platforms (chips / modules) that should work only on a specific range of BT mac addresses.
The user should provide us with a range of BT addresses (i.e. start address - end address), then using F1 we should provide him with a license key (with a fixed value for all his BT addresses).
Then during MP (mass production) of the BT modules, the module manufacturer shall store this key in the EEPROM on the module.
At module power-up, the function F2 should read the value of the key in EEPROM (as input 1), & read the BT mac address of the module (as input 2), then should return true if this address belongs to the BT address range used for generating the key with F1.
Any ideas?
Where should I start reading? Any keywords?
Hmm, let's say you have two different overlapping ranges, R1 and R2, with two different keys provided by your F1 function, K1 and K2. Then, F2 should return true if it reads either K1 or K2 for a MAC address in the overlap, right? In that case, you need F1 as a reverse-encryptable algorithm that takes start&end or start&mask (if approppriate) and turns it into a "passphrase" by a certain key, then F2 will use either the same key or private key to decrypt the stored value, parse the output vs MAC and return if it's inside the range. So, I think one of the solutions is encryption/decryption via asymmethric keys, one you use as private and for encrypting ranges, the other you provide as public (as it'll be stored explicitly somewhere to be used in F2) to your manufacturer to decrypt your encrypted range.

Resources