News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Jump table question

Started by donkey, April 28, 2011, 08:56:19 PM

Previous topic - Next topic

FlySky

Donkey you're doing exceptional work here man.

I noticed you mentioned BEAEngine I recentrly started experimenting with trying to disassemble some of my own code.

Although I can't get BEAEngine working at all I was wondering how you managed to get it running properly.

The documentation on his websites show a little example on how to use it with GoASM.

Using BeaEngine with GoAsm

Below is a paste from his website.

#include BeaEngineGoAsm.inc --> no problem here
Disasm = BeaEngine.lib:Disasm --> no problem here

.data
   
    MyDisasm       _Disasm      <>   --> This structure is not recognized by GoASM and is kinda causing the first problems.
    szoutofblock    db           "Security alert. Disasm tries to read unreadable memory",0
    i               db            100
.code

start:

    ; *********************** Init EIP
    mov eax, offset start
    mov [MyDisasm.EIP], eax

    ; *********************** loop for disasm
MakeDisasm:
    push offset MyDisasm
    call Disasm
    cmp eax, OUT_OF_BLOCK
    jne >
        push offset szoutofblock
        call puts                          --> this call is not in any of the object files I added to my project. In his package I picked the BEAEngine.lib (384 kb) and the BEAEngineGoASM32.inc --> I know on the include above it points to GoASM and not GoASM32
        add esp, 4
        push 0
        call ExitProcess
    :
    cmp eax, UNKNOWN_OPCODE
    jne >
        inc d[MyDisasm.EIP]   --> structure not recognized
        jmp Display
    :
        add [MyDisasm.EIP], eax
Display:       
    push offset MyDisasm.CompleteInstr
    call puts                           
    add esp, 4
    dec b
    jne MakeDisasm
    push 0
    call ExitProcess

and I get compiling errors about symbols not found in object files:

MyDisasm.Eip
puts
strlen
strcpy
memset
sprintf

You know of any other documentation?




dedndave

QuoteThe documentation on his websites show a little example on how to use it with GoASM

HER site   :bg
Beatrix, as i recall

FlySky

Dedndave,

You are right. The example I posted above is from his website.

and the only documentation I could find on his website about using it with GoASM.

Weird thing the includes work etc.., but it still says certain symbols en structures can't be recognized. It's either me missing some symbols in my project or
the example on his website isn't complete. That's why I was wondering if someone tried it before and if there is any more documentation.

dedndave

Quote from: FlySky on July 30, 2011, 04:09:33 PM
Dedndave,

You are right. The example I posted above is from his website.

and the only documentation I could find on his website about using it with GoASM.

Weird thing the includes work etc.., but it still says certain symbols en structures can't be recognized. It's either me missing some symbols in my project or
the example on his website isn't complete. That's why I was wondering if someone tried it before and if there is any more documentation.

:bg
Beatrix is a lady
Edgar is the guy to talk to (donkey) - he plays with GoAsm a lot and probably has experience with her lib
or, maybe Beatrix, herself
she is a forum member and pops in from time-to-time
her site probably has an email addy

dedndave

beaengine gmail.com

replace the space with @

FlySky

oo a lady you say huh, offcourse I should have noticed that. We've got a queen with that name :lol

dedndave

oh - you're a Nederlander ?

FlySky

Yeah I am dutch aka a Nederlander :U you aswell?? I will wait for Edgar to pop up, and mainwhile trying to get it working, will post the solution to my findings aswell if I figure it out.

dedndave

no - i am not Dutch
well, way back in my ancestory you will find what was known as "German Dutch"

FlySky

#54
I've fixed the issue.

There is actually 1 issue that I had to change.

1. You need to link msvcrt.dll like this:

;this links in necessary imports
#DEFINE LINKFILES
#DynamicLinkFile msvcrt.dll

With this included the example program listed on the website compiles fine in GoASM

This is mentioned by E^Cube about a year ago. In this topic: http://www.masm32.com/board/index.php?topic=13686.30

*UPDATED*
With link to answer E^Cube posted a year ago.