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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
push ebx
push esi
push 1
push 0x25
lea eax, [ebp - 0x22c]
push eax
xor ebx, ebx
push ebx
call dword [0x411ae8]
mov eax, dword [0x411a6c]
push dword [eax + 0x164]
lea eax, [ebp - 0x22c]
push eax
push eax
call dword [0x411bf4]
push ebx
push ebx
push 4
push ebx
push 1
push 0xc0000000
lea eax, [ebp - 0x22c]
push eax
call dword [sym.imp.kernel32.dll_CreateFileW]
mov esi, eax
mov dword [ebp - 4], esi
cmp esi, 0xffffffff
je 0x4064a3
push ebx
push esi
call dword [sym.imp.kernel32.dll_GetFileSize]
mov dword [ebp - 8], eax
cmp eax, ebx
jbe 0x406229
call fcn.0040d29c
mov dword [ebp - 0x10], eax
jmp 0x40622c
mov dword [ebp - 0x10], ebx
cmp dword [ebp - 0x10], ebx
je 0x40649a
push ebx
lea eax, [ebp - 8]
push eax
push dword [ebp - 8]
push dword [ebp - 0x10]
push esi
call dword [sym.imp.kernel32.dll_ReadFile]
test eax, eax
je 0x406492
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x10]
lea esi, [ebp - 8]
call fcn.00409742
mov dword [ebp - 0x18], eax
cmp eax, ebx
je 0x406492
mov eax, dword [ebp + 8]
mov dword [ebp - 0x1c], eax
push edi
mov ecx, dword [ebp - 0x1c]
push 1
call fcn.0040d8eb
mov dword [ebp - 0x24], eax
cmp eax, ebx
je 0x40636e
cmp byte [eax], 0x21
jne 0x40628d
inc eax
mov dword [ebp - 0x24], eax
xor eax, eax
mov dword [ebp - 0x14], eax
cmp dword [ebp - 8], ebx
jbe 0x406359
mov ecx, dword [ebp - 0x18]
lea eax, [ecx + eax*4]
mov dword [ebp - 0x20], eax
mov eax, dword [eax]
cmp eax, ebx
je 0x406349
mov esi, eax
mov al, byte [esi]
cmp al, 0x20
je 0x4062ba
cmp al, 9
jne 0x4062bd
inc esi
jmp 0x4062b0
mov al, byte [esi]
cmp al, 0x23
je 0x406349
cmp al, 0xd
je 0x406349
cmp al, 0xa
je 0x406349
test al, al
je 0x406349
jmp 0x4062e4
cmp al, 0x20
je 0x4062e8
cmp al, 9
je 0x4062e8
test al, al
je 0x406349
inc esi
mov al, byte [esi]
cmp al, 9
jne 0x4062d5
cmp byte [esi], bl
je 0x406349
mov al, byte [esi]
cmp al, 9
je 0x4062f6
cmp al, 0x20
jne 0x4062f9
inc esi
jmp 0x4062ec
mov al, byte [esi]
cmp al, 0x23
je 0x406349
cmp al, 0xd
je 0x406349
cmp al, 0xa
je 0x406349
test al, al
je 0x406349
mov ecx, dword [ebp - 0x24]
call fcn.0040d6b4
mov edi, eax
push ecx
mov edx, edi
mov ecx, esi
call fcn.0040d6da
test eax, eax
jne 0x406349
mov al, byte [edi + esi]
cmp al, 0x20
je 0x40633a
cmp al, 0xd
je 0x40633a
cmp al, 0xa
je 0x40633a
cmp al, 0x23
je 0x40633a
test al, al
jne 0x406349
mov eax, dword [ebp - 0x20]
push dword [eax]
call fcn.0040d2af
mov eax, dword [ebp - 0x20]
mov dword [eax], ebx
mov eax, dword [ebp - 0x14]
inc eax
mov dword [ebp - 0x14], eax
cmp eax, dword [ebp - 8]
jb 0x40629b
mov ecx, dword [ebp - 0x1c]
push 2
call fcn.0040d8eb
mov dword [ebp - 0x1c], eax
cmp eax, ebx
jne 0x40626f
or dword [ebp - 0x14], 0xffffffff
push ebx
push ebx
push ebx
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_SetFilePointer]
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_SetEndOfFile]
xor esi, esi
cmp dword [ebp - 8], ebx
jbe 0x4063b6
mov eax, dword [ebp - 0x18]
mov ecx, dword [eax + esi*4]
cmp ecx, ebx
je 0x4063b0
push ebx
lea eax, [ebp - 0xc]
push eax
mov dword [ebp - 0x14], esi
call fcn.0040d6b4
push eax
push ecx
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_WriteFile]
inc esi
cmp esi, dword [ebp - 8]
jb 0x40638e
mov edi, dword [ebp + 8]
mov esi, 0x401c98
push 1
mov ecx, edi
call fcn.0040d8eb
mov ebx, eax
test ebx, ebx
je 0x40647d
cmp byte [ebx], 0x21
je 0x40646a
cmp edi, dword [ebp + 8]
jne 0x406412
mov eax, dword [ebp - 0x14]
cmp eax, 0xffffffff
je 0x406412
mov ecx, dword [ebp - 0x18]
mov ecx, dword [ecx + eax*4]
call fcn.0040d6b4
mov dword [ebp - 0xc], eax
test eax, eax
je 0x406412
cmp byte [ecx + eax - 1], 0xa
je 0x406412
push 0
lea eax, [ebp - 0xc]
push eax
push 2
push esi
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_WriteFile]
push 0
lea eax, [ebp - 0xc]
push eax
mov ecx, edi
call fcn.0040d6b4
push eax
push edi
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_WriteFile]
push 0
lea eax, [ebp - 0xc]
push eax
push 1
push 0x401c84
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_WriteFile]
push 0
lea eax, [ebp - 0xc]
push eax
mov ecx, ebx
call fcn.0040d6b4
push eax
push ebx
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_WriteFile]
push 0
lea eax, [ebp - 0xc]
push eax
push 2
push esi
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_WriteFile]
push 2
mov ecx, edi
call fcn.0040d8eb
mov edi, eax
test edi, edi
jne 0x4063be
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_FlushFileBuffers]
mov eax, dword [ebp - 8]
mov edi, dword [ebp - 0x18]
call fcn.0040d2cb
pop edi
push dword [ebp - 0x10]
call fcn.0040d2af
push dword [ebp - 4]
call dword [sym.imp.kernel32.dll_CloseHandle]
pop esi
pop ebx
leave
ret 4