News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

help about native api

Started by jangogrand, August 11, 2017, 09:55:10 AM

Previous topic - Next topic

jangogrand

i need it to be able to compare between solder in clone troopers , to attack the galaxy  , you know iam Jango Fett

aw27

64-bit version


; 100% ML64 compliant ASM
; ml64 -c -Zp8 test64.asm
; link /entry:main /SUBSYSTEM:console test64.obj


OPTION Casemap :None

TRUE equ 1

includelib \masm32\lib64\ntdll.lib
RtlCompareString PROTO :ptr,:ptr,:BYTE

includelib \masm32\lib64\msvcrt.lib
printf PROTO :ptr, :vararg

includelib \masm32\lib64\kernel32.lib
ExitProcess proto :dword

_STRING struct
_Length word ?
_Maximumlength word ?
_Buffer qword ?
_STRING ends

.data
s1 db "bcde" ;
s2 db "bulls$" ;
format db 'result: %d',13,10,0

.code

main proc public
LOCAL str1 : _STRING
LOCAL str2 : _STRING

mov str1._Length, LENGTHOF s1
mov str1._Maximumlength, LENGTHOF s1
mov rax, offset s1
mov str1._Buffer, rax

mov str2._Length, LENGTHOF s2
mov str2._Maximumlength, LENGTHOF s2
mov rax, offset s2
mov str2._Buffer, rax

sub rsp, 20h
lea rcx, str1
lea rdx, str2
mov r8, TRUE
call RtlCompareString

lea rcx, format
mov edx, eax

call printf
add rsp, 20h

push 0
call ExitProcess
main endp

end

jj2007

So you are a gamer and want to inject a short routine ... oops, that remark was against point 3 of the forum rules :icon_redface:

Try to keep questions in the legal sphere, and you will get help for your "educational project". Thanks for the project description, it clarifies things and helps to understand that you are not developing
Quote from: aw27 on August 11, 2017, 07:02:29 PMramsonware

Welcome to the Forum :icon14:

jangogrand

thank you  jj2007 , how many years you are in the field of assembly programming?

jj2007

Quote from: jangogrand on August 11, 2017, 08:57:49 PM
thank you  jj2007 , how many years you are in the field of assembly programming?

About 30, but I wasted some years on Motorola's 68000 ;)

Most of us here are pretty old, except José alias aw27.

jangogrand

waw , great  jj2007 , my respect to you
what is you advice to me to mastering assembly , i would like to be able to use assembly to program a operating system
and how mastering windows api ,what books is great .

aw27

Quote from: jj2007 on August 11, 2017, 09:01:40 PM
Quote from: jangogrand on August 11, 2017, 08:57:49 PM
thank you  jj2007 , how many years you are in the field of assembly programming?

About 30, but I wasted some years on Motorola's 68000 ;)

Most of us here are pretty old, except José alias aw27.
You are a kid, 25 years ago I was already teaching ASM in magazines.
http://www.atelierweb.com/downloads/PgAssb1.pdf

jangogrand

great  aw27 and jj2007 you are experts , i hope that you help me and advice me to get knowledge and mastering assembly
thank you

jj2007

Quote from: aw27 on August 11, 2017, 09:09:37 PMYou are a kid, 25 years ago I was already teaching ASM in magazines.

Spooler #17? That must have been around end of 1993, right? Some years earlier, I had already published a book with a very renommated science editor. Not on programming, though; but the book was written with my own self-programmed word processor, graphics included; and screen and printer drivers were written in 100kBytes of absolutely pure lowest level 68k assembly 8)

aw27

Quote from: jj2007 on August 11, 2017, 09:47:45 PM
Quote from: aw27 on August 11, 2017, 09:09:37 PMYou are a kid, 25 years ago I was already teaching ASM in magazines.
Spooler #17? That must have been around end of 1993, right? Some years earlier, I had already published a book with a very renommated science editor. Not on programming, though; but the book was written with my own self-programmed word processor, graphics included; and screen and printer drivers were written in 100kBytes of absolutely pure lowest level 68k assembly 8)

Some years earlier I had already done lots, I was invited to produce the ASM tutorial for some reason. I believe the first thing I have done after I was born was looking for a keyboard.

hutch--

Now come on kiddies, no more cat scratching.  :P

Now for jango, "iam not try to make some malware , is only for education"

This sounds like you are not telling us why you want to use this function that is normally only used by device drivers. A string compare is a technically trivial affair, the RTL version outputs standard C design that is also used for sort comparison but there are plenty of string comparison algorithms available, why in particular is a device driver version desirable in this context ? From memory there is a simple API that will do it, certainly a C runtime that will do it and a number of 32 bit assembler algorithms that will do it.

Now I do need an answer here and DO NOT try and feed me bullsh*t as we have heard it all before here many many times.


jangogrand

hutch the answer  is simple , after i have read a book Windows Internals Part 1 (6th Edition) , thei have talk about native api ,  i have no idea about it before so i have try make a native api call , i  chose RtlCompareString  because is simple and have not alot of parameters .

aw27

I would add that it would be a thrilling experience to do device drivers in ASM.
For example, https://vxlab.info/wasm/print.php-article=drvw2k05.htm

I never did, but have that on schedule.

hutch--

OK jango,

We will let it run at the moment but make sure there is no nonsense, you are not being victimised here, we have had many over time that were not honest with us and were trying to extract information on how to get privileged access to write illegal software so we must be careful which means shoot first and ask questions later.

jangogrand