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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x1014
call fcn.00431870
mov eax, dword [0x46aa78]
push ebx
push esi
mov esi, dword [ebp + 0x10]
test esi, esi
mov dword [esp + 0x1018], eax
push edi
mov dword [esp + 0x14], ecx
je 0x41d6f3
cmp byte [esi], 0
je 0x41d6f3
mov eax, dword [ecx + 0x24]
test eax, eax
je 0x41d6f3
mov dl, byte [ecx + 0x20]
test dl, dl
je 0x41d495
push str.Const_Mode
push 3
jmp 0x41d6fa
mov edi, dword [ebp + 8]
push 0
push 0
push edi
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x41d4d7
push edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr_d__point_d
push 6
call fcn.0041d220
add esp, 0x10
xor al, al
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push 0
push 0x8000027
push 3
push 0
push 3
push SysReAllocStringLen
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x41d525
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.Open_file:__s__WinErr_d
push 3
call fcn.0041d220
add esp, 0x10
xor al, al
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
xor eax, eax
mov byte [esp + 0x18], 0
mov ecx, 0x3ff
lea edi, [esp + 0x19]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
push 0
stosb byte es:[edi], al
lea eax, [esp + 0x10]
push eax
push 0x1000
lea ecx, [esp + 0x24]
push ecx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0xc]
xor esi, esi
test ecx, ecx
je 0x41d63b
test eax, eax
je 0x41d5cb
mov edi, dword [ebp + 0xc]
lea edx, [esi + ecx]
cmp edx, edi
jbe 0x41d576
mov ecx, edi
sub ecx, esi
mov dword [esp + 0xc], ecx
mov edx, dword [esp + 0x14]
push 0
lea eax, [esp + 0x14]
push eax
mov eax, dword [edx + 0x24]
push ecx
lea ecx, [esp + 0x24]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41d607
mov eax, dword [esp + 0x10]
cmp dword [esp + 0xc], eax
jne 0x41d607
add esi, eax
cmp esi, edi
jae 0x41d63e
push 0
lea ecx, [esp + 0x10]
push ecx
push 0x1000
lea edx, [esp + 0x24]
push edx
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [esp + 0xc]
test ecx, ecx
jne 0x41d560
jmp 0x41d63e
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x26
je 0x41d63b
mov eax, dword [ebp + 0x10]
push eax
push str.file:__s
push 4
call fcn.0041d220
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr:__d
push 5
call fcn.0041d220
add esp, 0xc
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor al, al
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edi, dword [ebp + 0xc]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp esi, edi
jb 0x41d663
mov al, 1
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edi, dword [ebp + 0xc]
mov eax, edi
sub eax, esi
cmp eax, 0x1000
mov ebx, 0x1000
ja 0x41d675
mov ebx, eax
xor eax, eax
push eax
mov ecx, 0x400
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x18]
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [eax + 0x24]
push ebx
lea edx, [esp + 0x24]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x41d6c6
mov eax, dword [esp + 0x10]
cmp ebx, eax
jne 0x41d6c6
add esi, eax
cmp esi, dword [ebp + 0xc]
jb 0x41d660
mov al, 1
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.winErr:__d
push 5
call fcn.0041d220
add esp, 0xc
xor al, al
mov ecx, dword [esp + 0x101c]
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push 0x45675a
push 0xa
call fcn.0041d220
mov ecx, dword [esp + 0x1024]
add esp, 8
xor al, al
call fcn.00430cd9
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc