Function at 0x417499
Capabilities:
Clear file content
Get file size
Read file on windows
Write file on windows

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
push edi
xor eax, eax
or dword [ebp - 0x20], 0xffffffff
lea edi, [ebp - 0x4c]
or dword [ebp - 0x14], 0xffffffff
stosd dword es:[edi], eax
mov edx, SysReAllocString
mov dword [ebp - 0x2c], ecx
mov word [ebp - 4], 0xbbef
mov byte [ebp - 2], 0xbf
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
xor eax, eax
mov edi, eax
mov dword [ebp - 0x10], eax
mov esi, eax
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x28], eax
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], eax
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x20]
push eax
push ecx
push ecx
push 4
push ecx
push 7
mov ecx, 0x406cbc
mov dword [ebp - 0xc], edi
mov dword [ebp - 8], esi
call fcn.004173ab
mov ebx, eax
test ebx, ebx
jns 0x41750d
mov ecx, ebx
call fcn.00427566
jmp 0x417877
mov eax, dword [ebp - 0x2c]
push eax
mov dword [ebp - 0x3c], eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
test eax, eax
jne 0x41752f
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.0042754e
mov ebx, eax
jmp 0x417501
mov edi, dword [ebp - 0x20]
test edi, edi
je 0x41753f
cmp edi, 0xffffffff
je 0x41753f
mov eax, edi
jmp 0x417541
xor eax, eax
lea ecx, [ebp - 0x4c]
push ecx
push 0
push 3
push 0
push 2
push eax
call dword [sym.imp.KERNEL32.dll_LockFileEx]
test eax, eax
jne 0x4175c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
and dword [ebp - 0x2c], esi
cmp eax, 0x3e5
jne 0x4175a7
test edi, edi
je 0x417575
cmp edi, 0xffffffff
je 0x417575
mov eax, edi
jmp 0x417577
xor eax, eax
push 1
lea ecx, [ebp - 0x2c]
push ecx
lea ecx, [ebp - 0x4c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x4175c2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.0042754e
mov ebx, eax
mov ecx, ebx
call fcn.00427566
jmp 0x417874
test eax, eax
jg 0x4175af
mov ebx, eax
jmp 0x4175b8
movzx ebx, ax
or ebx, 0x80070000
test ebx, ebx
jns 0x417874
jmp 0x41759b
test edi, edi
je 0x4175cf
cmp edi, 0xffffffff
je 0x4175cf
mov eax, edi
jmp 0x4175d1
xor eax, eax
lea ecx, [ebp - 0x38]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSizeEx]
test eax, eax
jne 0x4175fb
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.0042754e
mov ebx, eax
mov ecx, ebx
call fcn.00427566
jmp 0x417858
mov eax, dword [ebp - 0x34]
mov ecx, dword [ebp - 0x38]
test eax, eax
jg 0x41761c
jl 0x41760b
test ecx, ecx
jne 0x417611
xor ebx, ebx
xor ecx, ecx
jmp 0x4175f1
test eax, eax
jg 0x41761c
jl 0x41761c
cmp ecx, 4
ja 0x417625
mov ecx, 0x8000ffff
mov ebx, ecx
jmp 0x4175f1
test eax, eax
jne 0x41761c
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push eax
lea ecx, [ebp - 0x10]
call fcn.0042776b
mov esi, dword [ebp - 0x10]
test esi, esi
jne 0x417654
mov ebx, 0x8007000e
mov ecx, ebx
jmp 0x417850
test edi, edi
je 0x417661
cmp edi, 0xffffffff
je 0x417661
mov eax, edi
jmp 0x417663
xor eax, eax
push 0
push 0
push 0
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
jne 0x417687
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, eax
call fcn.0042754e
mov ebx, eax
jmp 0x41764d
test edi, edi
je 0x417694
cmp edi, 0xffffffff
je 0x417694
mov eax, edi
jmp 0x417696
xor eax, eax
push 0
lea ecx, [ebp - 0x24]
push ecx
push dword [ebp - 0x38]
push esi
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x417676
mov eax, dword [ebp - 0x38]
cmp dword [ebp - 0x24], eax
jne 0x417849
mov cl, byte [esi]
cmp cl, 0xff
jne 0x417827
cmp byte [esi + 1], 0xfe
jne 0x417827
lea eax, [ebp - 0x14]
mov edx, 0xc0000000
push eax
push ecx
push ecx
push 2
push ecx
push 0
mov ecx, 0x406cd4
call fcn.004173ab
mov ebx, eax
test ebx, ebx
js 0x41764d
mov esi, dword [ebp - 0x14]
test esi, esi
je 0x417702
cmp esi, 0xffffffff
je 0x417702
mov eax, esi
xor ebx, ebx
jmp 0x417706
xor ebx, ebx
mov eax, ebx
push ebx
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x417676
test esi, esi
je 0x417724
mov eax, esi
cmp esi, 0xffffffff
jne 0x417726
mov eax, ebx
push ebx
lea ecx, [ebp - 0x28]
push ecx
push 3
lea ecx, [ebp - 4]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x417676
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 0x38]
add eax, 0xfffffffe
lea edx, [edx + 2]
test esi, esi
je 0x417757
mov ecx, esi
cmp esi, 0xffffffff
jne 0x417759
mov ecx, ebx
push ecx
lea ebx, [ebp - 0x28]
push ebx
push eax
call fcn.00416f74
mov ebx, eax
test ebx, ebx
js 0x41764d
test esi, esi
je 0x41777b
cmp esi, 0xffffffff
je 0x41777b
mov eax, esi
jmp 0x41777d
xor eax, eax
push eax
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x417676
test esi, esi
je 0x4177a0
cmp esi, 0xffffffff
je 0x4177a0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
or dword [ebp - 0x14], 0xffffffff
lea ecx, [ebp - 0x1c]
call fcn.0042603c
mov ebx, eax
test ebx, ebx
js 0x41764d
mov ecx, dword [ebp - 0x1c]
lea eax, [ebp - 0xc]
push eax
push 0
mov edx, 0x406ca0
call fcn.004268f1
mov ebx, eax
test ebx, ebx
js 0x41764d
mov esi, dword [ebp - 0xc]
lea eax, [ebp - 8]
push eax
push 0
mov edx, 0x406cd4
mov ecx, esi
call fcn.004268f1
mov ebx, eax
test ebx, ebx
js 0x41764d
lea eax, [ebp - 0x18]
mov edx, 0x406cbc
push eax
push 0
mov ecx, esi
call fcn.004268f1
mov ebx, eax
test ebx, ebx
js 0x41764d
mov esi, dword [ebp - 8]
xor eax, eax
push eax
push eax
push 3
push eax
push esi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_ReplaceFileW]
test eax, eax
jne 0x417858
jmp 0x4175e0
cmp dword [ebp - 0x34], 0
jl 0x417849
jg 0x417834
cmp eax, 3
jb 0x417849
cmp cl, byte [ebp - 4]
jne 0x417849
mov al, byte [esi + 1]
cmp al, byte [ebp - 3]
jne 0x417849
mov al, byte [esi + 2]
cmp al, byte [ebp - 2]
je 0x417855
mov ecx, 0x8000ffff
mov ebx, ecx
call fcn.00427566
mov esi, dword [ebp - 8]
test edi, edi
je 0x417861
cmp edi, 0xffffffff
jne 0x417863
xor edi, edi
lea eax, [ebp - 0x4c]
push eax
push 0
push 3
push 0
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
mov edi, dword [ebp - 0xc]
mov ecx, ebx
call fcn.0042757e
mov eax, dword [ebp - 0x18]
test eax, eax
je 0x41788c
mov ecx, eax
call fcn.00427347
test esi, esi
je 0x417897
mov ecx, esi
call fcn.00427347
test edi, edi
je 0x4178a2
mov ecx, edi
call fcn.00427347
mov eax, dword [ebp - 0x1c]
test eax, eax
je 0x4178b0
mov ecx, eax
call fcn.00427347
lea ecx, [ebp - 0x30]
call fcn.0041702b
lea ecx, [ebp - 0x10]
call fcn.0041702b
lea ecx, [ebp - 0x14]
call fcn.00416f58
lea ecx, [ebp - 0x20]
call fcn.00416f58
pop edi
pop esi
mov eax, ebx
pop ebx
leave
ret