flat assembler
Message board for the users of flat assembler.

Index > Main > Weird MessageBox

Author
Thread Post new topic Reply to topic
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 04 Oct 2003, 14:31
At some part of my code there is a call to messagebox. However it always crashes with

---------------------------
myapplication.exe - Application Error
---------------------------
The instruction at "0x77fcb032" referenced memory at "0x007e0049". The memory could not be "written".


Click on OK to terminate the program
---------------------------
OK
---------------------------

The only way I found out that removes this error is by placing a call to the MessageBox at entrypoint. Does anyone knows what went wrong?
Post 04 Oct 2003, 14:31
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 04 Oct 2003, 14:39
Just to add, in ollydbg, the problem does not persist. grr.
Post 04 Oct 2003, 14:39
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Yawgmoth



Joined: 20 Aug 2003
Posts: 37
Yawgmoth 04 Oct 2003, 18:18
Post your code.
Post 04 Oct 2003, 18:18
View user's profile Send private message Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 05 Oct 2003, 04:24
Code:
        or      ecx, -1
        mov     edi, Invalid
        push    0C3F97523h        ;decrypt string in stack
        push    0F348041h
        mov     eax, esp
        call    eax
        pop     eax
        pop     eax             ;empty stack
        invoke  MessageBox,0,Invalid,0,0  
    
Post 05 Oct 2003, 04:24
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
MazeGen



Joined: 06 Oct 2003
Posts: 977
Location: Czechoslovakia
MazeGen 06 Oct 2003, 08:22
Quote:

The instruction at "0x77fcb032" referenced memory at "0x007e0049". The memory could not be "written".


Looks really weird. What about that:
Code:
0x77fcb032 disassembly (reverse order):
32 B0 FC 77 .. ..    XOR DH,[EAX+....77FC]   ; referenced to 007e0049?
    

Is your de/crypting routine all right?

Else it may get out of synchronization:
Code:
32 B0              ???
FC                       CLD
77 xx            JA $+xx
    

or
Code:
32                      ???
B0 FC            MOV AL,FC
77 xx              JA $+xx
    

_________________
x86asm.net
Post 06 Oct 2003, 08:22
View user's profile Send private message Visit poster's website Reply with quote
roticv



Joined: 19 Jun 2003
Posts: 374
Location: Singapore
roticv 06 Oct 2003, 14:02
I do not know what is wrong. The weird thing is that no such error exist in ollydbg, making the debugging pain in the a**. Yes, the decrypting routine is definitely correct. At the beginning, the following snipplet works well for me, but after coding another 300 lines I got that weird error. The only way I could get rid of it is to put a messagebox somewhere before it.
Post 06 Oct 2003, 14:02
View user's profile Send private message Visit poster's website MSN Messenger Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.