Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Dark GDK / Disassembly of DarkSDK files...

Author
Message
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 28th Feb 2006 11:23
Hi,

during debug I took a view at the assembly of darksdk library files.

I noticed that large section of the code are mainly looking like this:


Isn't this just a waste of space and memory ?! Can anyone explain why there is this byte filling between real assembly code?

greets,
Barnski

-- I just started with DarkSDK, by translating DBP Projects. --
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Feb 2006 12:05
File padding. It's not binary data geberated from the actual DGSDK code.


Home of the Cartography Shop - DarkBASIC Professional map importer
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 28th Feb 2006 12:10
You mean its not in the exe?

-- I just started with DarkSDK, by translating DBP Projects. --
OSX Using Happy Dude
20
Years of Service
User Offline
Joined: 21st Aug 2003
Location: At home
Posted: 28th Feb 2006 12:18
It is, but is probably needed to make a proper Win32 executable (align to next section), so something like that.

It could also be reserved memory for global or static variables.

IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 28th Feb 2006 14:06
It is padding, probably from the linking stage.

Go to the properties page, select Linker->Optimisation, and set 'Optimize for Windows98' to no. See if that cuts things down a little.

For free Plug-ins and source code http://www.matrix1.demon.co.uk
Kaiyodo
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: UK
Posted: 28th Feb 2006 15:35
Just to add a random bit of trivia, the instruction 'int 3' will cause a user breakpoint if you're running under a debugger. It can be useful to fill unused memory with that value as it will immediately stop in the debugger if you ever try to execute code there.

But yes, it's just padding to align blocks of code/data on certain byte multiple boundries I assume.

Kaiyodo.
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 28th Feb 2006 15:43 Edited at: 28th Feb 2006 15:48
That Win98 optimization did not change much in this case, but changing from debug to release did change alot

still some of these lines remain.. but MUCH fewer.

i got another problem now though; in release mode it crashes on dbSetDisplayMode!! (even after checking with dbCheckDisplayMode)
if I uncomment the line it runs fine!

and in debug build it runs fine from beginning!

i will go look into this... maybe someone can help?
edit: dang, I posted this too fast, it was due to the same buffer overrun i mentioned in the dbFileExist thread I was having.... (I used the buffer overrun to get into the assembly code of db files)
now everything works! sorry for bothering, and Thanks for yer answers!


greets,
Barnski

-- I just started with DarkSDK, by translating DBP Projects. --
APEXnow
Retired Moderator
21
Years of Service
User Offline
Joined: 15th Apr 2003
Location: On a park bench
Posted: 28th Feb 2006 19:41
Barnsk, that crash in dbSetDisplayMode sounds like an old bug from a previous version of the SDK, have you updated to 1.1.1? Just that this, if I remember correctly, was an historical assertion in the code for that function (Need Mike to verify that) but I remember it occurring in the original release of the SDK.

Anyway, go to your purchase products list page and download the latest version. This should fix that problem...... I hope

Paul.


Home of the Cartography Shop - DarkBASIC Professional map importer
Barnski
18
Years of Service
User Offline
Joined: 26th Jan 2006
Location: Switzerland, Zurich
Posted: 28th Feb 2006 23:50
I already have 1.1.1, but thanx anyways. The problem was something different. A buffer overrun that corrupts somehow some DB functions... really weird!

but now everything seems to work fine.. well.. not 100% actually.
but this is worth another thread, if I decide to post it... tomorrow perhaps..

greets,
Barnski

-- I just started with DarkSDK, by translating DBP Projects. --

Login to post a reply

Server time is: 2024-05-05 23:44:27
Your offset time is: 2024-05-05 23:44:27