Function at 0x401310
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push edi
xor edi, edi
push edi
push 0x80
push 3
push edi
push 1
push SysReAllocString
push 0x410e88
mov dword [ebp - 8], edi
mov dword [ebp - 4], edi
mov dword [ebp - 0xc], edi
call dword [sym.imp.kernel32.dll_CreateFileA]
push 2
push edi
mov ebx, eax
push 0xffffffffffffffec
push ebx
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
jne 0x40135e
push ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
pop edi
pop ebx
mov esp, ebp
pop ebp
ret
push esi
mov esi, dword [sym.imp.kernel32.dll_ReadFile]
push edi
lea eax, [ebp - 4]
push eax
push 4
lea ecx, [ebp - 8]
push ecx
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], 4
jb 0x4016f3
mov eax, dword [ebp - 8]
mov edx, eax
and edx, 0xff00
mov ecx, eax
shl ecx, 0x10
or edx, ecx
mov ecx, eax
and ecx, 0xff0000
shr eax, 0x10
or ecx, eax
shl edx, 8
shr ecx, 8
or edx, ecx
cmp edx, 0x38424452
jne 0x4016f3
push edi
lea edx, [ebp - 4]
push edx
push 4
lea eax, [ebp - 0x14]
push eax
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], 4
jb 0x4016f3
mov ecx, dword [ebp - 0x14]
call fcn.00401260
cmp eax, 5
jne 0x4016f3
push edi
lea ecx, [ebp - 4]
push ecx
push 4
lea edx, [ebp - 0xc]
push edx
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], 4
jb 0x4016f3
mov ecx, dword [ebp - 0xc]
call fcn.00401260
push edi
push edi
push eax
push ebx
mov dword [ebp - 0xc], eax
call dword [sym.imp.kernel32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x4016f3
push edi
lea eax, [ebp - 4]
push eax
push 4
lea ecx, [ebp - 8]
push ecx
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], 4
jb 0x4016f3
mov ecx, dword [ebp - 8]
call fcn.00401260
cmp eax, 0x38424452
jne 0x4016f3
lea esi, [ebp - 0x18]
mov edi, 0x41004c
call fcn.00401290
mov esi, 0x4110c8
mov edi, 0x411090
call fcn.00401290
mov esi, dword [sym.imp.kernel32.dll_ReadFile]
push 0
lea edx, [ebp - 4]
push edx
mov edi, 1
push edi
push 0x41108b
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
push 0
lea eax, [ebp - 4]
push eax
push edi
push 0x411089
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
push 0
lea ecx, [ebp - 4]
push ecx
push edi
push 0x411088
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
push 0
lea edx, [ebp - 4]
push edx
push edi
push 0x410e81
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
push 0
lea eax, [ebp - 4]
push eax
push edi
push 0x410e83
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
push 0
lea ecx, [ebp - 4]
push ecx
push 4
push 0x410e84
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
mov ecx, dword [0x410e84]
call fcn.00401260
mov dword [0x410e84], eax
cmp eax, 3
jne 0x401679
push 0
lea edx, [ebp - 4]
push edx
push 4
lea eax, [ebp - 0x10]
push eax
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
mov ecx, dword [ebp - 0x10]
call fcn.00401260
push eax
push 0x40
mov dword [ebp - 0x10], eax
call dword [sym.imp.kernel32.dll_GlobalAlloc]
mov dword [0x41108c], eax
test eax, eax
je 0x4016fa
mov edx, dword [ebp - 0x10]
push 0
lea ecx, [ebp - 4]
push ecx
push edx
push eax
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
mov edi, 0x411098
push 0
lea eax, [ebp - 4]
push eax
push 4
push edi
push ebx
call esi
test eax, eax
je 0x4016f3
mov ecx, dword [edi]
call fcn.00401260
mov dword [edi], eax
add edi, 4
cmp edi, 0x4110b0
jl 0x4015c0
mov edi, 0x4110b0
lea ecx, [ecx]
lea esi, [ebp - 4]
call fcn.00401290
add edi, 4
cmp edi, 0x4110c8
jl 0x4015f0
push 0
mov ecx, esi
mov esi, dword [sym.imp.kernel32.dll_ReadFile]
push ecx
push 4
push 0x4110d4
push ebx
call esi
test eax, eax
je 0x4016f3
mov ecx, dword [0x4110d4]
call fcn.00401260
push 0
lea edx, [ebp - 4]
push edx
push 1
push 0x41108a
push ebx
mov dword [0x4110d4], eax
call esi
test eax, eax
je 0x4016f3
push 0
lea eax, [ebp - 4]
push eax
push 1
push 0x410e82
push ebx
call esi
test eax, eax
je 0x4016f3
push 0
lea ecx, [ebp - 4]
push ecx
push 1
push 0x410e80
push ebx
call esi
test eax, eax
je 0x4016f3
mov edi, 1
push 0
lea edx, [ebp - 4]
push edx
push edi
push 0x4110d0
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
cmp byte [0x4110d0], 0
je 0x4016e6
push 0
lea eax, [ebp - 4]
push eax
push 4
lea ecx, [ebp - 0x10]
push ecx
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
mov ecx, dword [ebp - 0x10]
call fcn.00401260
push eax
push 0x40
mov dword [ebp - 0x10], eax
call dword [sym.imp.kernel32.dll_GlobalAlloc]
mov dword [0x411094], eax
test eax, eax
je 0x4016fa
mov ecx, dword [ebp - 0x10]
push 0
lea edx, [ebp - 4]
push edx
push ecx
push eax
push ebx
call esi
test eax, eax
je 0x4016f3
cmp dword [ebp - 4], edi
jb 0x4016f3
lea esi, [ebp - 0x18]
mov edi, 0x4110cc
call fcn.00401290
push ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret