flat assembler
Message board for the users of flat assembler.

Index > Macroinstructions > Help fixing macro ..

Author
Thread Post new topic Reply to topic
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
macro FindKernelBase ,saveadd
{
local blah1
mov eax, [esp]
and eax, 0FFFF0000h
blah1:
cmp dword [eax], 00905A4Dh
je saveadd
sub eax, 1000h
jmp blah1
}


Trying to je to saveadd
Post 25 Feb 2006, 21:54
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
replace "macro FindKernelBase ,saveadd" to "macro FindKernelBase saveadd" (without ",")
Post 25 Feb 2006, 22:31
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
je saveadd
error: invalid operand.
Post 26 Feb 2006, 01:57
View user's profile Send private message Reply with quote
LocoDelAssembly
Your code has a bug


Joined: 06 May 2005
Posts: 4633
Location: Argentina
LocoDelAssembly
Code:
format PE GUI 4.0
entry start

macro FindKernelBase saveadd
{ 
local blah1 
mov eax, [esp] 
and eax, 0FFFF0000h 
blah1: 
cmp dword [eax], 00905A4Dh 
je saveadd 
sub eax, 1000h 
jmp blah1 
}


start:

FindKernelBase aLabel

db "some code"

aLabel:    


Code:
+++++++++++++++++++ ASSEMBLY CODE LISTING ++++++++++++++++++
//********************** Start of Code in Object .flat **************
Program Entry Point = 00401000 (test.exe File Offset:00001400)



//******************** Program Entry Point ********
:00401000 8B0424                  mov eax, dword ptr [esp]
:00401003 250000FFFF              and eax, FFFF0000

* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:00401015(U)
|
:00401008 81384D5A9000            cmp dword ptr [eax], 00905A4D
:0040100E 7410                    je 00401020
:00401010 2D00100000              sub eax, 00001000
:00401015 EBF1                    jmp 00401008
:00401017 736F                    jnb 00401088
:00401019 6D                      insd
:0040101A 6520636F                and byte ptr gs:[ebx+6F], ah
:0040101E 64                      BYTE 064h


:0040101F 65                      BYTE 065h



* Referenced by a (U)nconditional or (C)onditional Jump at Address:
|:0040100E(C)
|
:00401020 00000000000000000000    BYTE 10 DUP(0)    


As you can see it works for me. Did you passed a label as argument?
Post 26 Feb 2006, 04:19
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< 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-2020, Tomasz Grysztar. Also on YouTube, Twitter.

Website powered by rwasa.