News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

unable to open file in OllyDbg

Started by gelatine1, September 18, 2015, 07:07:44 AM

Previous topic - Next topic

gelatine1

Hi

Ive started proggraming again (it's been a while ...  :redface: ) and I just started to work on a first program. I just wanted to check some things in OllyDbg but clearly odbg says "unable to start file '...' ". I have no clue why OllyDbg is saying that as I've opened it as an administrator and Odbg seems to be able to open an older project of me anyway.

Is there someone who can help me out ? The files are in the attachment. (glwindow.exe and .asm is in the GL window directory, the others are just .def and .mac files)
By the way, the content of glwindow.asm is probably not even correct yet (but it 'compiles') and its just useless for now (and very short :p)

Thanks in advance

EDIT: I tried it in both odbg 1.10 and 2.01

jj2007


gelatine1

Then it must be some issue related to my own pc. Maybe some path i have to add anywhere or some permisions.. I have no antivirus running at the moment. Anyone has an idea?  :icon_confused:

TWell


gelatine1

This time I opened up some process explorer and when i tried to open glwindow.exe in odbg then glwindow.exe appeared in a subtree of odbg.exe so I believe ollydbg is in fact using my executable but not showing the disassembly and stuff.

gelatine1

When i comment the line jnz @F and 'compile' it again then my executable does want to open. is the @F wrong syntax or something or illegal stuff in odbg ??

jj2007

Quote from: gelatine1 on September 19, 2015, 04:27:55 AM
When i comment the line jnz @F and 'compile' it again then my executable does want to open. is the @F wrong syntax or something or illegal stuff in odbg ??

No, it's valid syntax, as long as there is a @@: label afterwards:
jnz @F
nop
@@:

rrr314159

hi gelatine1,

this is just a guess ... if olly does not say "unable to start file '...' " and does show some disassembly, but it's not your code, maybe you have to hit F9 to get to the start of your stuff. That's standard with olly
I am NaN ;)

gelatine1

Nope, it doesnt show anything after saying hes unable to open the file. and yes there is an @@ label afterwards

TWell


gelatine1

Yep like i said if i remove the jnz @F line then the ollydbg does open the resultinng executable. Ive also tried other executables which also get opened

gelatine1

I am still getting a similar error and this thing doesn't make sense at all  :dazzled: :dazzled: it's driving me crazy

So I have the code below (take a quick look at it):


.386
.model flat,stdcall
option casemap:none


include \masm32\include\windows.inc
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
include \masm32\include\gdi32.inc
includelib \masm32\lib\gdi32.lib
include \masm32\include\msvcrt.inc
includelib \masm32\lib\msvcrt.lib

include ..\OpenGL\def\gl.def
include ..\OpenGL\def\glu.def
include ..\OpenGL\def\winextra.def
include ..\OpenGL\def\include.def  ; some files I have in a folder
includelib ..\OpenGL\opengl32.lib
includelib ..\OpenGL\glu32.lib

ReSizeGLScene proto :DWORD,:DWORD

.data
test db "test!"
.data?

.code
start:
invoke ReSizeGLScene,512,512
invoke ExitProcess, eax


ReSizeGLScene proc wid:DWORD,hei:DWORD

;theres no code here

invoke MessageBox,0,addr test,addr test,MB_OK

cmp hei,eax
jnz @F
@@:
inc hei

;....
ret
ReSizeGLScene endp


Once assembled this code will run perfectly and i am able to open the executable in Ollydbg. But if I make a comment out of the MessageBox line then I can still assemble the program but when I try to run the executable It is telling me "Windows cannot access the specified device, path or file. You may not have the appropriate permissions to access the item." I also tried to run the program as administrator, but same thing happened. I am also unable to open the file in olly dbg.

So is there anyone who can suggests me things I could try to fix this or anyone who knows what's going on ??

qWord

In the code from your first post the return address is overwritten by FSTP.
Regarding OllydBG, you might try it with deleting all *.udd files.
MREAL macros - when you need floating point arithmetic while assembling!

gelatine1

I added a push 0 to the code so things became

        fld _45f
push 0
push 0
fstp qword ptr [esp]

and it shouldn't be overwriting the return address anymore. I also removed the udd file belonging to the current project, but same issue occurs again.
By the way what are these udd files ?

dedndave

user-defined data file
actually, not a very good name - lol
it's a list of symbols, as you might imagine