Function at 0x1003e4e6
Capabilities:
Get common file path
Set environment variable

Disassembly:
mov ecx, dword [esp + 0x20]
push str.systemdir
sbb dl, byte [ecx]
adc byte [ecx + 0x55], dl
lea ecx, [esp + 0x24]
call fcn.10041729
cmp eax, ebp
jne 0x1003e582
push 0x104
lea edx, [esp + 0xe4]
push edx
call dword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
test eax, eax
je 0x1003e799
mov al, byte [esp + 0x13]
sub esp, 0x10
mov ebp, esp
mov dword [esp + 0x34], esp
push 0
mov ecx, ebp
mov byte [ebp], al
call fcn.10040508
or ecx, 0xffffffff
xor eax, eax
lea edi, [esp + 0xf0]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
push 1
push ebx
mov ecx, ebp
call fcn.100407ef
test al, al
je 0x1003e628
mov edi, dword [ebp + 4]
mov ecx, ebx
xor eax, eax
mov edi, str.tempdir
mov ecx, ebx
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x1c]
not ecx
dec ecx
push ecx
push str.tempdir
push eax
push ebp
lea ecx, [esp + 0x24]
call fcn.100417d4
cmp eax, ebp
jne 0x1003e650
lea ecx, [esp + 0xe0]
push ecx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
test eax, eax
je 0x1003e799
mov dl, byte [esp + 0x13]
sub esp, 0x10
mov ebp, esp
mov dword [esp + 0x34], esp
push 0
mov ecx, ebp
mov byte [ebp], dl
call fcn.100405b3
or ecx, 0xffffffff
xor eax, eax
lea edi, [esp + 0xf0]
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebx, ecx
push 1
push ebx
mov ecx, ebp
call fcn.1004089a
test al, al
je 0x1003e628
mov edi, dword [ebp + 4]
mov ecx, ebx
mov eax, ecx
shr ecx, 2
lea esi, [esp + 0xf0]
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov dword [ebp + 8], ebx
mov ebp, dword [ebp + 4]
add ebp, ebx
mov byte [ebp], 0
mov esi, dword [esp + 0x208]
push esi
call 0x1007ce45
push 1
lea ecx, [esp + 0x18]
mov dword [esp + 0x1f4], 0xffffffff
call fcn.1004061d
jmp 0x1007ce41
xor eax, eax
mov edi, str.direct3d7
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
mov ecx, dword [esp + 0x20]
push str.direct3d7
push ecx
push ebp
lea ecx, [esp + 0x24]
call fcn.100418a2
cmp eax, ebp
jne 0x1003e698
mov eax, dword [esi + 0x10]
cmp eax, ebp
je 0x1003e799
mov edx, dword [eax + 8]
mov esi, dword [esp + 0x1f8]
push edx
push esi
call fcn.10094473
jmp 0x1007c6b6
xor eax, eax
mov edi, str.direct3ddevice7
mov ecx, ebx
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x1c]
not ecx
dec ecx
push ecx
push str.direct3ddevice7
push eax
push ebp
lea ecx, [esp + 0x24]
call fcn.100418ea
test eax, eax
jne 0x1003e6e6
mov eax, dword [esi + 0x10]
cmp eax, ebp
je 0x1003e799
mov ecx, dword [eax + 0xc]
mov esi, dword [esp + 0x1f8]
push ecx
push esi
call fcn.100944bb
mov ecx, dword [esp + 0x18]
cmp ecx, ebp
jmp 0x1007ceb9
mov edx, dword [esp + 0x1c]
xor eax, eax
mov edi, str.directdraw7
mov ecx, ebx
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
cmp edx, ebp
mov ecx, edx
jb 0x1003e702
mov ecx, ebp
mov ebx, dword [esp + 0x18]
mov edi, str.directdraw7
mov esi, ebx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x1003e718
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x1003e739
cmp edx, ebp
jb 0x1003e739
cmp edx, ebp
setne al
test eax, eax
jne 0x1003e739
mov edx, dword [esp + 0x28]
mov eax, dword [edx + 0x10]
test eax, eax
je 0x1003e799
mov eax, dword [eax]
push eax
jmp 0x1003e784
dec ebx
or ecx, 0xffffffff
xor eax, eax
mov edi, str.directinput7
repne scasb al, byte es:[edi]
not ecx
dec ecx
mov ebp, ecx
cmp edx, ebp
mov ecx, edx
jb 0x1003e752
mov ecx, ebp
mov edi, str.directinput7
mov esi, ebx
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
je 0x1003e764
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x1003e799
cmp edx, ebp
jb 0x1003e799
cmp edx, ebp
setne al
test eax, eax
jne 0x1003e799
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + 0xc]
test eax, eax
je 0x1003e799
mov edx, dword [eax + 4]
push edx
mov esi, dword [esp + 0x1fc]
push esi
call fcn.10094571
mov ecx, dword [esp + 0x18]
test ecx, ecx
jmp 0x1003e7d3
mov esi, dword [esp + 0x1f8]
mov al, byte [esp + 0x13]
xor ebx, ebx
or ecx, 0xffffffff
mov byte [esi], al
xor eax, eax
mov dword [esi + 4], ebx
mov dword [esi + 8], ebx
mov dword [esi + 0xc], ebx
mov edi, 0x1012ace8
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push 0x1012ace8
mov ecx, esi
call fcn.100409cd
mov ecx, dword [esp + 0x18]
cmp ecx, ebx
je 0x1003e7f1
mov al, byte [ecx - 1]
test al, al
je 0x1003e7e7
cmp al, 0xff
je 0x1003e7e7
dec al
mov byte [ecx - 1], al
jmp 0x1003e7f1
dec ecx
push ecx
call fcn.100cb7c7
add esp, 4
mov ecx, dword [esp + 0x1e8]
pop edi
mov eax, esi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x1e4
ret 8
sbb eax, 0x101004b8
mov dword [esi + 0x254], ecx
fnstsw ax
test ah, 0x40
jne 0x1007c6f3
fld dword [esp + 4]
fcomp dword [esi + 0x250]
fnstsw ax
test ah, 0x40
jne 0x1007c6f3
fld dword [esp + 4]
fsub dword [esi + 0x250]
fmul dword [esp + 0xc]
fadd dword [esi + 0x250]
fstp dword [esi + 0x254]
fld dword [esi + 0x254]
pop esi
fcomp dword [0x10100498]
fnstsw ax
test ah, 0x41
jne 0x1007c710
mov eax, 1
pop ecx
invalid
invalid
test eax, eax
je 0x1007ce49
mov esi, dword [ecx]
mov dword [eax], esi
add ecx, 4
add eax, 4
cmp ecx, edx
jne 0x1007ce41
pop esi
ret 0xc
add al, 0x10
adc cl, bl
sbb eax, 0x10132908
ret