Function at 0x402f8d
Capabilities:
Get common file path
Query environment variable

Disassembly:
push 0x520
mov eax, 0x40a7c1
call fcn.0040985c
test byte [0x45d194], 1
mov eax, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
mov dword [ebp - 0x52c], eax
mov ebx, 0x45d190
jne 0x402fd8
or dword [0x45d194], 1
and dword [ebp - 4], 0
mov ecx, ebx
call dword [sym.imp.mfc100.dll_Ordinal_316]
push 0x40aa80
call fcn.0040999c
pop ecx
or dword [ebp - 4], 0xffffffff
or dword [ebp - 0x528], 0xffffffff
xor eax, eax
mov dword [ebp - 0x51c], eax
mov dword [ebp - 0x524], eax
cmp dword [0x45d18c], eax
jne 0x4030ed
mov esi, 0x400
push esi
lea eax, [ebp - 0x410]
push eax
push str.DPTRACE
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
test eax, eax
je 0x40302d
cmp eax, esi
jae 0x40302d
lea eax, [ebp - 0x410]
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
pop ecx
mov dword [ebp - 0x51c], eax
lea eax, [ebp - 0x528]
push eax
push str.Trace
call fcn.00404730
pop ecx
pop ecx
test eax, eax
jle 0x403054
mov eax, dword [ebp - 0x528]
test eax, eax
js 0x403054
mov dword [ebp - 0x524], eax
and dword [ebp - 0x520], 0
push 2
push str.Level
push str.SoftwareSAPSAPGUITrace
lea eax, [ebp - 0x520]
push eax
call sub.sapfewut.dll_GetRegValInt
mov eax, dword [ebp - 0x520]
cmp eax, dword [ebp - 0x524]
jbe 0x403087
mov dword [ebp - 0x524], eax
cmp dword [0x45d188], 0
jne 0x4030cb
lea eax, [ebp - 0x518]
push eax
call sub.sapfewut.dll_InitBuffer
lea eax, [ebp - 0x518]
push eax
call sub.sapfewut.dll_InitTraceDir
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push dword [0x45d184]
lea eax, [ebp - 0x518]
push eax
push str._s_sapguiexe__.2d__.4d.trc
push ebx
call dword [sym.imp.mfc100.dll_Ordinal_4283]
add esp, 0x14
mov eax, dword [edi]
cmp eax, dword [ebp - 0x51c]
ja 0x4030db
mov eax, dword [ebp - 0x51c]
mov dword [edi], eax
cmp eax, dword [ebp - 0x524]
ja 0x4030eb
mov eax, dword [ebp - 0x524]
mov dword [edi], eax
mov eax, dword [edi]
cmp eax, dword [0x45d188]
jbe 0x403222
push eax
call fcn.00404930
xor esi, esi
pop ecx
cmp dword [0x45d188], esi
jbe 0x403111
or eax, 0x20000
push esi
push eax
push dword [0x45d190]
call sub.sapfewtr.dll_FEWTraceInit
add esp, 0xc
mov dword [0x45d0e4], eax
cmp dword [0x45d188], esi
jne 0x4031b2
lea ecx, [ebp - 0x51c]
call dword [sym.imp.mfc100.dll_Ordinal_316]
mov dword [ebp - 4], 1
mov esi, 0x104
push esi
lea ecx, [ebp - 0x51c]
call dword [sym.imp.mfc100.dll_Ordinal_4498]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetCurrentDirectoryA]
push dword [ebp - 0x52c]
lea ecx, [ebp - 0x520]
call dword [sym.imp.mfc100.dll_Ordinal_310]
mov byte [ebp - 4], 2
lea eax, [ebp - 0x51c]
push eax
lea eax, [ebp - 0x520]
push eax
push dword [edi]
call fcn.00401850
add esp, 0xc
mov byte [ebp - 4], 1
lea ecx, [ebp - 0x520]
call dword [sym.imp.mfc100.dll_Ordinal_901]
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x51c]
call dword [sym.imp.mfc100.dll_Ordinal_901]
mov eax, dword [0x45d0e4]
test eax, eax
jne 0x4031ba
xor ecx, ecx
jmp 0x4031bc
mov ecx, dword [eax]
mov esi, str.Init_Trace
test cl, 4
je 0x4031d4
push esi
push eax
call sub.sapfewtr.dll_FEWTraceMonitor
mov eax, dword [0x45d0e4]
pop ecx
pop ecx
test eax, eax
jne 0x4031dc
xor ecx, ecx
jmp 0x4031de
mov ecx, dword [eax]
test cl, 6
je 0x4031f9
push dword [edi]
push esi
push str._s:_Trace_level_set_to:__d
push eax
call sub.sapfewtr.dll_FEWTraceWarning
mov eax, dword [0x45d0e4]
add esp, 0x10
test eax, eax
jne 0x403201
xor ecx, ecx
jmp 0x403203
mov ecx, dword [eax]
test cl, 4
je 0x403211
push esi
push eax
call sub.sapfewtr.dll_FEWTraceMonitor
pop ecx
pop ecx
mov eax, dword [edi]
mov dword [0x45d188], eax
mov dword [0x45d18c], 1
call fcn.004098a6
ret