For this exercise, make sure you run all commands from the directory:
/path/to/cbat_tools/docs/exercises/01
There is a program at binary/main
. The source code lives at binary/main.c, though you should be able to complete this exercise without looking at the source code.
Imagine that this program is part of the software that runs on a badge reader. The task of this particular program is to check if a number is a valid employee ID.
0
.1
.You can try it, if you like. Try it with a valid employee ID:
$ ./binary/main 0x39256 $ echo $?
Try it with an invalid employee ID:
$ ./binary/main 0x234 $ echo $?
Use wp
to complete the following tasks:
is_valid_ID
.wp
's output to determine an example of an argument that will trip the assert.bildb
to step through the program line-by-line, and replicate the behavior of tripping the assert.To see the solution, click here.