Log in

View Full Version : adding functionality


qweasdzxc
September 15th, 2003, 13:08
NTE's QUICKCrossTM is a freeware program released by NTE electronics, It cross-references industry part numbers (for semiconductors) to NTE part numbers, It also passes as a cataloge for the company. I use this program at work and had to crack my copy to quit displaying a nag screen (about age of program, and possibilty of updates) after it was a year old.

I find this program very usefull, but it wastes a lot of my time... For instance, The bad part I just took out of a tv is a 2SD1555, it crosses to a NTE2331, But I don't have one of those.... But maybe another common part crosses to the NTE number, like a 2SD1879... As it is, I have to remember a list of other numbers, and try one at a time to find a match.

I want to be able to enter an NTE number, and find industry numbers that cross; not just the NTE descriptions.

Has anyone here done anything similar to this? Or do you guys know of any tutes dealing with adding search abilities to a database?

Also, Where the hell would I start?

squidge
September 15th, 2003, 17:57
Is this all in a single file, or does it use a database, etc? Also, is there a place to download this from?

ZaiRoN
September 15th, 2003, 18:16
Hi,
qweasdzxc: squidge is right, we need mch more information about the program. Tell us all the information you have about the database.

squidge: you have the name of the program...

qweasdzxc
September 15th, 2003, 23:06
I did have a link up here, some one deleted the post! any way, it's a single file download.

The program installs an NTE.DAT file in it's dir. I figure that the database is inside the .Dat I have found the section of code inside nte.exe that reads the MessageBoxA ... its a loop at 00455EC8.

If you look up a partial number like 1543 you might get a list like

131543 crosses to NTE161
1543-00 crosses to NTE519
1N1543 crosses to NTE5840

If you look up an NTE161 you get a list like this...

NTE161 crosses to NTE161
NTE1610 crosses to NTE1610
NTE1611 crosses to NTE1611

I order alot of NTE parts, but sometimes I may be out of something by the NTE number, but have it in an industry number. I really need a way to do a reverse lookup and get the equipment fixed now, rather than wait a week for me to have enough parts for a minimum order. I waste about 3-4 hours a week on these reverse searches.

I don't know where to start... this is above my head, but I need something like this to work.

peterg70
September 16th, 2003, 02:59
I know this sounds silly but what you need to do is the following.

Find the data storage system and try to decipher it.

If its a DBF/MDB etc then you can edit it directly and make mods.

If the data is stored inside an dat file try to read the file in a HEX editor to see if its visible. Or else it might be stored in binary. Then disassemble the file and look for references for reading the file. Use Filemon to examine how the file is read in by your program.

Once you have found the database all you need to do is copy all the data and reverse it. Then add it back to the database.

Assume that currently you have
131543 = NTE161

Then if you reverse the line and add it back to the database.
NTE161 = 131543

Then when you type NTE161 it will find all matching info.

Just a thought.

qweasdzxc
September 16th, 2003, 10:38
Quote:
Originally posted by peterg70
I know this sounds silly but what you need to do is the following.

Find the data storage system and try to decipher it.


This makes sense to me, But if I reverse the database, wouldn't that ruin any forward lookups?

I looked at the .dat file last night, it's about 4.5 megs of gibberish! I see part numbers all lumped together, I can't make heads or tails of it right now. I'll try filemon on it after work today.

naides
September 16th, 2003, 15:14
The extension .DAT
corresponds to

Btrieve Database

Which might be the database format used by your freeware app.

Search for Btrieve applications and see if it can open and read your database files.

Iwarez
September 16th, 2003, 17:29
Maybe you can attach the first 100 bytes of the file. I work everyday with btrieve databases and can tell you wheter it's one or not. BTW .Dat is not the standard extension for btrieve databases. It's MKD, commonly renamed to BTV or BTR.

naides
September 16th, 2003, 19:30
I looked for database related software which uses .dat extensions and found Btrieve at

hxxp://www.uktsupport.co.uk/reference/fext/fextd.htm

which may be or not useful.

I did not intend to mislead qw, just giving him a lead to try. I have not worked with Btrieve databases

qweasdzxc
September 16th, 2003, 20:06
NTE.DAT the main datebase I'm interested in, it's the list of industry numbers... But some of the entries start with -'s part numbers don't normaly start with -. but the format I have seen so far is partnumber.partnumber.partnumber.ect...

NTELNK.DAT is about 110KB it looks like a list of NTE numbers crossed to .pdf files, in this program you can download pdf files for indepth part descriptions, and conveniently, the program gives you a direct link for all parts that have a pdf available.
format is .^/specs/100to199/pdf/nte116.^.^/specs/1100to1199/pdf/nte1161.^/specs/1100to1199/pdf/nte1162.^/specs/1100to1...........

NTE.CMT is full of short descriptions for the parts, these descriptions are displayed when you do a search and select a part. ie. T-NPN,SIHI VLTG HORIZ SWITCH W/ DAMPER

