Log in

View Full Version : which API?


wbe
December 21st, 2001, 10:00
1. Which API in a program should I trace for checking whether a specific file exists in an (un)specified directory.

2. For .ini manipulation, which API(s) may be used other than Read/WritePrivateProfileStringA?

3. Which API(s) create a file in a directory (CreateFileA?)

Thanks

DakienDX
December 21st, 2001, 11:29
Hello wbe !

If you've searched on the internet instead of posting here, you may have found the following results in the Windows API guide.
The directory doesn't matter. You need to monotor the functions _lopen, OpenFile, CreateFileA and CreateFileW.
Only Read/WriteProfileString, or you need to create a simple .INI file processor yourself. But I' sure this is not what you need.
Well, look at 1., but use _lcreat instead of _lopen.
Look around for WIN32.HLP. It might be 8MB, 12MB or 24MB big. (depending on help file compression)

Solomon
December 21st, 2001, 11:35
1. you can also try FindFirstFileA. If the target OS is WinNT/2K/XP only , programmers can use native API such as ZwCreateFile/NtCreateFile etc, though this is not recommended.

wbe
December 21st, 2001, 17:30
Thanks to you all.

Well, I do have lots of files, tuts, etc. on my HD about "Win32.hlp" but none of them give me the simple yet concise information a beginner needs. I get suffocated inside all those templates, instances and procedures. I think most of them are targeted for developers or for people in the know or may be I do not have the correct files at all.

It is this forum that I always get satisfactory answers to my specific questions from the reverse engineering aspect.

Thanks again.