flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
vid 08 Aug 2005, 07:15
catch the return values on every api call you use, and lookup error text (there some api for that too, GetErrorText or something like that). and do this always so you can find error easier.
|
|||
![]() |
|
sekigun 08 Aug 2005, 07:31
vid wrote: catch the return values on every api call you use, and lookup error text (there some api for that too, GetErrorText or something like that). and do this always so you can find error easier. If something can possibly return an error code I do, but I don't see the use in error catching when I check in other parts of the code if the file exists and if it's in use and so on. There must be a bug in the code I posted but I don't have any clue. I will what you recommend, but I think the error code will leave me with some Microsoft documentation pages and the feared C source. |
|||
![]() |
|
vid 08 Aug 2005, 08:17
you don't know windows. error can pop out anywhere, not only where it should. I used to have macros for error catching, it shortens code nicely
|
|||
![]() |
|
sekigun 08 Aug 2005, 13:29
vid wrote: you don't know windows. error can pop out anywhere, not only where it should. I used to have macros for error catching, it shortens code nicely Okay, I get the idea, thank you. I think I should be able to write the macros myself. That is f the error catching APIs are better documented than the error causing ones. Also if anyone could help me with te code I posted I still need help with that... |
|||
![]() |
|
shoorick 08 Aug 2005, 14:22
it is not easy figure out your problem clear to me, so:
0.read carefully about functions you are using and check well parameters you are passing to them. esp. check if you are using zero instead of pointer to empty asciiz string and pointer to var where written bytes number will be stored. 1.split your code into parts, comment them though it has valid prolog and epilog, then compile and run, and check if there an error appeared: eg. open file and immediatelly close it. if no error there - unkomment next part, etc. - with this lazy way you can catch where your program starts crashing even without debugger. 2.just use debugger - ollydebug shows description of most errors 3.if this will not help: i guess your project is not too huge - zip it whole and post here so we can check it (also include small example files you are going to xor) regards! |
|||
![]() |
|
sekigun 08 Aug 2005, 15:06
shoorick wrote: it is not easy figure out your problem clear to me, so: Thank you, I was already doing 1. The crash was on the MapViewOfFile, but the reason became clear when the CreateFileMapping function returned zero. As it's not as obvious as I thought I will try to solve it myself following your advice. I think it could be what you say. I will check the zeros. I don't always understand the meaning of Microsoft's definition of function parameters. |
|||
![]() |
|
sekigun 08 Aug 2005, 15:19
Oh f....... It turns out it was obvious... I copied code from another assembler with a different syntax. [] brackets missing. This solves the error code. But I'm still crashing when I try to poke the memory. I'll will check better.
EDIT: OllyDbg saved me this time, I don't fully understand why some things were wrong. I suppose I introduced stupid new bugs while trying to solve the original one. The posted version should have no errors now. |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.