Hi.
I made a program in C++, and I want to translate it to asm, but I dont have a clue of what to do.
Here is the code:
Quote
typedef void (*t_ChatPrint) ( char * );
t_ChatPrint ChatPrint = (t_ChatPrint)0x0054E410;
void ChatPrintf( const char *format, ... )
{
va_list ap;
char szBuffer[512] = "";
va_start( ap, format );
_vsnprintf_s( szBuffer, 512, 511, format, ap );
va_end( ap );
ChatPrint( szBuffer );
}
Thanks in advance.
Try learning assembler, its a trivial task.
I am trying, but this is too far from my knoledge, so I hope anyone here can help me out. I read in the rules that asking for others to do your homework isnt allowed, but this isnt my homework. just in case someone talks about it.. thanks in advance.
;typedef void (*t_ChatPrint) ( char * );
t_ChatPrint_fn typedef proto c :ptr sbyte
t_ChatPrint typedef ptr t_ChatPrint_fn
;t_ChatPrint ChatPrint = (t_ChatPrint)0x0054E410;
.data
ChatPrint t_ChatPrint 00054E410h
.code
;void ChatPrintf( const char *format, ... )
ChatPrintf proc c format:ptr sbyte, ap:vararg
;{
;va_list ap;
;char szBuffer[512] = "";
LOCAL szBuffer[512]:sbyte
mov szBuffer[0],0
;va_start( ap, format );
invoke _vsnprintf_s, addr szBuffer, 512, 511, format, addr ap ;
;va_end( ap );
invoke ChatPrint, addr szBuffer;
;}
ret
ChatPrintf endp
thanks, I will test and tell if it works.
undefined symbol: _vsnprintf_s
Quote from: lelejau on December 18, 2010, 01:30:09 AM
undefined symbol: _vsnprintf_s
What did you expect? All external functions automagically working under masm32?
Short solution is to use unsafe version _vsnprintf (i guess masm32 version is crt__vsnprintf :eek).
The long (right) solution is to link against newer msvcrt (msvcrt80 or msvcrt90 i don't know) and add a prototype.
Quote from: lelejau on December 18, 2010, 01:30:09 AM
thanks, I will test and tell if it works.
Like i don't know what I'm doing...
lelejau,
If all you want to do is output some text to the console you can manually use Windows API functions or use the masm32 library function StdOut or cheat and use the masm32 "print" macro.
No no, it isn't for a MASM program. this is for a game. Display text inside the game chat. But that nothing to do with hacking, or malicious program, I'm far from it. I would never learn assembler or any other language to hack someone, or something like that.
Quote from: lelejau on December 20, 2010, 05:56:27 PM
No no, it isn't for a MASM program. this is for a game. Display text inside the game chat. But that nothing to do with hacking, or malicious program, I'm far from it. I would never learn assembler or any other language to hack someone, or something like that.
(http://images.zaazu.com/img/Angel-male-bird-smiley-smiley-emoticon-000278-large.gif)
Quote from: dedndave on December 20, 2010, 06:09:20 PM
Quote from: lelejau on December 20, 2010, 05:56:27 PM
No no, it isn't for a MASM program. this is for a game. Display text inside the game chat. But that nothing to do with hacking, or malicious program, I'm far from it. I would never learn assembler or any other language to hack someone, or something like that.
(http://images.zaazu.com/img/Angel-male-bird-smiley-smiley-emoticon-000278-large.gif)
Sorry?
lol
not asking forgiveness
appearance of innocence - facetious
reminds me of Jade when she was little.....
Who ate all the cookies ????
(http://img208.imageshack.us/img208/9623/jade078.jpg)
It was you wasnt it Dave :bdg, really.... If we are being completely honest :lol
especially if they are ginger-snaps :P
So that's not a guilty look, it's a "I wonder what's wrong with my daddy" look?
she is spoiled rotten - lol
daddy's little girl
Twisted around her little finger you are ... :bg
:bg
Dave,
If you post that photo much more the little girl will have rights of royalties for extended publication. :P
i like that pic :P
if you aren't careful, Hutch, i'll make it my avatar - lol
:bg
This topic is full of angels.Don't look at the dark side and never use th cl /Fa.