poplaun 0.1

Discussions about all other tools (CusPop, SAV/HOF editors) and hex editing.
David
The Prince of Persia
The Prince of Persia
Posts: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: poplaun 0.1

Post by David »

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: 5743
Joined: April 9th, 2009, 10:58 pm

Re: poplaun 0.1

Post by Norbert »

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: 2846
Joined: December 11th, 2008, 9:48 pm
Location: Hungary

Re: poplaun 0.1

Post by David »

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: 5743
Joined: April 9th, 2009, 10:58 pm

Re: poplaun 0.1

Post by Norbert »

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.
User avatar
Norbert
The Prince of Persia
The Prince of Persia
Posts: 5743
Joined: April 9th, 2009, 10:58 pm

Re: poplaun 0.1

Post by Norbert »

Looks like, under Windows, poplaun is having the same (non-)https issues as Total Pack. (I checked using Wine.)
Additionally, Super Adventure isn't being launched properly, neither under Windows, nor under GNU/Linux.
Freaking spaces, man. ("Super Adventure.exe") Linux users know what I'm talking about. Sigh.
Anyway, next weekend I'll release poplaun 0.2 to fix these problems.
Locked