[bug]script editor & using IO file operation

Find a Bug? Have a Problem? Like to Suggest a Feature? Do it Here

Moderators: g3nuin3, SpeedWing, WhiteHat, mezzo

[bug]script editor & using IO file operation

Postby robrave » Sun Sep 16, 2007 6:36 pm

script editor,
really gives me headache! usually happens when I MHS didn't respond and I was force to use Task Manager to close it. After rerunning MHS, whenever I open the editor, and double-click script from script set or open or create new.. the window where code is supposed to is just nothing! it's as if the textbox is missing.. I have tried all corners everywhere just in case it was resize too smal.. but can't find it :cry: so to restore it I just restart windows.. i have a screenshot.. how can i attached it here?

io file,
I have declared a global variable like this,
FILE * pwFN;

set a hotkey at F11 to call FOpen at F12 to call FClose

and a hardware breakpoint in which EAX value is saved to file, I use FPrintF and FPutS.. both output -1

also after FClose, pwFN still has its value

my workaround is to, add open, write and close at the hardware breakpoint... which i think will be too system extensive especially if the breakpoint was executed many times a second..

thanks!
User avatar
robrave
Hacker Smacker
 
Posts: 41
Joined: Sat Sep 15, 2007 3:27 pm
Location: Philippines

Postby L. Spiro » Sun Sep 16, 2007 8:02 pm

I don’t know why it would not respond; there are no known issues that cause it to hang. If you feel it was a repeatable bug you can describe how you caused it.



As for the editor.
This was caused by handling too many error cases in my code. I was too cautious it seems. I have modified one of the error catchers to ensure this problem never happens again unless you are simply entirely out of disk space.


As for FILE objects.
This was caused by the fact that FILE objects exist only for the life of a thread, while all other objects (HANDLE, FILEHANDLE, sockets, and memory allocations) exist as long as the script itself exists.
This was a result of some decision I made long long ago but I have since forgotten my motive for that decision.



Both of these issues are fixed in the version currently uploaded.
It is still labeled 4.0.0.1 but it was uploaded seconds ago.
I will mark these changes in the log for the next release, but starting now users who download the current release will not have these problems.

Download the current release again.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Postby robrave » Mon Sep 17, 2007 11:51 am

L. Spiro wrote:I don’t know why it would not respond; there are no known issues that cause it to hang. If you feel it was a repeatable bug you can describe how you caused it.

L. Spiro


I don't know if that was a bug though, what I did in the script is to declare some extern variables to get a unicode string of the monster name currently selected and set this script on the hardware breakpoint.. usually when I click on the monster.. MHS windows stop repainting its windows and even the game can't be restored.

For this reason, I was force to kill it using task manager.

OT: is it possible to read a unicode string from the memory? i use while loop which steps 2 bytes at a time and stop when it encounter a null character.

Thanks!
User avatar
robrave
Hacker Smacker
 
Posts: 41
Joined: Sat Sep 15, 2007 3:27 pm
Location: Philippines

Postby L. Spiro » Mon Sep 17, 2007 5:42 pm

You can read a Unicode string from memory using the method you already described.

This is the standard way of doing it.

Luckily using extern variables makes it much easier.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan

Re: [bug]script editor & using IO file operation

Postby robrave » Fri Sep 21, 2007 10:08 am

robrave wrote:script editor,
really gives me headache! usually happens when I MHS didn't respond and I was force to use Task Manager to close it. After rerunning MHS, whenever I open the editor, and double-click script from script set or open or create new.. the window where code is supposed to is just nothing! it's as if the textbox is missing.. I have tried all corners everywhere just in case it was resize too smal.. but can't find it :cry: so to restore it I just restart windows.. i have a screenshot.. how can i attached it here?


this happened again, but this time I was able to find the resizing area.. i uploaded a video

Image
User avatar
robrave
Hacker Smacker
 
Posts: 41
Joined: Sat Sep 15, 2007 3:27 pm
Location: Philippines

Postby L. Spiro » Sat Sep 22, 2007 11:04 pm

All problems are fixed in verson 4.0.0.2, now available on the download page.


L. Spiro
User avatar
L. Spiro
L. Spiro
 
Posts: 3129
Joined: Mon Jul 17, 2006 10:14 pm
Location: Tokyo, Japan


Return to Bugs/Problems/Suggestions

Who is online

Users browsing this forum: No registered users and 0 guests