I looked into btrieve, but I don't think that it's the case in this prog. In all of the programing I've ever done .dat was just a data file, It could be anything, These lists, like naides link are really inaccurate, but helpfull in figuring out what files you might need to backup, or get rid of.

I used filemon on this. I found that both NTE.DAT and NTELNK.DAT are read into memory upon the start of the program, I didn't see anything unusual though. I found out more with a Hex editor and the various NTE*.* files.


Iwarez, Here is the first section of the Dat file. I included up to the first part numbers in the table.

qweasdzxc
September 16th, 2003, 20:15
I think this is the important section in the exe. This section is responsible for program I/O flow. The error message you get if your search crosses to over 200 parts, is apperantly prompted by checking a few bits (flags?). Depending on which bits are set, this section of code will display search results, or different error messages.

00455EC8 /$ 53 PUSH EBX
00455EC9 |. 56 PUSH ESI
00455ECA |. 57 PUSH EDI
00455ECB |. 51 PUSH ECX
00455ECC |. 8BFA MOV EDI,EDX
00455ECE |. 8BF0 MOV ESI,EAX
00455ED0 |. 33DB XOR EBX,EBX
00455ED2 |. 6A 01 PUSH 1 ; /RemoveMsg = PM_REMOVE
00455ED4 |. 6A 00 PUSH 0 ; |MsgFilterMax = WM_NULL
00455ED6 |. 6A 00 PUSH 0 ; |MsgFilterMin = WM_NULL
00455ED8 |. 6A 00 PUSH 0 ; |hWnd = NULL
00455EDA |. 57 PUSH EDI ; |pMsg = 0012FF74
00455EDB |. E8 1029FBFF CALL <JMP.&user32.PeekMessageA> ; \PeekMessageA
00455EE0 |. 85C0 TEST EAX,EAX ; checks MessageBoxA for user input.
00455EE2 |. 74 75 JE SHORT nte02.00455F59
00455EE4 |. B3 01 MOV BL,1
00455EE6 |. 837F 04 12 CMP DWORD PTR DS:[EDI+4],12
00455EEA |. 74 66 JE SHORT nte02.00455F52
00455EEC |. C60424 00 MOV BYTE PTR SS:[ESP],0
00455EF0 |. 66:83BE C2000>CMP WORD PTR DS:[ESI+C2],0
00455EF8 |. 74 10 JE SHORT nte02.00455F0A
00455EFA |. 8BCC MOV ECX,ESP
00455EFC |. 8BD7 MOV EDX,EDI
00455EFE |. 8B86 C4000000 MOV EAX,DWORD PTR DS:[ESI+C4]
00455F04 |. FF96 C0000000 CALL NEAR DWORD PTR DS:[ESI+C0]
00455F0A |. 8BD7 MOV EDX,EDI
00455F0C |. 8BC6 MOV EAX,ESI
00455F0E |. E8 19FFFFFF CALL nte02.00455E2C
00455F13 |. 84C0 TEST AL,AL
00455F15 |. 75 42 JNZ SHORT nte02.00455F59
00455F17 |. 803C24 00 CMP BYTE PTR SS:[ESP],0
00455F1B |. 75 3C JNZ SHORT nte02.00455F59
00455F1D |. 8BD7 MOV EDX,EDI
00455F1F |. 8BC6 MOV EAX,ESI
00455F21 |. E8 FEFDFFFF CALL nte02.00455D24
00455F26 |. 84C0 TEST AL,AL
00455F28 |. 75 2F JNZ SHORT nte02.00455F59
00455F2A |. 8BD7 MOV EDX,EDI
00455F2C |. 8BC6 MOV EAX,ESI
00455F2E |. E8 41FEFFFF CALL nte02.00455D74
00455F33 |. 84C0 TEST AL,AL
00455F35 |. 75 22 JNZ SHORT nte02.00455F59
00455F37 |. 8BD7 MOV EDX,EDI
00455F39 |. 8BC6 MOV EAX,ESI
00455F3B |. E8 C0FDFFFF CALL nte02.00455D00
00455F40 |. 84C0 TEST AL,AL
00455F42 |. 75 15 JNZ SHORT nte02.00455F59
00455F44 |. 57 PUSH EDI ; /pMsg = WM_QUIT ExitCode = 0
00455F45 |. E8 362AFBFF CALL <JMP.&user32.TranslateMessage> ; \TranslateMessage
00455F4A |. 57 PUSH EDI ; /pMsg = WM_QUIT ExitCode = 0
00455F4B |. E8 5825FBFF CALL <JMP.&user32.DispatchMessageA> ; \DispatchMessageA
00455F50 |. EB 07 JMP SHORT nte02.00455F59
00455F52 |> C686 8C000000>MOV BYTE PTR DS:[ESI+8C],1
00455F59 |> 8BC3 MOV EAX,EBX
00455F5B |. 5A POP EDX ;user32.D016F1
00455F5C |. 5F POP EDI ;user32.D016F1
00455F5D |. 5E POP ESI ;user32.D016F1
00455F5E |. 5B POP EBX ;user32.D016F1
00455F5F \. C3 RETN