flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
typedef 20 Feb 2011, 17:59
Dude, haha LOL ,,,
struct FILE_INFO { int x; int y; }; ;FILE_INFO info{ 2,2 }; Code: .data hFile DD ? mov [info.x],2 mov [info.y],2 push ... OPEN_EXISTING <----Not this call [CreateFile] invoke WriteFile,[hFile],info,sizeof.FILE_INFO...... ;; in another program FILE_INFO in = {0,0} if FILE_INFO 0,0 invoke ReadFile,[hFile],in,size...... first FILE_INFO is in second FILE_INFO now. Is that it ? |
|||
![]() |
|
Overflowz 20 Feb 2011, 18:07
lol I don't understand :/ I need working example in asm
![]() |
|||
![]() |
|
typedef 20 Feb 2011, 19:55
Ok, sorry dude I was a little busy then here's a simpl Console app in FASM
Code: ; ; Program to write a structure to a file and then read it back. ; Good for designing your own file format This is mostly known as 'Object / Data serialization' in most HLL's |
|||
![]() |
|
Overflowz 20 Feb 2011, 20:32
typedef
without mixing C language ![]() |
|||
![]() |
|
revolution 20 Feb 2011, 20:43
Overflowz wrote: I don't even know what the hell does struct ... |
|||
![]() |
|
typedef 20 Feb 2011, 20:54
Oh, my Bad...
You don't event know what a struct and what it does? ![]() Struct will ease the burden of having to move pointers around. If you recall 'IMAGE_NT_HEADERS' <----- This is a Structure. Code: struct MY_STRUCT x dd ? y dd ? ends same as label: [0x100]: db x ? [0x101]: db y ? ;ends here..... accessing will be label.x or label.y ^ It's just like playing around on the stack: ;For example if you passed it as a value to a procedure proc proc_ mov eax , [ESP+8] [eax+label.x] or eax+MY_STRUCT.x will cast and give you the value in [ESP+8] which is [MY_STRUCT+4] Get it now? :D Dude you should learn atleast C or JAVA, or VB LOL... : ![]() |
|||
![]() |
|
Overflowz 20 Feb 2011, 20:59
Hehe
![]() ![]() |
|||
![]() |
|
typedef 20 Feb 2011, 21:18
Overflowz wrote: I'm gonna learn C after I'll go university. I'm 17 only now Not bad, I started that when I was in High School. (Freshman yr) LOL I started with Visual Basic --> VB.NET --> C/C++, C/C++.NET, C#, then JAVA...LOL. I know QBasic too but it's old and I don't use it anymore.. I find raw WIN32 more sexy than .NET ![]() |
|||
![]() |
|
Overflowz 20 Feb 2011, 21:32
typedef
Hehe ![]() ![]() ![]() |
|||
![]() |
|
typedef 20 Feb 2011, 22:02
I know dude. I love assembly too. I wish I had known about it sometime back, I hate all these .NET stuff, I feel you ma MAN.
![]() |
|||
![]() |
|
Overflowz 20 Feb 2011, 22:38
typedef
nice to hear ![]() |
|||
![]() |
|
typedef 20 Feb 2011, 22:53
You can use DOS interrupts maybe.... If you want pure assembly.
|
|||
![]() |
|
DOS386 21 Feb 2011, 07:53
typedef wrote: You can use DOS interrupts maybe.... Bad idea ![]() Quote: If you want pure assembly > CreateFile,'file.bin',GENERIC_WRITE,FILE_SHARE_READ,NULL,CREATE_NEVER > WriteFile ,eax,_OvrFlwz,sizeof.OVERFLOWZ,nBytesWritten,NULL > CloseHandle,[hFile] Good, just avoid M$WCRT.DLL, avoid invoke, instead PUSH and then CALL KERNEL32.DLL ![]() _________________ Bug Nr.: 12345 Title: Hello World program compiles to 100 KB !!! Status: Closed: NOT a Bug |
|||
![]() |
|
typedef 21 Feb 2011, 13:15
word....I usually use PUSH and CALL.
Code: call [ALIAS_HERE] But I know what you mean. I read about calling conventions and all that. Well, I used MSVCRT.DLL because I did not want to take up time writing to the STD_OUTPUT Handle..... <---- But I know it's better than printf ![]() And oh, the printf function should be called by cinvoke if possible... But thanks though ![]() |
|||
![]() |
|
typedef 21 Feb 2011, 13:29
Bump : SNOW DAY ! NO COLLEGE TODAY ! HAHA.
NOW THAT'S THE REAL AMERICAN LIFE ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.