I've really got stuck and in a vain hope that someone might put me right I've pasted some of the code.
The calls to Sproquery take the form below and repeat about 10 times with only the memory addresses changing. Push 4 and Push 8 remain the same each time.
.text:0047DABD call sproQuery
.text:0047DAC2 test ax, ax
.text:0047DAC5 jnz loc_47DDA4
.text:0047DACB lea ecx, [esp+84h+var_60]
.text:0047DACF push 4
.text:0047DAD1 lea edx, [esp+88h+var_6C]
.text:0047DAD5 push ecx
.text:0047DAD6 lea eax, [esp+8Ch+var_70]
.text:0047DADA push edx
.text:0047DADB push eax
.text:0047DADC push 8
.text:0047DADE push offset unk_598A88
.text:0047DAE3 mov byte ptr [esp+9Ch+var_70], 47h
.text:0047DAE8 mov byte ptr [esp+9Ch+var_70+1], 1
.text:0047DAED mov byte ptr [esp+9Ch+var_70+2], 0B7h
.text:0047DAF2 mov byte ptr [esp+9Ch+var_70+3], 22h
.text:0047DAF7 call sproQuery
.text:0047DAFC test ax, ax
.text:0047DAFF jnz loc_47DDA4
........................................................................etc.
At the end of the 10 calls some CMP are used.
Inside Sproquery we have:
.text:004ED2E0 push ebx
.text:004ED2E1 push esi
.text:004ED2E2 push edi
.text:004ED2E3 mov eax, [esp+arg_0]
.text:004ED2E7 or eax, eax
.text:004ED2E9 jnz short loc_4ED2F5
.text:004ED2EB mov ax, 2
.text:004ED2EF pop edi
.text:004ED2F0 pop esi
.text:004ED2F1 pop ebx
.text:004ED2F2 retn 18h
.text:004ED2F5 ; ---------------------------------------------------------------------------
.text:004ED2F5
.text:004ED2F5 loc_4ED2F5: ; CODE XREF: sproQuery+9j
.text:004ED2F5 push eax
.text:004ED2F6 call sub_4E6B60
.text:004ED2FB mov esi, eax
.text:004ED2FD cmp word ptr [esi], 7242h
.text:004ED302 jz short loc_4ED310
.text:004ED304 mov ax, 2
.text:004ED308 pop edi
.text:004ED309 pop esi
.text:004ED30A pop ebx
.text:004ED30B retn 18h
.text:004ED30B ; ---------------------------------------------------------------------------
.text:004ED30E align 4
.text:004ED310
.text:004ED310 loc_4ED310: ; CODE XREF: sproQuery+22j
.text:004ED310 test byte ptr [esi+12h], 4
.text:004ED314 jnz short loc_4ED326
.text:004ED316 mov word ptr [esi+6], 0B39h
.text:004ED31C mov ax, 39h
.text:004ED320 pop edi
.text:004ED321 pop esi
.text:004ED322 pop ebx
.text:004ED323 retn 18h
.text:004ED326 ; ---------------------------------------------------------------------------
.text:004ED326
.text:004ED326 loc_4ED326: ; CODE XREF: sproQuery+34j
.text:004ED326 mov eax, [esp+arg_8]
.text:004ED32A or eax, eax
.text:004ED32C jnz short loc_4ED340
.text:004ED32E mov word ptr [esi+6], 410h
.text:004ED334 mov ax, 10h
.text:004ED338 pop edi
.text:004ED339 pop esi
.text:004ED33A pop ebx
.text:004ED33B retn 18h
.text:004ED33B ; ---------------------------------------------------------------------------
.text:004ED33E align 4
.text:004ED340
.text:004ED340 loc_4ED340: ; CODE XREF: sproQuery+4Cj
.text:004ED340 mov bx, [esp+arg_14]
.text:004ED345 cmp bx, 38h
.text:004ED349 jbe short loc_4ED35B
.text:004ED34B mov word ptr [esi+6], 414h
.text:004ED351 mov ax, 14h
.text:004ED355 pop edi
.text:004ED356 pop esi
.text:004ED357 pop ebx
.text:004ED358 retn 18h
.text:004ED35B ; ---------------------------------------------------------------------------
.text:004ED35B
.text:004ED35B loc_4ED35B: ; CODE XREF: sproQuery+69j
.text:004ED35B lea edi, [esi+3Ch]
.text:004ED35E push ebx
.text:004ED35F push edi
.text:004ED360 push eax
.text:004ED361 call sub_4E6B30
.text:004ED366 mov word ptr [esi+30h], 10h
.text:004ED36C mov ax, [esp+arg_4]
.text:004ED371 mov [esi+34h], ax
.text:004ED375 mov [esi+36h], bx
.text:004ED379 push esi
.text:004ED37A call sub_4EB6D0
.text:004ED37F or al, al
.text:004ED381 jnz short loc_4ED3C0
.text:004ED383 mov eax, [esp+arg_C]
.text:004ED387 or eax, eax
.text:004ED389 jz short loc_4ED39C
.text:004ED38B push ebx
.text:004ED38C push eax
.text:004ED38D push edi
.text:004ED38E call sub_4E6B30
.text:004ED393 push ebx
.text:004ED394 push 0
.text:004ED396 push edi
.text:004ED397 call sub_4E6C30
.text:004ED39C
.text:004ED39C loc_4ED39C: ; CODE XREF: sproQuery+A9j
.text:004ED39C mov eax, [esp+arg_10]
.text:004ED3A0 or eax, eax
.text:004ED3A2 jz short loc_4ED3B0
.text:004ED3A4 mov ecx, [esi+38h]
.text:004ED3A7 mov [eax], ecx
.text:004ED3A9 mov dword ptr [esi+38h], 0
.text:004ED3B0
.text:004ED3B0 loc_4ED3B0: ; CODE XREF: sproQuery+C2j
.text:004ED3B0 ; sproQuery+EEj
.text:004ED3B0 mov ax, [esi+6]
.text:004ED3B4 push eax
.text:004ED3B5 call sub_4EC520
.text:004ED3BA pop edi
.text:004ED3BB pop esi
.text:004ED3BC pop ebx
.text:004ED3BD retn 18h
.text:004ED3C0 ; ---------------------------------------------------------------------------
.text:004ED3C0
.text:004ED3C0 loc_4ED3C0: ; CODE XREF: sproQuery+A1j
.text:004ED3C0 mov ax, [esi+6]
.text:004ED3C4 push eax
.text:004ED3C5 call sub_4EC520
.text:004ED3CA cmp ax, 0Ch
.text:004ED3CE jnz short loc_4ED3B0
.text:004ED3D0 mov ax, 3
.text:004ED3D4 pop edi
.text:004ED3D5 pop esi
.text:004ED3D6 pop ebx
.text:004ED3D7 retn 18h
.text:004ED3D7 sproQuery endp
.text:004ED3D7
.text:004ED3D7 ; ---------------------------------------------------------------------------
I assume that the dongle call is at 004ED37A with the returned dongle word in EAX at 004ED383 ?
What exactly should I be looking for as the input and output in Sproquery?
Sorry for being such a lamer.