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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1064
call fcn.004029c0
mov eax, dword [0x405004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0
push 0x80
push 3
push 0
push 3
xorps xmm0, xmm0
push 0x10000000
push ecx
movlpd qword [ebp - 0x1018], xmm0
movlpd qword [ebp - 0x1050], xmm0
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
mov dword [ebp - 0x1040], edi
test edi, edi
je 0x4013f3
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0x100c]
push 0
push eax
push 0x200
lea eax, [ebp - 0x1008]
push eax
push edi
call esi
mov eax, dword [ebp - 0xfcc]
mov ebx, dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push 0
push eax
push edi
mov dword [ebp - 0x1060], eax
mov dword [ebp - 0x1034], 0
call ebx
push 0
lea eax, [ebp - 0x100c]
push eax
push 0x1000
lea eax, [ebp - 0x1008]
push eax
push edi
call esi
push 0
push 0
push 0
push edi
call ebx
mov eax, dword [ebp - 0xfb8]
xor ecx, ecx
add eax, 0x1000
setb cl
neg ecx
or ecx, eax
push ecx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov ebx, eax
lea eax, [ebp - 0x1008]
push 0x1000
push eax
push ebx
mov dword [ebp - 0x101c], ebx
call sub.VCRUNTIME140.dll_memcpy
mov ax, word [ebp - 0xff0]
mov edx, 0x10b
add esp, 0x10
mov ecx, 0x20b
cmp ax, dx
jne 0x401244
mov eax, dword [ebp - 0xfd4]
xorps xmm0, xmm0
mov dword [ebp - 0x1018], eax
xor eax, eax
mov dword [ebp - 0x1014], 0
movlpd qword [ebp - 0x1038], xmm0
cmp ax, word [ebp - 0x1002]
jae 0x401384
mov eax, dword [ebp - 0x1034]
mov ecx, dword [ebp - 0x1050]
mov esi, dword [ebp - 0x104c]
mov dword [ebp - 0x1024], eax
mov eax, dword [ebp - 0x1038]
mov dword [ebp - 0x103c], ecx
mov ecx, eax
mov dword [ebp - 0x102c], eax
mov dword [ebp - 0x1020], esi
nop dword [eax]
lea esi, [ecx + ecx*4]
push 0
shl esi, 3
push 0
push dword [ebp + esi - 0xefc]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x100c]
push eax
push dword [ebp + esi - 0xf00]
mov eax, dword [ebp + esi - 0xf04]
add eax, ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0xf10]
mov ecx, str..reloc
add eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x4011d6
test dl, dl
je 0x4011d2
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x4011d6
add eax, 2
add ecx, 2
test dl, dl
jne 0x4011b6
xor eax, eax
jmp 0x4011db
sbb eax, eax
or eax, 1
test eax, eax
jne 0x4011fb
mov ecx, dword [ebp + esi - 0xf04]
mov eax, ebx
cdq
xor esi, esi
add ecx, eax
mov dword [ebp - 0x103c], ecx
adc esi, edx
mov dword [ebp - 0x1020], esi
mov ecx, dword [ebp - 0x102c]
mov esi, dword [ebp - 0x1024]
add ecx, 1
movzx eax, word [ebp - 0x1002]
adc esi, 0
cdq
mov dword [ebp - 0x102c], ecx
mov dword [ebp - 0x1024], esi
cmp esi, edx
jb 0x401170
ja 0x401233
cmp ecx, eax
jb 0x401170
mov edi, dword [ebp - 0x103c]
mov ecx, dword [ebp - 0x1020]
jmp 0x401396
cmp ax, cx
jne 0x401384
mov eax, dword [ebp - 0xfd8]
xorps xmm0, xmm0
mov ecx, dword [ebp - 0xfd4]
mov edi, dword [ebp - 0x1050]
mov dword [ebp - 0x1018], eax
xor eax, eax
mov dword [ebp - 0x1014], ecx
movlpd qword [ebp - 0x1038], xmm0
mov dword [ebp - 0x103c], edi
cmp ax, word [ebp - 0x1002]
jae 0x401390
mov eax, dword [ebp - 0x1034]
mov esi, dword [ebp - 0x104c]
mov dword [ebp - 0x1024], eax
mov eax, dword [ebp - 0x1038]
mov dword [ebp - 0x1020], esi
mov esi, eax
mov dword [ebp - 0x102c], eax
lea esi, [esi + esi*4]
push 0
shl esi, 3
push 0
push dword [ebp + esi - 0xeec]
push dword [ebp - 0x1040]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x100c]
push eax
push dword [ebp + esi - 0xef0]
mov eax, dword [ebp + esi - 0xef4]
add eax, ebx
push eax
push dword [ebp - 0x1040]
call dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0xf00]
mov ecx, str..reloc
add eax, esi
mov dl, byte [eax]
cmp dl, byte [ecx]
jne 0x401321
test dl, dl
je 0x40131d
mov dl, byte [eax + 1]
cmp dl, byte [ecx + 1]
jne 0x401321
add eax, 2
add ecx, 2
test dl, dl
jne 0x401301
xor eax, eax
jmp 0x401326
sbb eax, eax
or eax, 1
test eax, eax
jne 0x401348
mov edi, dword [ebp + esi - 0xef4]
mov eax, ebx
cdq
xor ecx, ecx
add edi, eax
mov dword [ebp - 0x103c], edi
adc ecx, edx
mov dword [ebp - 0x1020], ecx
jmp 0x40134e
mov ecx, dword [ebp - 0x1020]
mov esi, dword [ebp - 0x102c]
movzx eax, word [ebp - 0x1002]
add esi, 1
cdq
adc dword [ebp - 0x1024], 0
mov dword [ebp - 0x102c], esi
cmp dword [ebp - 0x1024], edx
jb 0x4012b1
ja 0x401396
cmp esi, eax
jb 0x4012b1
jmp 0x401396
mov edi, dword [ebp - 0x1050]
mov dword [ebp - 0x103c], edi
mov ecx, dword [ebp - 0x104c]
mov edx, dword [ebp + 8]
mov eax, edx
mov esi, dword [ebp + 0xc]
or eax, esi
je 0x4013a8
mov eax, edx
mov edx, esi
jmp 0x4013ab
mov eax, ebx
cdq
sub eax, dword [ebp - 0x1018]
mov dword [ebp - 0x1020], eax
mov eax, edi
sbb edx, dword [ebp - 0x1014]
or eax, ecx
mov dword [ebp - 0x1024], edx
mov dword [ebp - 0x105c], 8
mov dword [ebp - 0x1044], 0
jne 0x401406
push dword [ebp - 0x1040]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00401d0a
mov esp, ebp
pop ebp
ret
mov edx, dword [edi + 4]
lea esi, [edi + 8]
mov dword [ebp - 0x102c], 8
mov dword [ebp - 0x1028], esi
nop dword [eax]
lea eax, [edx - 8]
xorps xmm0, xmm0
movlpd qword [ebp - 0x1038], xmm0
test eax, 0xfffffffe
jbe 0x401654
mov ebx, dword [ebp - 0x1034]
mov ecx, dword [ebp - 0x1038]
mov dword [ebp - 0x1058], ebx
mov dword [ebp - 0x1054], ecx
lea eax, [ecx + ecx]
mov ecx, dword [ebp - 0x102c]
mov dword [ebp - 0x1034], eax
add eax, edi
movzx eax, word [eax + ecx]
mov ecx, eax
shr ecx, 0xc
dec ecx
cmp ecx, 9
ja case.0x401475.4
jmp dword [ecx*4 + 0x401880]
mov edx, dword [ebp - 0x101c]
and eax, 0xfff
add eax, dword [esi - 8]
mov ecx, dword [ebp - 0x1020]
add edx, eax
mov eax, dword [ebp - 0x1024]
shrd ecx, eax, 0x10
movzx eax, cx
add dword [edx], eax
jmp case.0x401475.4
mov ecx, dword [esi - 8]
and eax, 0xfff
mov edx, dword [ebp - 0x101c]
add ecx, eax
mov eax, dword [ebp - 0x1020]
movzx eax, ax
add dword [ecx + edx], eax
jmp case.0x401475.4
mov ecx, dword [esi - 8]
and eax, 0xfff
mov edx, dword [ebp - 0x1020]
add ecx, eax
mov eax, dword [ebp - 0x101c]
add dword [ecx + eax], edx
jmp case.0x401475.4
and eax, 0xfff
mov edi, dword [ebp - 0x101c]
add eax, dword [esi - 8]
add edi, eax
mov esi, dword [edi]
mov ecx, esi
shl ecx, 0xb
mov eax, esi
and eax, 0x400
mov edx, dword [edi + 4]
add ecx, eax
mov dword [ebp - 0x104c], edx
mov eax, esi
shr eax, 0x14
and eax, 0x700
lea ecx, [eax + ecx*2]
mov eax, esi
shr eax, 0x10
movzx eax, al
add ecx, eax
mov eax, edx
movzx ebx, cx
and eax, 0x400
mov ecx, edx
shl ecx, 0xb
add ecx, eax
mov eax, edx
shr eax, 4
and eax, 0x7000000
shl ecx, 0x11
add ecx, eax
mov eax, edx
and eax, 0xff0000
add ecx, eax
xor eax, eax
or ebx, ecx
add ebx, dword [ebp - 0x1020]
mov edx, ebx
mov ecx, ebx
adc eax, dword [ebp - 0x1024]
and ecx, 0x700
shrd edx, eax, 0x10
shl ecx, 4
and esi, 0x8f00fbf0
movzx eax, bl
add ecx, eax
mov eax, ebx
shr eax, 1
shl ecx, 0x10
and eax, 0x400
add ecx, eax
shr ebx, 0xc
and ebx, 0xf
movzx eax, dl
add ecx, ebx
add ecx, esi
mov esi, dword [ebp - 0x1028]
mov dword [edi], ecx
mov ecx, edx
mov edi, dword [ebp - 0x103c]
and ecx, 0x700
shl ecx, 4
add ecx, eax
mov eax, edx
shr eax, 1
and eax, 0x400
shl ecx, 0x10
add ecx, eax
shr edx, 0xc
mov eax, dword [ebp - 0x104c]
and edx, 0xf
and eax, 0x8f00fbf0
add ecx, edx
mov edx, dword [ebp - 0x102c]
add ecx, eax
mov eax, dword [ebp - 0x1034]
add eax, edi
movzx eax, word [eax + edx]
mov edx, dword [ebp - 0x101c]
and eax, 0xfff
add eax, dword [esi - 8]
mov ebx, dword [ebp - 0x1058]
mov dword [eax + edx + 4], ecx
jmp case.0x401475.4
mov ecx, dword [esi - 8]
and eax, 0xfff
mov edx, dword [ebp - 0x1020]
add ecx, eax
mov eax, dword [ebp - 0x101c]
add dword [ecx + eax], edx
mov edx, dword [ebp - 0x1024]
adc dword [ecx + eax + 4], edx
mov ecx, dword [ebp - 0x1054]
mov edx, dword [esi - 4]
add ecx, 1
mov dword [ebp - 0x1054], ecx
adc ebx, 0
mov dword [ebp - 0x1058], ebx
lea eax, [edx - 8]
shr eax, 1
test ebx, ebx
jb 0x401451
ja 0x401654
cmp ecx, eax
jb 0x401451
mov eax, dword [ebp - 0x105c]
add eax, edx
mov ecx, eax
mov dword [ebp - 0x105c], eax
adc dword [ebp - 0x1044], 0
lea esi, [edi + ecx]
mov edx, dword [esi - 4]
mov dword [ebp - 0x102c], ecx
mov dword [ebp - 0x1028], esi
test edx, edx
jne 0x401420
mov ax, word [ebp - 0xff0]
mov ecx, 0x10b
mov ebx, dword [ebp - 0x101c]
mov edi, dword [ebp - 0x1040]
cmp ax, cx
jne 0x40177b
mov eax, dword [ebp + 8]
xorps xmm0, xmm0
mov dword [ebp - 0x1018], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1014], eax
xor eax, eax
movlpd qword [ebp - 0x1038], xmm0
cmp ax, word [ebp - 0x1002]
jae 0x401756
mov eax, dword [ebp - 0x1034]
mov ecx, dword [ebp - 0x1038]
mov dword [ebp - 0x1044], eax
mov dword [ebp - 0x1028], ecx
nop word [eax + eax]
push 0
push 0
lea esi, [ecx + ecx*4]
push dword [ebp + esi*8 - 0xefc]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x100c]
push eax
push dword [ebp + esi*8 - 0xf00]
mov eax, dword [ebp + esi*8 - 0xf04]
add eax, ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x1028]
mov esi, dword [ebp - 0x1044]
add ecx, 1
movzx eax, word [ebp - 0x1002]
adc esi, 0
cdq
mov dword [ebp - 0x1028], ecx
mov dword [ebp - 0x1044], esi
cmp esi, edx
jb 0x4016f0
ja 0x401756
cmp ecx, eax
jb 0x4016f0
mov eax, dword [ebp - 0x1060]
push 0
push 0
add eax, 0x34
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x100c]
push eax
push 4
jmp 0x401856
mov ecx, 0x20b
cmp ax, cx
jne 0x401864
mov eax, dword [ebp + 8]
xorps xmm0, xmm0
mov dword [ebp - 0x1018], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x1014], eax
xor eax, eax
movlpd qword [ebp - 0x1038], xmm0
cmp ax, word [ebp - 0x1002]
jae 0x401836
mov eax, dword [ebp - 0x1034]
mov ecx, dword [ebp - 0x1038]
mov dword [ebp - 0x1044], eax
mov dword [ebp - 0x1028], ecx
nop dword [eax]
push 0
push 0
lea esi, [ecx + ecx*4]
push dword [ebp + esi*8 - 0xeec]
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x100c]
push eax
push dword [ebp + esi*8 - 0xef0]
mov eax, dword [ebp + esi*8 - 0xef4]
add eax, ebx
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x1028]
mov esi, dword [ebp - 0x1044]
add ecx, 1
movzx eax, word [ebp - 0x1002]
adc esi, 0
cdq
mov dword [ebp - 0x1028], ecx
mov dword [ebp - 0x1044], esi
cmp esi, edx
jb 0x4017d0
ja 0x401836
cmp ecx, eax
jb 0x4017d0
mov eax, dword [ebp - 0x1060]
push 0
push 0
add eax, 0x30
push eax
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [ebp - 0x100c]
push eax
push 8
lea eax, [ebp - 0x1018]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00401d0a
mov esp, ebp
pop ebp
ret