well, something is wrong with that code i don't understand. It caused a buffer overflow. How can this be avoided?
"The value of ESP was not properl y saved across a function call. This is usually a result of cal ling a function declared with on e calling conven tion with a func tion pointer dec lared with a dif ferent calling c onvention. .onex it.c FFF.FFFFFFFF.FFF
.75.66.2E ..@. c...str != NULL. flag == 0 || fla g == 1.......... .........EEE.... .50.P.... (8PX.."
OIC, so you found that by using GDB or some simillar debugger right ? As far as I see, it seems that you have called the function using a pointer to something that is not char* So let me do some changes (I'll replace that char* with void*) and try usin it now.
well, something is wrong with that code i don't understand. It caused a buffer overflow. How can this be avoided?
ReplyDelete"The value of ESP
was not properl
y saved across a
function call.
This is usually
a result of cal
ling a function
declared with on
e calling conven
tion with a func
tion pointer dec
lared with a dif
ferent calling c
onvention. .onex
it.c
FFF.FFFFFFFF.FFF
.75.66.2E ..@.
c...str != NULL.
flag == 0 || fla
g == 1..........
.........EEE....
.50.P.... (8PX.."
Actually I don't understand you what do you mean by ESP, and can you send me the code where the BoF has occured !?
ReplyDeleteESP is the extended Segment Pointer, a register in the processor that point to the current memory segment in ram.
ReplyDeleteOIC, so you found that by using GDB or some simillar debugger right ?
ReplyDeleteAs far as I see, it seems that you have called the function using a pointer to something that is not char*
So let me do some changes (I'll replace that char* with void*) and try usin it now.