Function at 0x401d11
Capabilities:
Get common file path
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x348
push ebx
push esi
xor ebx, ebx
push edi
mov dword [ebp - 0x18], ecx
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
mov esi, 0x104
mov dword [ebp - 4], eax
push esi
lea eax, [ebp - 0x244]
push ebx
push eax
call fcn.0040bd10
push esi
lea eax, [ebp - 0x348]
push ebx
push eax
call fcn.0040bd10
mov edi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
add esp, 0x18
lea eax, [ebp - 0x348]
push esi
push eax
push dword [ebp - 4]
call edi
lea eax, [ebp - 0x244]
push esi
push eax
push dword [ebp - 4]
call edi
lea eax, [ebp - 0x244]
push eax
call fcn.0040be60
cmp eax, 1
pop ecx
jl 0x402116
lea ecx, [eax - 1]
cmp ecx, ebx
jle 0x401d9c
cmp byte [ebp + ecx - 0x244], 0x5c
je 0x401d9a
dec ecx
jmp 0x401d89
mov eax, ecx
cmp eax, 1
jl 0x402116
mov eax, esi
sub eax, ecx
push eax
lea eax, [ebp + ecx - 0x244]
push ebx
push eax
call fcn.0040bd10
lea eax, [ebp - 0x244]
push str.patch.wnp
push eax
call fcn.0040bd80
add esp, 0x14
lea eax, [ebp - 0x348]
push ebx
push 0x80
push 3
push ebx
push 1
push 0x80000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x4020e1
cmp eax, 0xffffffff
je 0x4020e1
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
push edi
call fcn.0040c47a
pop ecx
mov dword [ebp - 0x10], eax
lea ecx, [ebp - 0x30]
push ebx
push ecx
push edi
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
push dword [ebp - 4]
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x1c], ebx
je 0x402116
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 8], ebx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x14], ebx
mov dword [ebp - 4], ebx
lea eax, [ecx + edi]
cmp ecx, eax
jae 0x401e9a
inc ecx
inc dword [ebp - 8]
mov dword [ebp - 0xc], ecx
cmp byte [ecx], 0x40
jne 0x401e7f
lea edx, [ecx + 0xa]
cmp edx, eax
jae 0x401e7f
push 0x12
push str._Daisy_Lucy_xyzzy_
push ecx
call fcn.0040c5c0
add esp, 0xc
test eax, eax
jne 0x401e7f
cmp dword [ebp - 4], ebx
jne 0x401e89
mov dword [ebp - 4], 1
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 0xc]
add eax, edi
jmp 0x401e48
mov eax, dword [ebp - 0xc]
add dword [ebp - 0xc], 0x1a
add dword [ebp - 8], 0x19
mov eax, dword [eax + 0x12]
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
add eax, edi
cmp dword [ebp - 0xc], eax
jae 0x40207c
lea eax, [ebp - 0x244]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x244]
push 0x41a0dc
push eax
call esi
push ebx
push 0x80
push 2
push ebx
push ebx
lea eax, [ebp - 0x244]
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, ebx
mov dword [ebp - 4], eax
je 0x402098
cmp eax, 0xffffffff
je 0x402098
sub edi, dword [ebp - 8]
lea ecx, [ebp - 0x2c]
push ebx
push ecx
dec edi
push edi
push dword [ebp - 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
cmp eax, ebx
jbe 0x402054
dec eax
mov dword [ebp - 0xc], ebx
cmp eax, ebx
mov dword [ebp - 0x28], eax
jbe 0x402054
lea edi, [ebp - 0x13c]
mov dword [ebp - 8], 1
sub edi, 4
mov dword [ebp - 0x20], edi
jmp 0x401f49
mov edi, dword [ebp - 0x20]
mov esi, dword [sym.imp.KERNEL32.dll_lstrcatA]
lea eax, [ebp - 0x348]
push eax
lea eax, [ebp - 0x13c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
lea eax, [ebp - 0x13c]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
cmp dword [ebp - 8], 0xa
mov byte [eax + edi], bl
jae 0x401f7a
push str..wp00
jmp 0x401f8c
cmp dword [ebp - 8], 0x64
jae 0x401f87
push str..wp0
jmp 0x401f8c
push 0x41a0c8
lea eax, [ebp - 0x13c]
push eax
call esi
lea eax, [ebp - 0x3c]
push 0xa
push eax
push dword [ebp - 8]
call fcn.00416a1b
add esp, 0xc
lea eax, [ebp - 0x3c]
push eax
lea eax, [ebp - 0x13c]
push eax
call esi
push ebx
push 0x80
push 3
push ebx
push 1
mov edi, 0x80000000
lea eax, [ebp - 0x13c]
push edi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x401ffe
mov esi, dword [ebp - 0x18]
lea eax, [ebp - 0x13c]
push eax
mov ecx, esi
call fcn.0040211d
test eax, eax
je 0x40208c
push ebx
push 0x80
push 3
push ebx
push 1
jmp 0x401fc3
push ebx
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
push edi
call fcn.0040c47a
pop ecx
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x24]
push ebx
push ecx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea eax, [ebp - 0x24]
push ebx
push eax
push edi
push dword [ebp - 0x14]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 0x14]
call fcn.0040c391
inc dword [ebp - 0xc]
inc dword [ebp - 8]
mov eax, dword [ebp - 0xc]
pop ecx
cmp eax, dword [ebp - 0x28]
jb 0x401f40
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x1c], ebx
je 0x40207c
lea eax, [ebp - 0x244]
push eax
mov eax, dword [ebp - 0x18]
add eax, 0x32c
push eax
call fcn.0040bd70
pop ecx
pop ecx
push 1
pop ebx
push dword [ebp - 0x10]
call fcn.0040c391
pop ecx
mov eax, ebx
jmp 0x402118
mov dword [esi + 0x63c], 1
jmp 0x402116
lea eax, [ebp - 0x244]
push eax
lea eax, [ebp - 0x140]
push 0x41a0ac
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x140]
push ebx
push 0x41a09c
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [ebp - 0x10]
call fcn.0040c391
pop ecx
jmp 0x402116
lea eax, [ebp - 0x348]
push eax
lea eax, [ebp - 0x140]
push 0x41a084
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [ebp - 0x140]
push ebx
push 0x41a09c
push eax
mov eax, dword [ebp - 0x18]
push dword [eax + 4]
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret