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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
lea edi, [esi + 0x6c]
mov ecx, edi
mov dword [ebp - 8], edi
call fcn.0041118f
mov ebx, eax
cmp byte [ebx + 0x1c], 0
mov dword [ebp - 0x14], ebx
je 0x40fbce
xor eax, eax
jmp 0x40ff8d
mov eax, dword [ebp + 0xc]
mov ecx, edi
call fcn.0041118f
mov eax, dword [eax + 4]
mov ecx, esi
call fcn.00410b09
mov eax, dword [eax]
sub eax, 0x10
call fcn.00401c33
mov esi, eax
mov eax, dword [ebp + 0xc]
add esi, 0x10
mov ecx, edi
mov dword [ebp - 0xc], esi
call fcn.0041118f
add eax, 0x18
push eax
lea eax, [ebp - 0xc]
lea edi, [ebp - 4]
call fcn.0041108a
mov edi, dword [ebx + 0xc]
pop ecx
push esi
lea esi, [ebp - 0x18]
call fcn.004015d9
mov eax, esi
call fcn.00412122
mov bl, al
mov eax, dword [ebp - 0x18]
neg bl
sbb bl, bl
add eax, 0xfffffff0
inc bl
call fcn.0040147d
test bl, bl
je 0x40fc57
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 4]
push eax
push 0x104
push dword [ebp + 8]
call fcn.00410aa7
push 0xe
jmp 0x40fcee
mov ecx, dword [ebp - 0xc]
xor esi, esi
push esi
push edi
call fcn.004092cd
test al, al
pop ecx
pop ecx
jne 0x40fcf4
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax + 4]
test ecx, ecx
je 0x40fc84
mov eax, dword [ecx]
push esi
push edi
push dword [ebp - 0xc]
call dword [eax]
test eax, eax
jne 0x40fcf4
cmp byte [0x438cec], 0
je 0x40fcec
mov eax, dword [ebp - 0x14]
add eax, 0x18
push eax
lea eax, [ebp - 0xc]
lea edi, [ebp + 8]
call fcn.0041108a
mov esi, dword [eax]
mov eax, dword [0x438af8]
pop ecx
mov ecx, 0x438af8
call dword [eax + 0xc]
add eax, 0x10
push esi
push dword [0x4382a0]
mov dword [ebp + 0xc], eax
lea eax, [ebp + 0xc]
push eax
call fcn.004063dd
push eax
call fcn.004063dd
push eax
mov ebx, 0x438cbc
call fcn.00405df0
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
call fcn.0040147d
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
call fcn.0040147d
push 0xa
pop esi
jmp 0x40ff75
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
call fcn.0041118f
cmp dword [eax + 4], 0xc
mov eax, dword [ebp + 0x10]
mov esi, dword [eax]
sete bl
test esi, esi
mov dword [ebp - 0x18], esi
je 0x40fd46
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
mov edi, dword [esi]
call fcn.0041118f
push 0
push dword [eax + 0xc]
mov ecx, esi
call dword [edi + 0x1c]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
call fcn.0041118f
push dword [eax]
mov edi, dword [esi]
lea eax, [ebp - 4]
call fcn.00411dca
push eax
mov ecx, esi
call dword [edi + 0x14]
test bl, bl
mov edi, dword [ebp + 8]
je 0x40fd5c
lea eax, [ebp - 4]
push eax
lea esi, [edi + 0x9c]
call fcn.00408a14
lea eax, [edi + 0xa8]
push eax
xor esi, esi
push esi
lea eax, [ebp - 4]
call fcn.00411f65
pop ecx
pop ecx
push esi
push 0x80
push 2
push esi
push esi
push 0x40000000
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 0x24], eax
jne 0x40fe33
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
push eax
lea eax, [ebp - 4]
push eax
push 0x104
push edi
call fcn.00410aa7
cmp byte [0x438cec], 0
je 0x40fe24
push esi
call ebx
push eax
lea eax, [ebp + 8]
call fcn.0040901c
mov esi, dword [eax]
mov eax, dword [0x438af8]
pop ecx
pop ecx
mov ecx, 0x438af8
call dword [eax + 0xc]
push esi
push dword [0x4382a8]
add eax, 0x10
push dword [ebp - 4]
mov dword [ebp + 0xc], eax
push dword [0x4382a4]
lea eax, [ebp + 0xc]
push eax
call fcn.004063dd
push eax
call fcn.004063dd
push eax
call fcn.004063dd
push eax
call fcn.004063dd
push eax
mov ebx, 0x438cbc
call fcn.00405df0
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
call fcn.0040147d
mov eax, dword [ebp + 8]
add eax, 0xfffffff0
call fcn.0040147d
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 2
jmp 0x40fcee
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
mov ebx, dword [edi + 0x78]
push esi
push esi
call fcn.0041118f
mov eax, dword [eax + 0x10]
add eax, dword [edi + 0x8c]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40fe79
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [edi + 0x54]
push eax
push 0x103
push edi
call fcn.00410aa7
cmp dword [ebp - 0x24], esi
je 0x40fe2c
push dword [ebp - 0x24]
jmp 0x40fe26
push 0x10000
call fcn.0042ddf5
pop ecx
mov ecx, dword [ebp - 8]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 0xc]
mov dword [edi + 0xc8], esi
call fcn.0041118f
mov ebx, dword [eax + 8]
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
shr ebx, 1
and bl, 1
call fcn.0041118f
mov eax, dword [eax + 0xc]
mov dword [ebp + 0x10], eax
mov dword [ebp - 0x14], esi
mov ecx, dword [ebp - 0x18]
cmp ecx, esi
je 0x40fec8
mov eax, dword [ecx]
call dword [eax + 0x24]
test al, al
jne 0x40ff94
mov ecx, dword [ebp + 0x10]
mov eax, 0x10000
cmp ecx, eax
jbe 0x40fed6
mov ecx, eax
mov eax, dword [edi + 0x78]
push esi
lea edx, [ebp - 0x10]
push edx
push ecx
push dword [ebp + 8]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40ff4f
mov eax, dword [ebp - 0x10]
cmp eax, esi
je 0x40ff4f
test bl, bl
je 0x40ff06
push dword [ebp + 8]
lea ecx, [edi + 0xc0]
call fcn.00405c93
push esi
lea eax, [ebp - 0x10]
push eax
push dword [ebp - 0x10]
push dword [ebp + 8]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40ff4f
mov eax, dword [ebp - 0x10]
cmp eax, esi
je 0x40ff4f
sub dword [ebp + 0x10], eax
add dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x18]
cmp eax, esi
je 0x40ff46
mov eax, dword [eax]
mov ecx, dword [ebp - 0x18]
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
cdq
push edx
push eax
mov eax, dword [ebp - 0x1c]
call dword [eax + 0x20]
cmp dword [ebp + 0x10], esi
jg 0x40feb4
mov eax, dword [ebp + 0xc]
mov ecx, dword [ebp - 8]
call fcn.0041118f
push dword [ebp + 8]
mov byte [eax + 0x1c], 1
call fcn.0042ddfa
cmp dword [ebp - 0x24], esi
pop ecx
je 0x40ff75
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
add eax, 0xfffffff0
call fcn.0040147d
mov eax, dword [ebp - 0xc]
add eax, 0xfffffff0
call fcn.0040147d
mov eax, esi
pop edi
pop esi
pop ebx
leave
ret 0xc
push dword [ebp + 8]
call fcn.0042ddfa
cmp dword [ebp - 0x24], esi
pop ecx
je 0x40ffab
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0xf
jmp 0x40fcee