Function at 0x406530
Capabilities:
Read file on windows

Disassembly:
sub esp, 0xf0
push ebx
mov ebx, dword [esp + 0xf8]
push ebp
push esi
mov ebp, ecx
push edi
mov ecx, 0xf
mov esi, ebx
lea edi, [esp + 0x1c]
mov eax, dword [ebx + 8]
rep movsd dword es:[edi], dword [esi]
movsw word es:[edi], word [esi]
mov esi, dword [ebp + 0x56]
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], ebp
mov eax, dword [esi + 0x6c]
test eax, eax
je 0x406683
mov edi, dword [esp + 0x108]
lea ecx, [esp + 0x1c]
push edi
push ecx
mov ecx, ebp
call fcn.004068d0
mov ebp, dword [esp + 0x40]
xor eax, eax
mov ax, word [edi + 4]
mov esi, dword [esp + 0x14]
mov edx, eax
and ebp, 0xffff
and edx, 0x3f
sub ebp, edx
inc ebp
cmp esi, ebp
ja 0x4065a1
mov ebp, esi
mov ecx, dword [esp + 0x10]
mov edx, dword [ecx + 0x56]
mov ecx, dword [ebx + 0x36]
push ecx
mov ecx, dword [esp + 0x3a]
add ecx, dword [ebx + 0x2e]
push ecx
mov ecx, dword [ebx + 8]
sub ecx, esi
shl ecx, 9
add ecx, dword [esp + 0x114]
push ecx
push ebp
push eax
xor eax, eax
mov ax, word [edi + 2]
xor ecx, ecx
mov cx, word [edi]
push eax
xor eax, eax
push ecx
mov ax, word [ebx]
push eax
call dword [edx + 0x78]
test eax, eax
je 0x406601
mov ecx, dword [esp + 0x36]
sub esi, ebp
add ecx, ebp
mov dword [esp + 0x14], esi
test esi, esi
mov dword [esp + 0x36], ecx
je 0x4068b8
mov ebp, dword [esp + 0x10]
jmp 0x40656b
mov ebx, 1
cmp ebp, ebx
jne 0x406619
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xf0
ret 0xc
mov ecx, 0xf
lea esi, [esp + 0x1c]
lea edi, [esp + 0x5c]
rep movsd dword es:[edi], dword [esi]
test ebp, ebp
movsw word es:[edi], word [esi]
jbe 0x406674
mov esi, dword [esp + 0x10c]
mov ecx, dword [esp + 0x108]
push esi
lea edx, [esp + 0x60]
push ecx
mov ecx, dword [esp + 0x18]
push edx
mov dword [esp + 0x70], ebx
call fcn.00406530
test eax, eax
jne 0x406662
mov ecx, 0x80
mov eax, 0xe5e5e5e5
mov edi, esi
rep stosd dword es:[edi], eax
mov edx, dword [esp + 0x76]
add esi, 0x200
inc edx
dec ebp
mov dword [esp + 0x76], edx
jne 0x406635
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xf0
ret 0xc
mov eax, dword [ebx + 0x1a]
mov edx, dword [ebx + 0x2e]
xor ecx, ecx
xor edi, edi
add eax, edx
push edi
adc ecx, edi
push 0x200
push ecx
push eax
call fcn.0041e6c0
mov ecx, edx
mov dword [esp + 0x14], edx
lea edx, [esp + 0x14]
push edi
push edx
mov dword [esp + 0x18], eax
push eax
xor eax, eax
mov ax, word [ebx]
sar ecx, 0x1f
mov ecx, dword [esi + eax*4 + 0x3b0]
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov eax, dword [ebx + 8]
mov ecx, dword [esp + 0x10c]
lea edx, [esp + 0x10]
push edi
push edx
xor edx, edx
mov dx, word [ebx]
mov dword [esp + 0x18], edi
shl eax, 9
push eax
mov eax, dword [ebp + 0x56]
push ecx
mov ecx, dword [eax + edx*4 + 0x3b0]
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [esp + 0x10]
test eax, eax
jne 0x406800
mov ax, word [ebx]
cmp ax, 0x80
jae 0x406800
mov edx, dword [ebp + 0x56]
and eax, 0xffff
mov eax, dword [edx + eax*4 + 0x3b0]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor ecx, ecx
lea edx, [esp + 0x9c]
mov cx, word [ebx]
add ecx, 0x41
push ecx
push str.._c:
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
lea eax, [esp + 0x9c]
push edi
push 0x20000000
push 3
push edi
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edx, dword [ebp + 0x56]
xor ecx, ecx
mov cx, word [ebx]
mov dword [edx + ecx*4 + 0x3b0], eax
mov ecx, dword [ebp + 0x56]
xor eax, eax
mov ax, word [ebx]
lea esi, [ecx + eax*4 + 0x3b0]
mov eax, dword [ecx + eax*4 + 0x3b0]
cmp eax, 0xffffffff
jne 0x406799
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xf0
ret 0xc
mov edx, dword [ebx + 0x1a]
mov ecx, dword [ebx + 0x2e]
xor eax, eax
xor edi, edi
add edx, ecx
push edi
adc eax, edi
push 0x200
push eax
push edx
call fcn.0041e6c0
mov ecx, edx
mov dword [esp + 0x14], edx
lea edx, [esp + 0x14]
push edi
push edx
mov dword [esp + 0x18], eax
push eax
mov eax, dword [esi]
sar ecx, 0x1f
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebx + 8]
mov eax, dword [esp + 0x10c]
lea ecx, [esp + 0x10]
push edi
push ecx
xor ecx, ecx
mov cx, word [ebx]
mov dword [esp + 0x18], edi
shl edx, 9
push edx
mov edx, dword [ebp + 0x56]
push eax
mov eax, dword [edx + ecx*4 + 0x3b0]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov eax, dword [ebx + 8]
mov edx, dword [esp + 0x10]
mov ecx, eax
shl ecx, 9
cmp edx, ecx
je 0x4068b8
cmp eax, 1
jne 0x406828
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xf0
ret 0xc
mov ecx, 0xf
lea esi, [esp + 0x1c]
lea edi, [esp + 0x9c]
mov dword [esp + 0x18], 0
rep movsd dword es:[edi], dword [esi]
test eax, eax
movsw word es:[edi], word [esi]
jbe 0x4068a9
mov esi, dword [esp + 0x10c]
mov edx, dword [esp + 0x108]
push esi
lea eax, [esp + 0xa0]
push edx
push eax
mov ecx, ebp
mov dword [esp + 0xb0], 1
call fcn.00406530
test eax, eax
jne 0x406884
mov ecx, 0x80
mov eax, 0xe5e5e5e5
mov edi, esi
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0xb6]
mov ecx, dword [ebx + 8]
inc eax
add esi, 0x200
mov dword [esp + 0xb6], eax
mov eax, dword [esp + 0x18]
inc eax
cmp eax, ecx
mov dword [esp + 0x18], eax
jb 0x40684f
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xf0
ret 0xc
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xf0
ret 0xc