flat assembler
Message board for the users of flat assembler.

Index > Windows > Win32 calls. Register usage?

Goto page Previous  1, 2, 3 ... 7, 8, 9, 10, 11  Next
Author
Thread Post new topic Reply to topic
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:10
revolution wrote:
Azu wrote:
revolution wrote:
If you are generating a PE file then you will only see a reduction in size if it passes a page boundary (512B). And your code will fail if you try to access into the next VM page.
Code:
format PE ...
...
mov [any_data],eax ;CRASH: the data has not been paged into your memory or you overwrite the following page of data
.data
string1 db 'Hello world!',0  ;13 bytes forces a new 512 byte section in file
some_data = $ ;Okay if you have less than 4083 bytes used at runtime
any_data = $+4096 ;error at runtime, the data was not reserved!    
What's that have to do with wsprintf?
Ermm, nothing whatsoever. But why do you drag in a post from [url=https://board.flatassembler.net/topic.php?p=93865#93865]another thread[/ur] and paste it here as if to say I posted it here? Very bad manners!
Same reason you put words in my mouth that I never said, which is even worse manners.

Before you ask for a friggin link.. page 7, this thread.


Last edited by Azu on 08 Jun 2009, 17:11; edited 1 time in total
Post 08 Jun 2009, 17:10
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
arigity



Joined: 22 Dec 2008
Posts: 45
arigity 08 Jun 2009, 17:11
Azu wrote:
It isn't a new calling standard, it's just how the vararg function, wsprintf, should use stdcall.. so that code is smaller, and all the Windows functions will use the same standard.


that does not make the limitations it imposes any less cumbersome.

you messed up your PoC here
pop ecx
pusha
pop edi
pop esi

pushad pushes all registers onto stack, what you pop off won't be function arguments but old registers. (see: killing usefullness of stack)
Post 08 Jun 2009, 17:11
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:14
Azu wrote:
Same reason you put words in my mouth that I never said, which is even worse manners.

Before you ask for a friggin link.. page 7, this thread.
I never put words in your mouth. Sorry, you are just not being sensible.
Post 08 Jun 2009, 17:14
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:15
arigity wrote:
Azu wrote:
It isn't a new calling standard, it's just how the vararg function, wsprintf, should use stdcall.. so that code is smaller, and all the Windows functions will use the same standard.


that does not make the limitations it imposes any less cumbersome.

you messed up your PoC here
pop ecx
pusha
pop edi
pop esi

pushad pushes all registers onto stack, what you pop off won't be function arguments but old registers. (see: killing usefullness of stack)
Sue me. Here's your new PoC




Code:
Pop the vararg registers off the stack as you need them (when you find %s in the format string)    






Happy now? Now let me sleep already
Post 08 Jun 2009, 17:15
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:16
revolution wrote:
Azu wrote:
Same reason you put words in my mouth that I never said, which is even worse manners.

Before you ask for a friggin link.. page 7, this thread.
I never put words in your mouth. Sorry, you are just not being sensible.
Stop being such a fucking asshole already. I told you what page you did it on, it's right there in plain fucking sight, you can't deny it, so why are you trying to?? Wtf is your problem???? You even quoted me saying where you did it.. way to go..


Last edited by Azu on 08 Jun 2009, 17:17; edited 1 time in total
Post 08 Jun 2009, 17:16
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:17
Where do I misquote you? Nothing on page 7.
Post 08 Jun 2009, 17:17
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:18
You're only two posts in that page, genius.
Post 08 Jun 2009, 17:18
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4624
Location: Argentina
LocoDelAssembly 08 Jun 2009, 17:20
Azu wrote:

You are already making a branch, just put the arg in that, problem solved. Now lemme sleep :<

No, I don't, I have used the result of SETcc as an index for a string table where both fmt strings are stored.

And your PoC should at least not crash, otherwise you are proposing something you don't even know if it could really work (which don't forget the point that will be seriously slower than simple cdecl if we consider your spoken proposal)

