Have an account?
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
Who's Online (1)
Looking to introduce yourself? Look no further, and click here! We also have IRC! [irc.evilzone.org #iexploit]
Competitions / Projects
Any got a solution for this programming challenge ?
here is challenge i got from my friend,i just want to know there is a solution available for this task,
when i enter a number it should display it's equivalent binary number like for 2 = 0010 3=0011,
but the important restriction is "IT SHOULD NOT USE/INVOKE MULTIPLICATION OR DIVISION OF ANY FORM" inside the computer.
is there a solution possible ?
if any one has one please post here...
Wrote a quick/dirty C program to illustrate a solution. Uses subtraction and logical AND operations. It converts hex number string to binary string.
printf("Type exit to quit, valid string chars 0-9, A-F, a-f.\n");
if (strcmp(buf, "exit") == 0) break;
int string_convert(char *num)
ret = (char *)malloc(sizeof(char)*strlen(num));
ASCII input -- 0 - 9: 48 - 57; A - F: 65 - 70; a - f: 97 - 102
for (i = 0; i < strlen(num); i++)
if ((int)num[i] > 47 && (int)num[i] < 58)
ret[i] = num[i] - 48;
else if ((int)num[i] > 64 && (int)num[i] < 71)
ret[i] = num[i] - 55;
else if ((int)num[i] > 96 && (int)num[i] < 103)
ret[i] = num[i] - 87;
printf("Invalid character string. Valid characters 0-9, a-f, A-F.\n");
if (ret[i] & 0x8) printf("1"); else printf("0");
if (ret[i] & 0x4) printf("1"); else printf("0");
if (ret[i] & 0x2) printf("1"); else printf("0");
if (ret[i] & 0x1) printf("1"); else printf("0");
int main(int argc, char **argv)
if (argc < 2)
printf("No arguments given, defaulting to prompt.\n");
Looks like the above code has a buffer overflow vuln, may be wrong but it appears that way.
...this was only proof of concept, not designed to be secure, there probably is a buffer overflow vuln in here, but I'll leave that open for you to find out...
haha was only looking through it as iv been learning buffer overflows recently.
"Smashing the stack for Fun and Profit" is a good place to start... ;)
hi bro,thanks for the solution mate :)
yes there is a b0f in there... but I think that is doesn't matter for the case , I really dont know many functions in C , but in many languages exist a way to convert with pre-maded funcions , I recommend to search about that function :) its save a lot of work
Add a Comment