5aLIVE
October 15th, 2009, 08:42
I am trying to establish the format of a simple text file.
I've been analysing a subroutine that returns a pointer to a substring.
I can get it to handle the first substring properly.
The routine of interest to me is called twice. Each call returns a pointer to a substring.
On the second call to the routine, it returns a null pointer.
I know what the second substring should look like, I just can't seem to get the routine to return the pointer.
I believe this is the bit of code that could hold the answer.
005472A6 AND EAX,0FF <-EAX contains a character read from the text file
005472AB BT DWORD PTR DS:[EDX],EAX <-This pointer holds the value 00000000
005472AE JNB SHORT 005472B3 <-I *think* I need the carry flag to be set so as not to jump and start parsing the second string.
What character (if any) will set the carry flag? I have tried editing the text file with a hex editor and inserting 00 and FF so far, this didn't work.
I would have thought EAX = 00h would have set the CF to 1?
So I need to format the text like this substring_1?substring_2.
I just need to find the "separating" character "?" which will set the CF for the second string to be parsed. I confirmed this to work as expected by setting the CF to 1 by hand at the right time in the loop.
Thanks,
5aLIVE.
I've been analysing a subroutine that returns a pointer to a substring.
I can get it to handle the first substring properly.
The routine of interest to me is called twice. Each call returns a pointer to a substring.
On the second call to the routine, it returns a null pointer.
I know what the second substring should look like, I just can't seem to get the routine to return the pointer.
I believe this is the bit of code that could hold the answer.
005472A6 AND EAX,0FF <-EAX contains a character read from the text file
005472AB BT DWORD PTR DS:[EDX],EAX <-This pointer holds the value 00000000
005472AE JNB SHORT 005472B3 <-I *think* I need the carry flag to be set so as not to jump and start parsing the second string.
What character (if any) will set the carry flag? I have tried editing the text file with a hex editor and inserting 00 and FF so far, this didn't work.
I would have thought EAX = 00h would have set the CF to 1?
So I need to format the text like this substring_1?substring_2.
I just need to find the "separating" character "?" which will set the CF for the second string to be parsed. I confirmed this to work as expected by setting the CF to 1 by hand at the right time in the loop.
Thanks,
5aLIVE.