flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
JohnFound 19 Dec 2011, 22:45
use "inc si" and "inc di" instead of i=i+1.
You don't need "i" here at all. There is no variables in this meaning in assembly language. "si" and "di" are your variables here. |
|||
![]() |
|
DOS386 13 Jan 2012, 08:45
Your "i" is a variable, but it exists at compile time only ... and has no effect !
![]() |
|||
![]() |
|
typedef 13 Jan 2012, 15:42
try this simple snippet
Code: password db 'pass1234' input db 8 dup(0) [...] ;<-- Get the password here mov cx, 8 ;<---- strlen(password) lea esi, [password] lea edi, [input] repe compsb jne not_equal [...] ; valid password |
|||
![]() |
|
thor6136 24 Feb 2012, 22:16
typedef wrote: try this simple snippet Can you tell me what exactly is dup(0), and lea esi, edi |
|||
![]() |
|
AsmGuru62 25 Feb 2012, 00:53
dup means duplicate.
Value in brackets is a value to be used to initialize memory. The following code: Code: input db 8 dup(0) is equivalent to this: Code: input db 0,0,0,0,0,0,0,0 LEA instruction is used to Load Executive Address into a register: Code: LEA ESI,[password] In this ^^^ case ESI will have an address of a 1st byte in 'password'. |
|||
![]() |
|
DOS386 03 Mar 2012, 08:24
> LEA ESI,[password]
> In this ^^^ case ESI will have an address of a 1st byte in 'password' The ZERO'th Byte ![]() LEA makes sense if your buffer is local ... so password translates into something like "EBP+8" for example ... otherwise use MOV: Code: MOV ESI, password ; constant MOV ESI, EAX ; from other register |
|||
![]() |
|
shutdownall 03 Mar 2012, 17:54
Anyway it is not good to store a password in plain text in the program (which maybe watched with a hex editor easily). Better to just store a hash value and compare with a hash value from the input. MD5 is an often used hash mechanism.
|
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.