PDA

View Full Version : Sentinel Superpro SproRead


uku
01-04-2009, 03:48 AM
Hi again. Little while ago I posted a thread on this board and asked a little help to keep exploreing, but unfortunetly did not get any help:( . http://reteam.org/board/showthread.php?t=1281
Perhaps I asked too much.
I am still trying to make reg file in vusbus emulator. Could someone pleas explain why it seems that TORO reads cells 08 and 09 from emulator, but takes data from 00???
result from Toro:
In:> RNBOsproInitialize
Out:> RNBOsproInitialize

In:> RNBOsproFindFirstUnit DeveloperId=XXXX (XxXXX)
Out:> RNBOsproFindFirstUnit DeveloperId=XXXX (XxXXX -> Status=0x3

In:> RNBOsproFindFirstUnit DeveloperId=XXXX (0xXXXX)
Out:> RNBOsproFindFirstUnit DeveloperId=0 (0x0 -> Status=0x0

In:> RNBOsproRead Address=8 (0x8)
Out:> RNBOsproRead Address=8 (0x8) -> Status=0x4
Data=52651 (0xCDAB)

In:> RNBOsproRead Address=9 (0x9)
Out:> RNBOsproRead Address=9 (0x9) -> Status=0x4
Data=52651 (0xCDAB)

In:> RNBOsproSetUnitInfo
Out:> RNBOsproSetUnitInfo

In:> RNBOsproFindNextUnit
Out:> RNBOsproFindNextUnit-> Status=0x3

and what means Status=0x4 (could not find it from board), I know that =0 is OK and =3 is not OK

THANK YOU!!!!!!!!

BfoX
01-04-2009, 05:52 AM
/** SuperPro API error codes. **/
#define SP_SUCCESS 0
#define SP_INVALID_FUNCTION_CODE 1
#define SP_INVALID_PACKET 2
#define SP_UNIT_NOT_FOUND 3
#define SP_ACCESS_DENIED 4
#define SP_INVALID_MEMORY_ADDRESS 5
#define SP_INVALID_ACCESS_CODE 6
#define SP_PORT_IS_BUSY 7
#define SP_WRITE_NOT_READY 8
#define SP_NO_PORT_FOUND 9
#define SP_ALREADY_ZERO 10
#define SP_DRIVER_OPEN_ERROR 11
#define SP_DRIVER_NOT_INSTALLED 12
#define SP_IO_COMMUNICATIONS_ERROR 13
#define SP_PACKET_TOO_SMALL 15
#define SP_INVALID_PARAMETER 16
#define SP_MEM_ACCESS_ERROR 17
#define SP_VERSION_NOT_SUPPORTED 18
#define SP_OS_NOT_SUPPORTED 19
#define SP_QUERY_TOO_LONG 20
#define SP_INVALID_COMMAND 21
#define SP_MEM_ALIGNMENT_ERROR 29
#define SP_DRIVER_IS_BUSY 30
#define SP_PORT_ALLOCATION_FAILURE 31
#define SP_PORT_RELEASE_FAILURE 32
#define SP_ACQUIRE_PORT_TIMEOUT 39
#define SP_SIGNAL_NOT_SUPPORTED 42
#define SP_UNKNOWN_MACHINE 44
#define SP_SYS_API_ERROR 45
#define SP_UNIT_IS_BUSY 46
#define SP_INVALID_PORT_TYPE 47
#define SP_INVALID_MACH_TYPE 48
#define SP_INVALID_IRQ_MASK 49
#define SP_INVALID_CONT_METHOD 50
#define SP_INVALID_PORT_FLAGS 51
#define SP_INVALID_LOG_PORT_CFG 52
#define SP_INVALID_OS_TYPE 53
#define SP_INVALID_LOG_PORT_NUM 54
#define SP_INVALID_ROUTER_FLGS 56
#define SP_INIT_NOT_CALLED 57
#define SP_DRVR_TYPE_NOT_SUPPORTED 58
#define SP_FAIL_ON_DRIVER_COMM 59

#define SP_SERVER_PROBABLY_NOT_UP 60
#define SP_UNKNOWN_HOST 61
#define SP_SENDTO_FAILED 62
#define SP_SOCKET_CREATION_FAILED 63
#define SP_NORESOURCES 64
#define SP_BROADCAST_NOT_SUPPORTED 65
#define SP_BAD_SERVER_MESSAGE 66
#define SP_NO_SERVER_RUNNING 67
#define SP_NO_NETWORK 68
#define SP_NO_SERVER_RESPONSE 69
#define SP_NO_LICENSE_AVAILABLE 70
#define SP_INVALID_LICENSE 71
#define SP_INVALID_OPERATION 72
#define SP_BUFFER_TOO_SMALL 73
#define SP_INTERNAL_ERROR 74
#define SP_PACKET_ALREADY_INITIALIZED 75
#define SP_PROTOCOL_NOT_INSTALLED 76

uku
01-04-2009, 06:13 AM
Thank You BfoX. :)

uku
01-04-2009, 07:47 AM
Me again.
Thanks to BfoX, I understood that the cells access codes in the vusbus reg file were wrong. So I changed the accsess codes on cells from 00 to 07 to "1" - Read-only data word and everything else to "0" - Read/write data word. And the results in Toro:

In:> RNBOsproInitialize
Out:> RNBOsproInitialize

In:> RNBOsproFindFirstUnit DeveloperId=XXXX (XxXXX)
Out:> RNBOsproFindFirstUnit DeveloperId=XXXX (XxXXX -> Status=0x3

In:> RNBOsproFindFirstUnit DeveloperId=XXXX (XxXXX)
Out:> RNBOsproFindFirstUnit DeveloperId=0 (0x0 -> Status=0x0

In:> RNBOsproRead Address=8 (0x8)
Out:> RNBOsproRead Address=8 (0x8) -> Status=0x0
Data=43981 (0xABCD)

In:> RNBOsproRead Address=9 (0x9)
Out:> RNBOsproRead Address=9 (0x9) -> Status=0x0
Data=65535 (0xFFFF)

In:> RNBOsproSetUnitInfo
Out:> RNBOsproSetUnitInfo

In:> RNBOsproFindNextUnit
Out:> RNBOsproFindNextUnit-> Status=0x3

:) But interesting is that I put any value into the cells 08 and 09 and it gives Status=0x0 (Success) ?! Why?
And then starts finding the next unit (next dongle)...
When it checks if the value is correct or not in those cells?

Git
01-04-2009, 08:38 AM
Think about it - how would it know if the cell contents are "correct"?. What is correct is up to the application program, not the driver. All the driver can do is report how it got on trying to read the cell. Chances are it all works fine and it returns 0. If you were silly enough to try to read one of the reserved cells 2..7 then it will return SP_INVALID_MEMORY_ADDRESS. If you removed the dongle between FormatPacket and SproRead then it will return SP_UNIT_NOT_FOUND, etc.

Git

uku
01-04-2009, 09:43 AM
Tnx. Git. My bad- I try to think more next time before I ask. Now I will try to find the sproRead from the software and to study debugging to find out what should be inside the cells 08 and 09.
I still have little difficulties to see the sentinel functions inside application, because when I added all the signatures that I was able to find, but only 2 signatures found some functions: Sentinel SuperPro Lib - Killer_3K (found 1 function)
Sentinel SuperPro C/C++ library by pRT (rev3) (found 5 functions)
Everything else- 0 functions. Then in Name box in IDA I tried to look for typical sspro functions starting with „spro“ I found only 1 function: sproFormatPacket, nothing more =( no sproFindFirstUnit etc.. How could I recognize other 5 functions that were found by signature: Sentinel SuperPro C/C++ library by pRT (rev3)?

Spro Read reads data from cell 08 and 09. Could this part of the code be sproRead? When I NOP-ed out JNZ functions on them the box "Program is loading..." pop-ed up and the program crashed.
First:
00420D4A |> /FFD3 /CALL EBX
00420D4C |> |6A 00 PUSH 0 ; /Arg2 = 00000000
00420D4E |. |68 649D4300 |PUSH 00439D64 ; |Arg1 = 00439D64
00420D53 |. |E8 88FEFFFF |CALL 00420BE0 ; \LocSrv.00420BE0
00420D58 |. |83C4 08 |ADD ESP,8
00420D5B |. |8BD8 |MOV EBX,EAX
00420D5D |. |85C0 |TEST EAX,EAX
00420D5F |.^\75 E9 \JNZ SHORT 00420D4A
Second:
00420D88 |> /43 /INC EBX
00420D89 |> |8A03 MOV AL,[EBX]
00420D8B |. |84C0 |TEST AL,AL
00420D8D |. |74 08 |JE SHORT 00420D97
00420D8F |. |3AD0 |CMP DL,AL
00420D91 |. |74 04 |JE SHORT 00420D97
00420D93 |. |3C 09 |CMP AL,9
00420D95 |.^\75 F1 \JNZ SHORT 00420D88
Thank You in advance.:)