Author Topic: help about native api  (Read 696 times)

jangogrand

  • Regular Member
  • *
  • Posts: 19
Re: help about native api
« Reply #30 on: August 11, 2017, 08:22:31 PM »
i need it to be able to compare between solder in clone troopers , to attack the galaxy  , you know iam Jango Fett

aw27

  • Member
  • ****
  • Posts: 785
Re: help about native api
« Reply #31 on: August 11, 2017, 08:44:34 PM »
64-bit version

Code: [Select]
; 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

  • Member
  • *****
  • Posts: 7635
  • Assembler is fun ;-)
    • MasmBasic
Re: help about native api
« Reply #32 on: August 11, 2017, 08:48:09 PM »
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
ramsonware

Welcome to the Forum :icon14:

jangogrand

  • Regular Member
  • *
  • Posts: 19
Re: help about native api
« Reply #33 on: August 11, 2017, 08:57:49 PM »
thank you  jj2007 , how many years you are in the field of assembly programming?

jj2007

  • Member
  • *****
  • Posts: 7635
  • Assembler is fun ;-)
    • MasmBasic
Re: help about native api
« Reply #34 on: August 11, 2017, 09:01:40 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

  • Regular Member
  • *
  • Posts: 19
Re: help about native api
« Reply #35 on: August 11, 2017, 09:07:15 PM »
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

  • Member
  • ****
  • Posts: 785
Re: help about native api
« Reply #36 on: August 11, 2017, 09:09:37 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

  • Regular Member
  • *
  • Posts: 19
Re: help about native api
« Reply #37 on: August 11, 2017, 09:19:51 PM »
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

  • Member
  • *****
  • Posts: 7635
  • Assembler is fun ;-)
    • MasmBasic
Re: help about native api
« Reply #38 on: August 11, 2017, 09:47:45 PM »
You 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

  • Member
  • ****
  • Posts: 785
Re: help about native api
« Reply #39 on: August 11, 2017, 09:58:06 PM »
You 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--

  • Administrator
  • Member
  • ******
  • Posts: 4874
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: help about native api
« Reply #40 on: August 11, 2017, 10:25:05 PM »
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.

hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jangogrand

  • Regular Member
  • *
  • Posts: 19
Re: help about native api
« Reply #41 on: August 11, 2017, 10:51:08 PM »
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

  • Member
  • ****
  • Posts: 785
Re: help about native api
« Reply #42 on: August 11, 2017, 11:01:21 PM »
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--

  • Administrator
  • Member
  • ******
  • Posts: 4874
  • Mnemonic Driven API Grinder
    • The MASM32 SDK
Re: help about native api
« Reply #43 on: August 12, 2017, 12:27:11 AM »
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.
hutch at movsd dot com
http://www.masm32.com    :biggrin:  :biggrin:

jangogrand

  • Regular Member
  • *
  • Posts: 19
Re: help about native api
« Reply #44 on: August 12, 2017, 12:39:23 AM »
hutch ok no problem