poplaun 0.1

Discussions about all other tools (CusPop, SAV/HOF editors) and hex editing.

Moderator: English Moderator Team

David
The Prince of Persia
The Prince of Persia
Posts: 1368
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: poplaun 0.1

Postby David » March 5th, 2017, 6:06 pm

Norbert wrote:I have also figured out how to stop poplaun 0.1 for Windows from crashing when I launch it a 2nd time in Wine.
In DateTimeToPosix() I had to change
sscanf (sDateTime, "%i-%i-%i %i:%i:%i", &iYear, &iMonth, &iDay, &iHour, &iMinute, &iSecond);
to
sscanf (sDateTime, "%4u-%2u-%2u %2u:%2u:%2u", &iYear, &iMonth, &iDay, &iHour, &iMinute, &iSecond);

I didn't have that problem (under real Windows), and I don't really know why did this change fix it...

Falcury wrote:(By the way, I see that libxml2-2.dll is surprisingly one of the largest DLLs in the set (4.5 MB). I would expect XML parsing to be very lightweight...)

From offset 0x141400 it's just debug info. But then without it the DLL still would be 1.5 MB.
It looks like it even includes HTTP and FTP functionality, though...

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2984
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: poplaun 0.1

Postby Norbert » March 5th, 2017, 7:29 pm

David wrote:I didn't have that problem (under real Windows), and I don't really know why did this change fix it...


Windows and Linux didn't give problems only because they 'worked around' the problem. I also fixed the Linux version when I fixed the Windows version. The problem was that the extracted values that were being passed to mktime() were frequently completely incorrect. Way off, huge values, possibly even negative values. I don't know exactly why sscanf() fails with regular integers, but from what I've read it may be related to "0"s in strings. And it took me quite a while to figure out the problem was in DateTimeToPosix() which is being called from ParseXML(), because it's being called while the MainWindow() is still being drawn. So, in a way, Wine helped me find a bug. The problem wasn't Wine, it was my code.

Norbert wrote:Windows download: poplaun-0.1-win32.zip

If a moderator can also add the above line to the first post of this thread, thanks.


Can someone do this.

David
The Prince of Persia
The Prince of Persia
Posts: 1368
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: poplaun 0.1

Postby David » March 11th, 2017, 10:17 am

Norbert wrote:Windows download: poplaun-0.1-win32.zip

If a moderator can also add the above line to the first post of this thread, thanks.

Done: viewtopic.php?p=20824#p20824

Norbert wrote:The problem was that the extracted values that were being passed to mktime() were frequently completely incorrect. Way off, huge values, possibly even negative values. I don't know exactly why sscanf() fails with regular integers, but from what I've read it may be related to "0"s in strings.

I'm trying to test this, but my antivirus keeps finding "TR/Crypt.ZPACK.Gen7" in the compiled exe! :shock:

Code: Select all

#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]) {
   const char sDateTime[] = "2000-01-01 00:00:00";
   int iYear, iMonth, iDay, iHour, iMinute, iSecond;
   sscanf (sDateTime, "%i-%i-%i %i:%i:%i", &iYear, &iMonth, &iDay, &iHour, &iMinute, &iSecond);    
   printf("%i-%i-%i %i:%i:%i", iYear, iMonth, iDay, iHour, iMinute, iSecond);
   return 0;
}

User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 2984
Joined: April 9th, 2009, 10:58 pm
Contact:

Re: poplaun 0.1

Postby Norbert » March 11th, 2017, 6:55 pm

Thanks for updating the first post.

You could temporarily disable the antivirus software to test.
Your "2000-01-01 00:00:00" may not replicate the issue. (Although your antivirus software is an indicator of sorts.)
Some datetime strings that will are "2014-08-06 02:08:42", "2017-03-09 20:04:31" and "2013-09-14 18:30:40".
Making multiple sscanf() calls, perhaps also simply looping, will increase problems.
Maybe it starts retrieving random stack values, or something.


Return to “Other Tools & Hex Editing”

Who is online

Users browsing this forum: No registered users and 1 guest