Okay... I seriously need to know how to cast in assembly, if there even is such a thing.
I've been using assume and found out that it's causing a problem for me. My program won't finish executing. When I use olly to debug, it gives me an exception error telling me I can't read at memory address 0000000.
When I remove the "assume" part of the code it works fine, everything executes properly. Halp!
Code:
Code:
.code
start:
push 0
push TH32CS_SNAPPROCESS
call CreateToolhelp32Snapshot
mov processHandle,eax
push ebx
push processHandle
call Process32First
Check_Loop:
assume ebx: ptr PROCESSENTRY32
lea edx,[ebx].szExeFile
push offset TargetProcess
push edx
call lstrcmpi
cmp eax,0
je Found
push ebx
push processHandle
call Process32Next
jmp Check_Loop
Found:
push 0
call ExitProcess
end start
It compiles fine.
I'm assuming the problem is the assume instruction, so I'd like to know if there are any other ways of 'casting' in assembly.
By the way, that part of the code executes fine. It's at the end of the program that it fails, try it out for yourself.
This has been bugging me for a while and I'd really appreciate if someone could possibly fix this for me.
Thanks.