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

Disassembly:
mov eax, 0x11d8
call fcn.00409d70
push ebx
push ebp
push esi
push edi
mov ecx, 0x80
xor eax, eax
lea edi, [esp + 0xbe8]
mov byte [esp + 0x21e], al
rep stosd dword es:[edi], eax
mov ecx, 0x80
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
mov ecx, 0x4b
lea edi, [esp + 0x222]
mov byte [esp + 0x21f], 2
mov byte [esp + 0x21c], 0x52
mov byte [esp + 0x21d], 0x36
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x11f0]
mov edx, dword [eax + 4]
mov ecx, dword [eax]
test edx, edx
mov dword [esp + 0x222], ecx
je 0x412ad2
mov cl, dl
lea esi, [eax + 8]
mov byte [esp + 0x226], cl
mov ecx, edx
mov eax, ecx
lea edi, [esp + 0x227]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea eax, [edx + 5]
and ecx, 3
cmp eax, 4
rep movsb byte es:[edi], byte [esi]
jne 0x412a19
mov byte [esp + 0x226], 0
mov eax, 5
mov ebp, dword [esp + 0x11ec]
mov edx, eax
mov byte [esp + 0x221], al
add eax, 6
sar edx, 8
mov ecx, eax
mov byte [esp + 0x220], dl
sar ecx, 8
xor edx, edx
xor ebx, ebx
test eax, eax
mov byte [esp + 0x1c], cl
mov byte [esp + 0x1d], al
jle 0x412b7f
xor ecx, ecx
cmp eax, 0xfa
mov cl, dh
mov byte [esp + 0x20], 0
mov byte [esp + 0x1e], cl
mov byte [esp + 0x1f], dl
mov byte [esp + 0x21], 0xfa
jg 0x412a70
mov byte [esp + 0x21], al
mov ecx, edx
lea edi, [esp + 0x22]
and ecx, 0xffff
sub eax, 0xfa
add edx, 0xfa
lea esi, [esp + ecx + 0x21c]
mov ecx, 0x3e
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
add ebx, 0x100
and ecx, 0xffff
movsw word es:[edi], word [esi]
lea edi, [esp + ecx + 0xde8]
mov ecx, 0x40
lea esi, [esp + 0x1c]
test eax, eax
rep movsd dword es:[edi], dword [esi]
jg 0x412a4f
mov eax, dword [0x45dc78]
test eax, eax
je 0x412b26
cmp bx, 0x100
jbe 0x412aec
mov eax, 0x200
jmp 0x412aff
mov ecx, dword [eax + 0x108]
test ecx, ecx
je 0x412a0c
mov byte [esp + 0x226], cl
jmp 0x412a14
mov edx, ebp
shl edx, 5
add edx, ebp
shl edx, 4
sub edx, ebp
mov eax, dword [edx*4 + 0x44dd28]
mov ecx, ebp
push eax
shl ecx, 5
add ecx, ebp
lea eax, [esp + 0xdec]
shl ecx, 4
sub ecx, ebp
push eax
mov dl, byte [ecx*4 + 0x44d4f8]
push edx
call fcn.004166c0
add esp, 0xc
jmp 0x412b7f
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
cmp bx, 0x100
jbe 0x412b3c
mov eax, 0x200
jmp 0x412b4f
mov eax, ebp
shl eax, 5
add eax, ebp
shl eax, 4
sub eax, ebp
mov eax, dword [eax*4 + 0x44dd28]
lea ecx, [esp + 0x14]
push 0
push ecx
push eax
mov eax, ebp
lea edx, [esp + 0xdf4]
shl eax, 5
add eax, ebp
push edx
shl eax, 4
sub eax, ebp
mov ecx, dword [eax*4 + 0x44d4f4]
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x412b7f
call esi
mov ebx, dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, 0x80
xor eax, eax
lea edi, [esp + 0x1c]
rep stosd dword es:[edi], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov eax, dword [0x45dc78]
test eax, eax
je 0x412be8
mov eax, ebp
lea ecx, [esp + 0x1c]
shl eax, 5
add eax, ebp
shl eax, 4
sub eax, ebp
shl eax, 2
mov dx, word [eax + 0x44dd28]
push edx
mov dl, byte [eax + 0x44d4f8]
push ecx
push edx
call fcn.004165c0
add esp, 0xc
test eax, eax
jne 0x412c3b
mov ecx, 0x80
lea edi, [esp + 0x1c]
lea esi, [esp + 0xbe8]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
jne 0x412c3b
jmp 0x412b98
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov eax, ebp
lea ecx, [esp + 0x18]
shl eax, 5
add eax, ebp
push 0
shl eax, 4
sub eax, ebp
push ecx
shl eax, 2
lea ecx, [esp + 0x24]
mov edx, dword [eax + 0x44dd28]
push edx
mov edx, dword [eax + 0x44d4f4]
push ecx
push edx
call ebx
test eax, eax
je 0x412ce9
mov ecx, 0x80
lea edi, [esp + 0x1c]
lea esi, [esp + 0xbe8]
xor eax, eax
repe cmpsd dword [esi], dword es:[edi]
je 0x412b98
mov edx, dword [esp + 0x1c]
mov ecx, dword [esp + 0x1d]
movzx ax, byte [esp + 0x1f]
and edx, 0xff
and ecx, 0xff
shl edx, 8
add edx, ecx
mov esi, dword [esp + 0x21]
movzx cx, byte [esp + 0x1e]
shl ecx, 8
add ecx, eax
mov eax, dword [esp + 0x20]
and eax, 0xff
and esi, 0xff
shl eax, 8
add eax, esi
mov edi, ecx
mov ecx, eax
and edi, 0xffff
mov ebx, ecx
mov dword [esp + 0x10], edi
lea esi, [esp + 0x22]
lea edi, [esp + edi + 0x21c]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
add ecx, eax
cmp edx, ecx
jne 0x412b7f
mov esi, dword [esp + 0x220]
mov eax, dword [esp + 0x221]
and esi, 0xff
and eax, 0xff
shl esi, 8
add esi, eax
add edx, 0xfffffffa
cmp edx, esi
je 0x412cfb
pop edi
pop esi
pop ebp
mov eax, 0xa0100014
pop ebx
add esp, 0x11d8
ret 8
pop edi
pop esi
pop ebp
mov eax, 0xf0100004
pop ebx
add esp, 0x11d8
ret 8
mov cl, byte [esp + esi + 0x221]
mov dl, byte [esp + esi + 0x220]
push ecx
push edx
call fcn.00412730
mov edx, dword [esp + 0x11f8]
mov ecx, esi
add esp, 8
mov dword [edx + 0x108], esi
lea edi, [edx + 0x10c]
mov edx, ecx
lea esi, [esp + 0x222]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x11d8
ret 8