Have a good night.
Post 08 Jun 2009, 17:20
View user's profile Send private message Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:22
LocoDelAssembly wrote:
Azu wrote:

You are already making a branch, just put the arg in that, problem solved. Now lemme sleep :<

No, I don't, I have used the result of SETcc as an index for a string table where both fmt strings are stored.
SETcc has the same kind of misprediction penalties as Jcc Confused

LocoDelAssembly wrote:
And your PoC should at least not crash, otherwise you are proposing something you don't even know if it could really work (which don't forget the point that will be seriously slower than simple cdecl if we consider your spoken proposal)


Since for some reason just describing the concept in plain English isn't enough, and posting a basic asm example isn't enough, I'll write the full function by hand tomorrow and post it here okay, so you can just drop it in and use it, straight copy and paste.. hopefully that will be enough for you guys =/


LocoDelAssembly wrote:
Have a good night.
Thank you.


Last edited by Azu on 08 Jun 2009, 17:26; edited 1 time in total
Post 08 Jun 2009, 17:22
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:25
Azu wrote:
You're only two posts in that page, genius.
Hmm, well I count three, 1, no quotation, 2, no quotation, 3, where I do quote you.. Which one please?
Post 08 Jun 2009, 17:25
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:27
revolution wrote:
Azu wrote:
You're only two posts in that page, genius.
Hmm, well I count three, 1, no quotation, 2, no quotation, 3, where I do quote you.. Which one please?
You know what I mean. The first two. Now fuck off.
Post 08 Jun 2009, 17:27
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
arigity



Joined: 22 Dec 2008
Posts: 45
arigity 08 Jun 2009, 17:28
Azu wrote:

Code:
Pop the vararg registers off the stack as you need them (when you find %s in the format string)    


Happy now? Now let me sleep already


without the pushad ebx, esi, edi aren't preserved thus another problem arises.

mind you of course, that this already slows it down as apposed to cdecl, while limiting how you may use the function.

p.s. go to sleep Twisted Evil
Post 08 Jun 2009, 17:28
View user's profile Send private message Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:30
Azu wrote:
You know what I mean. The first two. Now fuck off.
No sense I can make of that. I never quoted you in the first two Exclamation
Post 08 Jun 2009, 17:30
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:32
So now you finally understand what I mean? Yes? That you tried to put words in my mouth. Okay, now you accept


Last edited by Azu on 08 Jun 2009, 17:34; edited 1 time in total
Post 08 Jun 2009, 17:32
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:34
No, I don't understand what you are getting at! You will need to explain more.
Post 08 Jun 2009, 17:34
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:35
You agree with me, good, okay. That is wonderful. I am glad.




See? I can do it too, jackass.
Post 08 Jun 2009, 17:35
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:37
Confused
Post 08 Jun 2009, 17:37
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:39
So you don't like it either huh. Didn't think so. So don't do it to me.


Last edited by Azu on 08 Jun 2009, 17:39; edited 1 time in total
Post 08 Jun 2009, 17:39
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
revolution
When all else fails, read the source


Joined: 24 Aug 2004
Posts: 20513
Location: In your JS exploiting you and your system
revolution 08 Jun 2009, 17:39
Azu wrote:
See? I can do it too, jackass.
Do what? Insult people?
Post 08 Jun 2009, 17:39
View user's profile Send private message Visit poster's website Reply with quote
Azu



Joined: 16 Dec 2008
Posts: 1159
Azu 08 Jun 2009, 17:40
revolution wrote:
Azu wrote:
See? I can do it too, jackass.
Do what? Insult people?
By putting words in your mouth like you did to me, yes.
Post 08 Jun 2009, 17:40
View user's profile Send private message Send e-mail AIM Address Yahoo Messenger MSN Messenger ICQ Number Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  
Goto page Previous  1, 2, 3 ... 7, 8, 9, 10, 11  Next

< 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-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.