Function at 0x4084e0
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84
mov eax, dword [0x447004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
lea eax, [ebp - 0x18]
mov dword [ebp - 8], 0
push eax
lea eax, [ebp - 0x34]
mov dword [ebp - 0x10], 0
push eax
mov ebx, ecx
mov dword [ebp - 0xc], 0
push 0xc
lea eax, [ebp - 0x24]
mov dword [ebp - 0x30], ebx
push eax
push dword [ebx + 0x438]
xorps xmm0, xmm0
mov esi, edx
movlpd qword [ebp - 0x2c], xmm0
movlpd qword [ebp - 0x18], xmm0
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x408582
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, 0xa0
test edi, edi
cmove edi, eax
test esi, esi
je 0x40890b
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x40856d
mov edx, dword [ecx]
mov eax, dword [edx]
add eax, ecx
push eax
mov eax, dword [edx + 4]
call eax
add esp, 4
mov ecx, edi
mov dword [esi], 0x19
call fcn.0041b480
mov dword [esi + 4], eax
jmp 0x408898
cmp dword [ebp - 0x34], 0
jne 0x4085be
test esi, esi
je 0x40890b
mov edx, dword [esi + 4]
test edx, edx
je 0x4085a6
mov ecx, dword [edx]
mov eax, dword [ecx]
add eax, edx
push eax
mov eax, dword [ecx + 4]
call eax
add esp, 4
mov ecx, 0x26
mov dword [esi], 0x19
call fcn.0041b480
mov dword [esi + 4], eax
jmp 0x408898
cmp dword [ebp - 0x20], 2
jne 0x408894
mov eax, dword [ebx]
mov edx, dword [eax]
mov ecx, dword [edx]
add ecx, eax
lea eax, [ebp - 0x2c]
push eax
push dword [ebx + 0x41c]
mov eax, dword [edx + 4]
push ecx
call eax
add esp, 0xc
test eax, eax
jne 0x408625
test esi, esi
je 0x40890b
mov edx, dword [esi + 4]
test edx, edx
je 0x408605
mov ecx, dword [edx]
mov eax, dword [ecx]
add eax, edx
push eax
mov eax, dword [ecx + 4]
call eax
add esp, 4
mov dword [esi], 0x1d
xor eax, eax
mov dword [esi + 4], 0x4479a8
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00425576
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x1c]
mov edi, 0xc
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x48], eax
test eax, eax
je 0x40874c
nop
mov eax, edi
mov dword [ebp - 0x4c], 0
cdq
xorps xmm0, xmm0
lea eax, [ebp - 0x5c]
movlpd qword [ebp - 0x5c], xmm0
push eax
lea eax, [ebp - 0x40]
mov dword [ebp - 0x54], edi
push eax
push 0x10
lea eax, [ebp - 0x14]
mov dword [ebp - 0x50], edx
push eax
push dword [ebx + 0x438]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40884f
cmp dword [ebp - 0x40], 0
je 0x40881d
mov ebx, dword [ebp - 8]
add edi, 0x10
cmp ebx, dword [ebp - 0x28]
jbe 0x4086b3
mov eax, dword [ebp - 0x30]
mov eax, dword [eax]
mov edx, dword [eax]
mov ecx, dword [edx]
add ecx, eax
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [edx + 4]
push ebx
push ecx
call eax
add esp, 0xc
test eax, eax
je 0x40879a
mov ebx, dword [ebp - 8]
mov eax, edi
mov dword [ebp - 0x60], 0
cdq
xorps xmm0, xmm0
lea eax, [ebp - 0x70]
movlpd qword [ebp - 0x70], xmm0
push eax
lea eax, [ebp - 0x44]
mov dword [ebp - 0x68], edi
push eax
push ebx
mov ebx, dword [ebp - 0x30]
push dword [ebp - 0x2c]
mov dword [ebp - 0x64], edx
push dword [ebx + 0x438]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40884f
cmp dword [ebp - 0x44], 0
je 0x4087ee
mov eax, dword [ebp - 0x10]
xorps xmm0, xmm0
mov ecx, dword [ebp - 8]
add edi, ecx
mov dword [ebp - 0x7c], eax
cdq
lea eax, [ebp - 0x84]
movlpd qword [ebp - 0x84], xmm0
push eax
lea eax, [ebp - 0x38]
mov dword [ebp - 0x74], 0
push eax
push ecx
push dword [ebp - 0x2c]
mov dword [ebp - 0x78], edx
push dword [ebx + 0x414]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40884f
mov eax, dword [ebp - 0x34]
inc eax
mov dword [ebp - 0x34], eax
cmp eax, dword [ebp - 0x48]
jb 0x408640
push dword [ebx + 0x414]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
test eax, eax
je 0x40884f
mov edx, esi
mov ecx, ebx
call fcn.00408470
test eax, eax
je 0x4087c4
mov ecx, dword [ebx]
lea eax, [ebp - 0x2c]
push eax
push 0
mov edx, dword [ecx]
mov eax, dword [edx]
add eax, ecx
push eax
mov eax, dword [edx + 4]
call eax
add esp, 0xc
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00425576
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x4087c1
mov edx, dword [esi + 4]
test edx, edx
je 0x4087b4
mov ecx, dword [edx]
mov eax, dword [ecx]
add eax, edx
push eax
mov eax, dword [ecx + 4]
call eax
add esp, 4
mov dword [esi], 0x1d
mov dword [esi + 4], 0x4479a8
mov ebx, dword [ebp - 0x30]
mov eax, dword [ebx]
mov edx, dword [eax]
mov ecx, dword [edx]
add ecx, eax
lea eax, [ebp - 0x2c]
push eax
mov eax, dword [edx + 4]
push 0
push ecx
call eax
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00425576
mov esp, ebp
pop ebp
ret
test esi, esi
je 0x4087c4
mov edx, dword [esi + 4]
test edx, edx
je 0x408808
mov ecx, dword [edx]
mov eax, dword [ecx]
add eax, edx
push eax
mov eax, dword [ecx + 4]
call eax
add esp, 4
mov ecx, 0x26
mov dword [esi], 0x19
call fcn.0041b480
mov dword [esi + 4], eax
jmp 0x4087c4
test esi, esi
je 0x4087c4
mov edx, dword [esi + 4]
test edx, edx
je 0x408837
mov ecx, dword [edx]
mov eax, dword [ecx]
add eax, edx
push eax
mov eax, dword [ecx + 4]
call eax
add esp, 4
mov ecx, 0x26
mov dword [esi], 0x19
call fcn.0041b480
mov dword [esi + 4], eax
jmp 0x4087c4
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov eax, 0xa0
test edi, edi
cmove edi, eax
test esi, esi
je 0x4087c4
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x40887f
mov edx, dword [ecx]
mov eax, dword [edx]
add eax, ecx
push eax
mov eax, dword [edx + 4]
call eax
add esp, 4
mov ecx, edi
mov dword [esi], 0x19
call fcn.0041b480
mov dword [esi + 4], eax
jmp 0x4087c4
test esi, esi
je 0x40890b
mov edi, dword [esi + 4]
lea edx, [ebp - 0x3c]
mov dword [esi], 0x3e9
mov ecx, dword [0x4478b4]
mov dword [ebp - 0x3c], 0
mov dword [ebp - 0x38], 0
push edx
mov eax, dword [ecx]
add eax, 0x4478b4
push 0x10
push eax
mov eax, dword [ecx + 4]
call eax
xor ecx, ecx
add esp, 0xc
test eax, eax
cmovne ecx, dword [ebp - 0x3c]
test ecx, ecx
jne 0x4088f1
test edi, edi
je 0x4088ea
mov ecx, dword [edi]
mov eax, dword [ecx]
add eax, edi
push eax
mov eax, dword [ecx + 4]
call eax
add esp, 4
mov ecx, 0x4479a8
jmp 0x408908
mov dword [ecx + 0xc], edi
mov dword [ecx + 4], str.Db_journal_is_corrupted.
mov dword [ecx + 8], 0x18
mov dword [ecx], 0x447a04
mov dword [esi + 4], ecx
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00425576
mov esp, ebp
pop ebp
ret