flat assembler
Message board for the users of flat assembler.

Index > Windows > undefined symbol "c.sin_family"

Author
Thread Post new topic Reply to topic
Havok



Joined: 29 Oct 2011
Posts: 7
Havok
Hello everyone,

I have a bit of a problem that I hope I can get help with. I'm working on a HTTP server and I'm having a problem getting it to compile while trying not to use any include files. Here is a part of my code I am having trouble with:

Code:
format pe gui

push a 
push 0202h
call [WSAStartup]
push 0
push 0
push 0
push 6
push 1
push 2
call [WSASocket]
mov [b],eax
mov [c.sin_family],2

a db WSADATA
b dd 0
c dd sockaddr_in
    


Where I am having the problem is at "mov [c.sin_family],2". I get an error that says "undefined symbol "c.sin_family"". But I thought I had already defined it with "c dd sockaddr_in"? Any help would be appreciated.
Post 02 Nov 2011, 03:45
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 17636
Location: In your JS exploiting you and your system
revolution
You will need to define the structure of 'c'.
Code:
struc sockaddr_in {
  .sin_family dd ?
  .handle dd ?
  ;...
}

c sockaddr_in
;...
    
Post 02 Nov 2011, 04:02
View user's profile Send private message Visit poster's website Reply with quote
typedef



Joined: 25 Jul 2010
Posts: 2913
Location: 0x77760000
typedef
Why not use WinHTTP API. It has server functionality too.

http://msdn.microsoft.com/en-us/library/windows/desktop/aa384273(v=vs.85).aspx
Post 02 Nov 2011, 04:23
View user's profile Send private message Reply with quote
Havok



Joined: 29 Oct 2011
Posts: 7
Havok
Thanks revolution! I'll try it.

typdef,

Thanks for that. I just wanted to see if I could do this with Winsock 2. I guess I'm a glutton for punishment.
Post 02 Nov 2011, 05:24
View user's profile Send private message 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.