I need some help translatin this ...

typedef struct _MIB_TCPROW_EX
{
DWORD dwState; // MIB_TCP_STATE_*
DWORD dwLocalAddr;
DWORD dwLocalPort;
DWORD dwRemoteAddr;
DWORD dwRemotePort;
DWORD dwProcessId;
} MIB_TCPROW_EX, *PMIB_TCPROW_EX;

typedef struct _MIB_TCPTABLE_EX
{
DWORD dwNumEntries;
MIB_TCPROW_EX table;
} MIB_TCPTABLE_EX, *PMIB_TCPTABLE_EX;

void main(void)
{
....
PMIB_TCPTABLE_EX TcpTable;
....


I tried:


MIB_TCPEXROW? ? ? ?STRUCT
? dwState? ? ? ? ? ?DWORD ?
? dwLocalAddr? ? ? ?DWORD ?
? dwLocalPort? ? ? ?DWORD ?
? dwRemoteAddr? ? ? DWORD ?
? dwRemotePort? ? ? DWORD ?
? dwProcessId? ? ? ?DWORD ?? ? ? ? ? ? ?
MIB_TCPEXROW? ? ? ?ENDS

PMIB_TCPEXROW? ? ? MIB_TCPEXROW <?>


MIB_TCPEXTABLE? ? ?STRUCT
? dwNumEntries? ? ? DWORD ?
? table? ? ? ? ? ? ?MIB_TCPEXROW <>
MIB_TCPEXTABLE? ? ?ENDS?

PMIB_TCPEXTABLE? ? MIB_TCPEXTABLE <?>

?and now?

PMIB_TCPTABLE_EX TcpTable; <- ??

i tried:

TcpTable? PMIB_TCPEXTABLE <> <-? fails
TcpTable? PMIB_TCPEXTABLE <?> <-? fails

?How i can do this? Thanx in advance and excuse my poor english.


Posted on 2005-05-19 08:29:03 by hunter
Check madwizard.org, his nettool example should have what you're looking for.
Posted on 2005-05-19 08:49:06 by Webring
that example has not helped to me....

ideas?
Posted on 2005-05-20 05:11:21 by hunter
hunter,

If you want assembler from C code and its ANSI compatible, shove it through a Microsoft C compiler with the ASM output option. Its no jy to read but it will build in MASM with a little fiddling.
Posted on 2005-05-20 08:49:39 by hutch--
well if you want you may try looking at masmplugin sdk by eviloid for ollydbg
he has converted the whole plugin.h to plugin.inc?
you may get a lot of pointers in struct conversions like what you are seeking

small comparison

typedef struct t_hexstr {              // String used for hex/text search
  int            n;                    // String length
  uchar          data;        // Data
  uchar          mask;        // Mask, 0 bits are masked
} t_hexstr;


t_hexstr struc 1    ; String used for hex/text search
        n          dword      ?                  ; String length
        data        byte        TEXTLEN dup (?)    ; Data
        mask_      byte        TEXTLEN dup (?)    ; Mask, 0 bits are masked
t_hexstr ends


ollydbg.win32asmcommunity.net/stuph?

it is for 1.08 version so you should get relevent plugin sdk from ollydbgs site if you wish to compare them
home.t-online.de/home/ollydbg
Posted on 2005-05-20 09:32:10 by bluffer
omg - dude, I'll teach you to convert structs. I can't believe that nobody has offered to explain how to convert the datatypes.
PM me via this board :)
Posted on 2005-05-21 05:24:28 by Homer
void main(void)
{
....
PMIB_TCPTABLE_EX TcpTable;
....


No one knows how to translate this?



Posted on 2005-05-23 04:49:02 by hunter
hunter,

It looks like an structure set as a LOCAL. What you need is to find the C/C++ structure and post that them someone can probably help you.
Posted on 2005-05-23 22:48:21 by hutch--
PMIB_TCPTABLE_EX is a pointer to a  MIB_TCPTABLE_EX structure. So TcpTable is a pointer to a MIB_TCPTABLE_EX structure.
Posted on 2005-05-23 23:19:21 by Greg