Function at 0x409140
Capabilities:
Get common file path
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41e058
push 0x41ade0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x15cc
call fcn.0041adb0
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
mov al, byte [0x423714]
test al, al
je 0x40985d
mov byte [0x423714], 0
mov eax, dword [ebp + 8]
mov ecx, dword [eax]
mov dword [ebp - 0x8e0], ecx
mov ebx, dword [eax + 4]
mov dword [ebp - 0x74c], ebx
mov ecx, 0x82
xor eax, eax
lea edi, [ebp - 0x63c]
rep stosd dword es:[edi], eax
push 0x206
lea edx, [ebp - 0x63c]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
ja 0x4091d0
push str.Unknown
lea eax, [ebp - 0x63c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea edi, [ebp - 0x63c]
lea edx, [ebp - 0x434]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edx, [ebp - 0x434]
mov edi, str..Err.Log
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push eax
push 0x80000080
push 2
push eax
push eax
push 0x40000000
lea eax, [ebp - 0x434]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
mov dword [ebp - 0x124], esi
cmp esi, 0xffffffff
jne 0x409265
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ecx, 0x82
xor eax, eax
lea edi, [ebp - 0xdf8]
rep stosd dword es:[edi], eax
mov dword [ebp - 0x748], str.Unknown
push 0x1c
lea ecx, [ebp - 0x1124]
push ecx
mov edx, dword [ebx + 0xb8]
push edx
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
test eax, eax
je 0x4092d7
push 0x206
lea eax, [ebp - 0xdf8]
push eax
mov ecx, dword [ebp - 0x1120]
push ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
test eax, eax
jbe 0x4092d7
lea edx, [ebp - 0xdf8]
push edx
call fcn.0040b810
add esp, 4
mov dword [ebp - 0x748], eax
mov edi, dword [ebp - 0x8e0]
mov eax, dword [edi]
mov ecx, dword [ebx + 0xb8]
push ecx
mov edx, dword [ebx + 0xbc]
push edx
mov ecx, dword [ebp - 0x748]
push ecx
push eax
push eax
call fcn.0040b620
add esp, 4
push eax
lea edx, [ebp - 0x63c]
push edx
push str._s_caused__s__0x_08x___r_nin_module__s_at__04x:_08x._r_n_r_n
push esi
call fcn.0040af30
add esp, 0x20
mov eax, dword [ebp + 0xc]
push eax
push str.Exception_handler_called_in__s._r_n
push esi
call fcn.0040af30
push esi
call fcn.0040b410
add esp, 0x10
cmp dword [edi], 0xc0000005
jne 0x40937a
cmp dword [edi + 0x10], 2
jb 0x40937a
mov eax, str.Read_from
mov ecx, dword [edi + 0x14]
test ecx, ecx
je 0x40934b
mov eax, str.Write_to
mov ecx, dword [edi + 0x18]
push ecx
push eax
push str._s_location__08x_caused_an_access_violation._r_n
lea edx, [ebp - 0x15e0]
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x15e0]
push eax
push 0x42383c
push esi
call fcn.0040af30
add esp, 0xc
push ebx
push esi
call fcn.0040ba20
add esp, 8
push str._r_nBytes_at_CS:EIP:_r_n
push esi
call fcn.0040af30
add esp, 8
mov ecx, dword [ebx + 0xb8]
mov dword [ebp - 0x1128], ecx
xor edi, edi
mov dword [ebp - 0x11f4], edi
cmp edi, 0x10
jge 0x409409
mov dword [ebp - 4], 0
xor edx, edx
mov eax, dword [ebp - 0x1128]
mov dl, byte [edi + eax]
push edx
push 0x42381c
push esi
call fcn.0040af30
add esp, 0xc
mov dword [ebp - 4], 0xffffffff
inc edi
jmp 0x4093a0
mov ecx, dword [ebx + 0xc4]
push ecx
push esi
call fcn.0040b870
push esi
call fcn.0040af90
add esp, 0xc
push str._r_n__end_of_Log___r_n
push esi
call fcn.0040af30
push esi
call fcn.0040aef0
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [0x42902c], 0xb
jl 0x409456
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x63c]
push eax
call fcn.0040bae0
add esp, 8
mov byte [ebp - 0xbf0], 0
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0xbef]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
call sub.MFC42.DLL_AfxGetModuleState
mov eax, dword [eax + 8]
push 0x104
lea ecx, [ebp - 0xf00]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea edi, [ebp - 0xf00]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
add ecx, 0xfffffffe
mov al, 0x5c
cmp byte [ebp + ecx - 0xf00], al
je 0x4094b1
dec ecx
cmp byte [ebp + ecx - 0xf00], al
jne 0x4094a7
mov byte [ebp + ecx - 0xeff], 0
lea edi, [ebp - 0xf00]
lea edx, [ebp - 0xbf0]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edx, [ebp - 0xbf0]
mov edi, str.rfwmain.exe.Err.Log
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov word [ebp - 0x1108], ax
mov ecx, 0x81
lea edi, [ebp - 0x1106]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
lea edi, [ebp - 0xbf0]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
push ecx
lea eax, [ebp - 0x1108]
push eax
push 0xffffffffffffffff
lea ecx, [ebp - 0xbf0]
push ecx
push 0
push 0
mov ebx, dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
call ebx
mov byte [ebp - 0x120], 0
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x11f]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x744], 0
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x743]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea edx, [ebp - 0x744]
push edx
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
lea edi, [ebp - 0x744]
lea edx, [ebp - 0x120]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edx, [ebp - 0x120]
mov edi, str.example.ini
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
push eax
push 0x80
push 2
push eax
push 1
push 0xc0000000
lea eax, [ebp - 0x120]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
test esi, esi
jne 0x409631
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov dword [ebp - 0xdfc], 0xfeff
push 0
lea ecx, [ebp - 0x1c]
push ecx
push 2
lea edx, [ebp - 0xdfc]
push edx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, 0x82
xor eax, eax
lea edi, [ebp - 0xae8]
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x120]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
push ecx
lea eax, [ebp - 0xae8]
push eax
push 0xffffffffffffffff
lea ecx, [ebp - 0x120]
push ecx
push 0
push 0
call ebx
mov edx, dword [0x425c34]
push edx
push 0x42383c
lea eax, [ebp - 0x11f0]
push eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
mov ecx, 0x64
xor eax, eax
lea edi, [ebp - 0x8dc]
rep stosd dword es:[edi], eax
lea edi, [ebp - 0x11f0]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
push ecx
lea ecx, [ebp - 0x8dc]
push ecx
push 0xffffffffffffffff
lea edx, [ebp - 0x11f0]
push edx
push eax
push eax
call ebx
lea eax, [ebp - 0xae8]
push eax
push 0x4c5655
push str.Title
push str.AlertMan
call fcn.0040ac60
lea ecx, [ebp - 0xae8]
push ecx
push 0x4c5bb0
push 0x4237a8
push str.AlertMan
call fcn.0040ac60
lea edx, [ebp - 0xae8]
push edx
push 0x4237a4
push str.ReadOnly
push str.AlertMan
call fcn.00409880
lea eax, [ebp - 0xae8]
push eax
lea ecx, [ebp - 0x8dc]
push ecx
push str.ReportURL
push str.AlertMan
call fcn.00409880
add esp, 0x40
lea edx, [ebp - 0xae8]
push edx
push 1
push str.FileNum
push str.AlertMan
call fcn.0040ac60
lea eax, [ebp - 0xae8]
push eax
lea ecx, [ebp - 0x1108]
push ecx
push 0x423760
push str.AlertMan
call fcn.00409880
lea edx, [ebp - 0xae8]
push edx
push 0x42375c
push str.FileType1
push str.AlertMan
call fcn.00409880
lea eax, [ebp - 0xae8]
push eax
push 0x423740
push 0x423738
push str.AlertMan
call fcn.00409880
add esp, 0x40
lea ecx, [ebp - 0xae8]
push ecx
push 1
push str.TYPE
push str.AlertMan
call fcn.0040ac60
mov byte [ebp - 0x228], 0
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x227]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea edi, [ebp - 0xf00]
lea edx, [ebp - 0x228]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edx, [ebp - 0x228]
mov edi, str.Alertman.exe
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
dec edi
mov ecx, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea eax, [ebp - 0x120]
push eax
lea ecx, [ebp - 0x228]
push ecx
call fcn.00408f70
add esp, 0x18
mov eax, 1
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret