flat assembler
Message board for the users of flat assembler.

Index > Main > operand size not specified when calling my own proc.

Author
Thread Post new topic Reply to topic
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
This is my proc definition:
Code:
proc encode flag:BYTE, pid:DWORD, option:DWORD, data:DWORD, key:DWORD, state:BYTE    



And my call looks like this:
Code:
invoke encode, TRUE, [PID], NULL, [PPP], EBX, NULL    


In this line, I get "Error: Operand size not specified"
I don't understand why, is it because of passing EBX register directly like that?, what am I doing wrong?

_________________
Im new, sorry if I bothered with any stupid question Smile
Post 09 May 2008, 19:15
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
And how PID and PPP are defined?
Post 09 May 2008, 21:45
View user's profile Send private message Reply with quote
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
PPP is defined inside my proc at the top:

Code:
local PPP:DWORD     


and PID is passed to this proc as DWORD too. (I just wrote them uppercased on the previous post but in the source they are all equal).

the proc im trying to invoke is defined on top of my calling proc, what could be the issue here?

_________________
Im new, sorry if I bothered with any stupid question Smile
Post 10 May 2008, 08:18
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
The problem is that you are using INVOKE, I think you will find that STDCALL will work fine.
Post 10 May 2008, 08:46
View user's profile Send private message Visit poster's website Reply with quote
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
Thanks, that seems to work (compiles ok) however my code doesn't work as it should (and it's a direct port from MASM) too bad the source is quite long and I don't know anyone whos willing to find whats wrong with it, do you know of any fasm IRC channel I can log on to ask?

in case someone has a little bit of time and can check for obvious rookie errors, heres the source of the routine that isn't working properly:

masm: http://pastebin.com/m551d088a (original)
fasm: http://pastebin.com/m143afeb7 (ported)

When I call the masm one I get a certain result (the properly encrypted buffer) but when I call the fasm one, I get rubbish!.

Perhaps I have a few stupid mistakes in my port and thats causing the malfunction, if so I might of committed the same mistake on the other routines I ported as well...
Post 10 May 2008, 09:37
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
I notice the following:
Code:
invoke ReadProcessMemory,[Process], MEMORY_ADDRESS_XTEA_Key, DWORD[XTEAkey], 16, NULL    
Should it be?
Code:
invoke ReadProcessMemory,[Process], MEMORY_ADDRESS_XTEA_Key, addr XTEAkey, 16, NULL    
Post 10 May 2008, 11:36
View user's profile Send private message Visit poster's website Reply with quote
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
Thanks, thanks a lot. I finally got to fix this Smile

I know I have a long way to go, but I'm certain that this is the right path. I don't want to depend on any frameworks and I certainly do want to understand what my code does.

Say, aside from the IA32 books, what else should I read? (I'm going through the FASM docs right now but I'm a slow reader).

_________________
Im new, sorry if I bothered with any stupid question Smile
Post 10 May 2008, 13:07
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
SomeoneNew wrote:
Say, aside from the IA32 books, what else should I read?
I suggest "Hitchhikers Guide to the Galaxy" and it's four followers by Douglas Adams, also "Infinity welcomes careful drivers" and "Better than Life" by Grant Naylor. That is what you were asking, right, some good books to read?
Post 10 May 2008, 13:20
View user's profile Send private message Visit poster's website Reply with quote
SomeoneNew



Joined: 12 Aug 2006
Posts: 54
SomeoneNew
Better than Life is a great book, indeed. I was however asking about programming books Confused My bad English always comes back to haunt me.

Either way, I noticed my DLL ends up being a little bigger than the MASM counterpart, any ideas?.

_________________
Im new, sorry if I bothered with any stupid question Smile
Post 10 May 2008, 16:36
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17717
Location: In your JS exploiting you and your system
revolution
SomeoneNew wrote:
Either way, I noticed my DLL ends up being a little bigger than the MASM counterpart, any ideas?.
How much bigger? Does your data section have initialised data following uninitialised data?
Post 10 May 2008, 17:10
View user's profile Send private message Visit poster's website 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-2020, Tomasz Grysztar. Also on GitHub, YouTube, Twitter.

Website powered by rwasa.