Function at 0x409f40
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x4b4993
mov eax, dword fs:[0]
push eax
sub esp, 0x38
mov eax, dword [0x4ef7d0]
xor eax, esp
mov dword [esp + 0x34], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4ef7d0]
xor eax, esp
push eax
lea eax, [esp + 0x4c]
mov dword fs:[0], eax
mov ebp, dword [esp + 0x60]
mov eax, dword [esp + 0x5c]
mov ebx, vtable.wpf::Reader.0
xor edi, edi
mov dword [esp + 0x20], ebp
mov dword [esp + 0x18], ebx
mov dword [esp + 0x1c], edi
push 0xc0000000
push eax
lea ecx, [esp + 0x20]
mov dword [esp + 0x5c], edi
call fcn.0042bd80
test al, al
je 0x40a01b
mov ecx, dword [esp + 0x1c]
lea eax, [esp + 0x14]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
or esi, 0xffffffff
cmp eax, esi
jne 0x409fc1
mov dword [esp + 0x28], esi
jmp 0x409fd1
mov edx, dword [esp + 0x14]
xor esi, esi
xor ecx, ecx
or esi, eax
or edx, ecx
mov dword [esp + 0x28], edx
lea edx, [esi + 1]
push edx
lea ecx, [esp + 0x28]
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], edi
call fcn.00402b50
mov ecx, dword [esp + 0x1c]
push edi
lea eax, [esp + 0x18]
push eax
push esi
mov esi, dword [esp + 0x30]
push esi
push ecx
mov byte [esp + 0x68], 1
mov dword [esp + 0x28], edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov edx, dword [esp + 0x14]
cmp edx, edi
jne 0x40a035
cmp esi, edi
je 0x40a01b
push esi
call fcn.0049ed7a
add esp, 4
mov eax, dword [esp + 0x1c]
cmp eax, edi
mov dword [esp + 0x18], ebx
je 0x40a02e
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
jmp 0x40a1be
xor ebx, ebx
xor eax, eax
cmp edx, edi
mov byte [edx + esi], 0
jbe 0x40a059
mov cl, byte [esi + eax]
test cl, cl
je 0x40a059
cmp cl, 0xd
je 0x40a059
cmp cl, 0xa
je 0x40a059
add eax, 1
cmp eax, edx
jb 0x40a041
mov cl, byte [esi + eax - 1]
cmp cl, 0xd
jne 0x40a073
cmp eax, edx
je 0x40a089
cmp byte [esi + eax], 0xa
je 0x40a089
mov ebx, 0x4c7cec
jmp 0x40a08e
cmp cl, 0xa
jne 0x40a089
cmp eax, edx
je 0x40a082
cmp byte [esi + eax], 0xd
jne 0x40a08e
mov ebx, 0x4c7ce8
jmp 0x40a08e
mov ebx, 0x4c7ce4
push 8
call fcn.0049ee21
add esp, 4
mov dword [esp + 0x14], eax
cmp eax, edi
mov byte [esp + 0x54], 2
je 0x40a0af
push esi
mov ecx, eax
call fcn.0048c5d0
jmp 0x40a0b1
xor eax, eax
mov edx, dword [ebp]
push eax
mov eax, dword [edx + 8]
mov ecx, ebp
mov byte [esp + 0x58], 1
call eax
mov edx, dword [esp + 0x1c]
push edi
lea ecx, [esp + 0x18]
push ecx
push edi
push edx
mov dword [esp + 0x24], edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebp]
mov edx, dword [eax + 0xc]
mov ecx, ebp
call edx
test al, al
je 0x40a18d
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
mov ebp, 0x10
mov ecx, dword [esp + 0x20]
mov eax, dword [ecx]
mov eax, dword [eax + 0x10]
lea edx, [esp + 0x2c]
push edx
call eax
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
mov byte [esp + 0x54], 3
call eax
test al, al
je 0x40a136
mov eax, ebx
lea edx, [eax + 1]
lea ecx, [ecx]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x40a120
sub eax, edx
push eax
push ebx
lea ecx, [esp + 0x34]
call fcn.00407210
cmp dword [esp + 0x44], ebp
mov eax, dword [esp + 0x30]
jae 0x40a144
lea eax, [esp + 0x30]
mov edx, dword [esp + 0x40]
push 0
lea ecx, [esp + 0x18]
push ecx
push edx
push eax
mov eax, dword [esp + 0x2c]
push eax
mov dword [esp + 0x28], 0
call edi
cmp dword [esp + 0x44], ebp
mov byte [esp + 0x54], 1
jb 0x40a178
mov ecx, dword [esp + 0x30]
push ecx
call fcn.0049ea7d
add esp, 4
mov ecx, dword [esp + 0x20]
mov edx, dword [ecx]
mov eax, dword [edx + 0xc]
call eax
test al, al
jne 0x40a0f4
xor edi, edi
mov ecx, dword [esp + 0x1c]
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
cmp esi, edi
je 0x40a1a5
push esi
call fcn.0049ed7a
add esp, 4
mov eax, dword [esp + 0x1c]
cmp eax, edi
mov dword [esp + 0x18], vtable.wpf::Reader.0
je 0x40a1bc
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
mov ecx, dword [esp + 0x4c]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x34]
xor ecx, esp
call fcn.0049ec31
add esp, 0x44
ret 8