Function at 0x508580
Capabilities:
Read file on windows

Disassembly:
push ebp
push ebx
sub esp, 0x3b4
lea edx, [esp + 0x3b0]
mov dword [esp + 0x64], ecx
mov dword [esp + 0x94], 0x607c20
mov dword [esp + 0x98], 0x60f0bc
mov dword [esp + 0xa0], 0x5099d6
mov dword [esp + 0x9c], edx
lea edx, [esp + 0x7c]
mov dword [esp + 0xa4], esp
mov dword [esp], edx
call fcn.004cf190
mov ecx, dword [esp + 0x64]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 3
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [esp + 0x80], 0xffffffff
call fcn.0051b7a0
sub esp, 0x14
mov eax, dword [esp + 0x64]
mov dword [eax], 0x7420e4
mov eax, dword [esp + 0x3c0]
mov dword [esp + 4], 0x65a3a4
mov dword [esp + 0x80], 1
mov dword [esp], eax
call fcn.00608a20
test eax, eax
mov dword [esp + 0x28], eax
je 0x508a87
mov dword [esp], eax
mov dword [esp + 0x80], 1
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
cmp byte [esp + 0x2c], 0x42
jne 0x508a15
cmp al, 0x4d
jne 0x508a15
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov edx, eax
movzx eax, byte [esp + 0x40]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2c]
shl eax, 8
mov ecx, eax
mov eax, dword [esp + 0x28]
or ecx, edx
mov dword [esp], eax
mov dword [esp + 0x44], ecx
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov edx, eax
movzx eax, byte [esp + 0x40]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2c]
shl eax, 8
mov ecx, eax
mov eax, dword [esp + 0x28]
or ecx, edx
cmp ecx, 0x27
mov dword [esp + 0x40], ecx
mov dword [esp], eax
jg 0x508a94
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov edx, eax
movzx eax, byte [esp + 0x2c]
shl edx, 8
or eax, edx
mov edx, dword [esp + 0x64]
movzx eax, ax
mov dword [edx + 4], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ebx, eax
movzx eax, byte [esp + 0x2c]
shl ebx, 8
mov edx, ebx
or eax, edx
mov edx, dword [esp + 0x64]
movzx eax, ax
mov dword [edx + 8], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov edx, eax
movzx eax, byte [esp + 0x2c]
mov ecx, dword [esp + 0x40]
shl edx, 8
mov byte [esp + 0x63], 0
mov dword [esp + 0x70], 0xffffffff
mov dword [esp + 0x30], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x4c], 3
or eax, edx
movzx eax, ax
mov dword [esp + 0x6c], eax
lea eax, [ecx - 0xc]
mov dword [esp + 0x2c], eax
mov ecx, dword [esp + 0x2c]
test ecx, ecx
jle 0x5088bf
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
sub dword [esp + 0x2c], 1
jne 0x5088a1
mov eax, dword [esp + 0x64]
mov edx, dword [eax + 4]
test edx, edx
je 0x508a4e
mov eax, dword [eax + 8]
test eax, eax
je 0x508a4e
mov ebx, dword [esp + 0x6c]
test ebx, ebx
je 0x508a4e
mov eax, dword [esp + 0x30]
test eax, eax
jne 0x508e25
cmp dword [esp + 0x6c], 8
jg 0x508e25
movzx ecx, byte [esp + 0x6c]
mov eax, 1
shl eax, cl
mov dword [esp + 0x30], eax
lea eax, [esp + 0xb0]
cmp dword [esp + 0x40], 0xc
mov edx, eax
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x30]
lea eax, [eax + eax*2]
mov ecx, eax
jg 0x5098a3
add ecx, edx
mov dword [esp + 0x30], ecx
mov eax, dword [esp + 0x28]
mov dword [esp + 8], 3
mov dword [esp + 4], 1
mov dword [esp + 0x80], 1
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fread
add dword [esp + 0x2c], 3
mov eax, dword [esp + 0x2c]
cmp eax, dword [esp + 0x30]
jne 0x508933
cmp dword [esp + 0x6c], 0x10
je 0x509903
cmp dword [esp + 0x6c], 0x20
mov eax, 4
mov dword [esp + 0x78], 0
cmovne eax, dword [esp + 0x4c]
mov dword [esp + 0x4c], eax
mov edx, dword [esp + 0x64]
mov dword [edx + 0xc], eax
mov edx, dword [esp + 0x44]
test edx, edx
je 0x5089c9
mov eax, dword [esp + 0x44]
mov dword [esp + 8], 0
mov dword [esp + 4], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_fseek
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 0xc]
mov ecx, dword [esp + 0x64]
mov edx, dword [ecx + 8]
imul edx, dword [ecx + 4]
imul eax, edx
cmp dword [0x61fe74], eax
jae 0x508e40
mov eax, dword [esp + 0x3c0]
mov dword [esp], str.BMP_file___s__is_too_large__n
mov dword [esp + 0x80], 1
mov dword [esp + 4], eax
mov eax, dword [0x62117c]
call eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_fclose
jmp 0x508a65
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov eax, dword [esp + 0x64]
mov dword [eax + 0x10], 0xfffffffd
lea eax, [esp + 0x7c]
mov dword [esp], eax
call fcn.004cf200
add esp, 0x3b4
pop ebx
pop ebp
ret 4
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_fclose
mov eax, dword [esp + 0x64]
mov dword [eax + 4], 0
mov dword [eax + 8], 0
mov dword [eax + 0xc], 0
mov dword [eax + 0x10], 0xfffffffd
jmp 0x508a37
mov eax, dword [esp + 0x64]
mov dword [eax + 0x10], 0xfffffffe
jmp 0x508a37
mov dword [esp + 0x80], 1
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov edx, eax
movzx eax, byte [esp + 0x48]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2c]
shl eax, 8
or eax, edx
mov edx, dword [esp + 0x64]
mov dword [edx + 4], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov ecx, dword [esp + 0x64]
mov edx, eax
movzx eax, byte [esp + 0x48]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x2c]
shl edx, 8
or eax, edx
cdq
and edx, 2
sub edx, 1
mov dword [esp + 0x70], edx
cdq
xor eax, edx
mov dword [ecx + 8], eax
mov eax, dword [esp + 0x28]
sub dword [ecx + 8], edx
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov edx, eax
movzx eax, byte [esp + 0x2c]
shl edx, 8
or eax, edx
movzx ebx, ax
mov eax, dword [esp + 0x28]
mov dword [esp + 0x6c], ebx
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov edx, eax
movzx eax, byte [esp + 0x48]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2c]
shl eax, 8
mov ebp, eax
mov eax, dword [esp + 0x28]
or ebp, edx
mov dword [esp], eax
mov dword [esp + 0x5c], ebp
call sub.msvcrt.dll_getc
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x4c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x50], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x54], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x58], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov edx, eax
movzx eax, byte [esp + 0x58]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2c]
shl eax, 8
mov ebp, eax
mov eax, dword [esp + 0x28]
or ebp, edx
mov dword [esp], eax
mov dword [esp + 0x30], ebp
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x40]
mov ebx, dword [esp + 0x5c]
sub eax, 0x28
test ebx, ebx
mov dword [esp + 0x2c], eax
jne 0x508e13
mov ebx, dword [esp + 0x6c]
cmp ebx, 7
jle 0x508e13
mov eax, 0x20
mov ecx, dword [esp + 0x64]
cdq
idiv ebx
mov ecx, dword [ecx + 4]
cmp eax, ecx
jge 0x508df9
mov eax, dword [esp + 0x64]
sar ebx, 3
imul ebx, ecx
mov edx, dword [eax + 8]
lea eax, [ecx + 7]
add ebx, 3
sar eax, 3
and ebx, 0xfffffffc
add eax, 3
and eax, 0xfffffffc
add ebx, eax
movzx eax, byte [esp + 0x54]
imul ebx, edx
shl eax, 8
mov ecx, eax
movzx eax, byte [esp + 0x50]
or eax, ecx
shl eax, 8
mov ecx, eax
movzx eax, byte [esp + 0x4c]
or eax, ecx
shl eax, 8
mov ecx, eax
movzx eax, byte [esp + 0x48]
or eax, ecx
add eax, eax
cmp ebx, eax
je 0x5099ac
mov byte [esp + 0x63], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x4c], 3
jmp 0x508899
mov byte [esp + 0x63], 0
mov dword [esp + 0x4c], 3
jmp 0x508899
mov ecx, dword [esp + 0x30]
test ecx, ecx
jg 0x50890c
jmp 0x508971
mov dword [esp], eax
mov dword [esp + 0x80], 1
call fcn.00606c50
cmp dword [esp + 0x70], 0xffffffff
mov edx, dword [esp + 0x64]
mov dword [edx + 0x1c], eax
mov dword [edx + 0x20], 1
mov edx, dword [edx + 8]
je 0x509987
mov dword [esp + 0x74], edx
mov dword [esp + 0x68], 0
mov ecx, edx
cmp dword [esp + 0x68], ecx
je 0x509733
mov ecx, dword [esp + 0x64]
mov edx, eax
mov byte [esp + 0x50], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x40], 0
mov dword [esp + 0x48], 0
mov dword [esp + 0x58], 0
mov eax, dword [ecx + 4]
mov dword [esp + 0x44], eax
imul eax, dword [esp + 0x68]
imul eax, dword [ecx + 0xc]
add eax, edx
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x6c]
cmp eax, 0x20
ja case.0x508ed1.0
jmp dword [eax*4 + 0x65a3c4]
mov eax, dword [esp + 0x44]
test eax, eax
jle case.0x508ed1.0
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ebx, dword [esp + 0x30]
mov byte [ebx + 2], al
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ebx, dword [esp + 0x30]
mov byte [ebx + 1], al
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ebx, dword [esp + 0x30]
mov byte [ebx], al
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ebx, dword [esp + 0x30]
mov byte [ebx + 3], al
mov eax, dword [esp + 0x4c]
add ebx, eax
sub dword [esp + 0x44], 1
mov dword [esp + 0x30], ebx
jne 0x508ee0
mov esi, esi
lea edi, [edi]
mov edx, dword [esp + 0x70]
add dword [esp + 0x68], edx
mov eax, dword [esp + 0x68]
cmp dword [esp + 0x74], eax
je 0x509738
mov eax, dword [esp + 0x64]
mov edx, dword [eax + 0x1c]
mov ecx, eax
jmp 0x508eb2
mov eax, dword [esp + 0x44]
test eax, eax
jle 0x50905d
mov byte [esp + 0x54], 0xf0
jmp 0x508ff7
cmp dword [esp + 0x5c], 2
mov dword [esp + 0x48], 1
je 0x5090dc
cmp byte [esp + 0x54], 0xf0
mov dword [esp + 0x58], 0xffffffff
je 0x509672
mov eax, dword [esp + 0x40]
mov ebx, dword [esp + 0x30]
mov byte [esp + 0x54], 0xf0
and eax, 0xf
lea eax, [eax + eax*2]
movzx edx, byte [esp + eax + 0xb2]
mov byte [ebx], dl
movzx edx, byte [esp + eax + 0xb1]
mov byte [ebx + 1], dl
movzx eax, byte [esp + eax + 0xb0]
mov byte [ebx + 2], al
lea eax, [ebx + 3]
mov dword [esp + 0x30], eax
sub dword [esp + 0x44], 1
je 0x50905d
mov eax, dword [esp + 0x48]
test eax, eax
je 0x508f90
sub dword [esp + 0x48], 1
cmp byte [esp + 0x54], 0xf0
jne 0x508fb6
mov edx, dword [esp + 0x58]
test edx, edx
mov eax, edx
js 0x509672
sar eax, 4
mov dword [esp + 0x40], edx
and eax, 0xf
lea eax, [eax + eax*2]
mov ecx, dword [esp + 0x30]
sub dword [esp + 0x44], 1
mov byte [esp + 0x54], 0xf
movzx edx, byte [esp + eax + 0xb2]
mov byte [ecx], dl
movzx edx, byte [esp + eax + 0xb1]
mov byte [ecx + 1], dl
movzx eax, byte [esp + eax + 0xb0]
mov byte [ecx + 2], al
lea eax, [ecx + 3]
mov dword [esp + 0x30], eax
jne 0x508ff7
mov eax, dword [esp + 0x5c]
test eax, eax
jne case.0x508ed1.0
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
mov dword [esp + 0x30], eax
add eax, 1
mov edx, eax
shr edx, 0x1f
add eax, edx
sar eax, 1
test al, 3
mov dword [esp + 0x40], eax
je case.0x508ed1.0
lea esi, [esi]
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x40], 1
mov eax, dword [esp + 0x40]
test al, 3
jne 0x509090
jmp case.0x508ed1.0
mov eax, dword [esp + 0x28]
sub dword [esp + 0x2c], 1
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x5090c0
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x48], eax
test eax, eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
jne 0x509631
call sub.msvcrt.dll_getc
test eax, eax
mov dword [esp + 0x48], eax
jne 0x509698
add dword [esp + 0x44], 1
mov dword [esp + 0x2c], 0
jmp 0x508ff0
mov eax, dword [esp + 0x44]
test eax, eax
jle 0x5091fe
mov edx, dword [esp + 0x30]
lea eax, [eax + eax*2 + 3]
mov byte [esp + 0x30], pe_nt_image_headers32
lea ecx, [edx + 3]
add eax, edx
mov dword [esp + 0x44], eax
mov dword [esp + 0x40], ecx
jmp 0x5091a1
movzx eax, byte [esp + 0xb5]
mov edx, dword [esp + 0x40]
mov byte [edx - 3], al
movzx eax, byte [esp + 0xb4]
mov byte [edx - 2], al
movzx eax, byte [esp + 0xb3]
mov byte [edx - 1], al
movzx eax, bl
cmp al, 1
je 0x5091e3
shr eax, 1
add dword [esp + 0x40], 3
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x40]
cmp eax, dword [esp + 0x44]
je 0x5091f7
cmp byte [esp + 0x30], 0x80
je 0x509652
movzx ebx, byte [esp + 0x30]
test byte [esp + 0x50], bl
jne 0x509160
movzx eax, byte [esp + 0xb2]
mov edx, dword [esp + 0x40]
mov byte [edx - 3], al
movzx eax, byte [esp + 0xb1]
mov byte [edx - 2], al
movzx eax, byte [esp + 0xb0]
mov byte [edx - 1], al
movzx eax, bl
cmp al, 1
jne 0x50918c
add dword [esp + 0x40], 3
mov byte [esp + 0x30], pe_nt_image_headers32
mov eax, dword [esp + 0x40]
cmp eax, dword [esp + 0x44]
jne 0x5091a1
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
lea edx, [eax + 0xe]
add eax, 7
cmovs eax, edx
sar eax, 3
test al, 3
mov dword [esp + 0x40], eax
je case.0x508ed1.0
lea esi, [esi]
lea edi, [edi]
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x40], 1
mov eax, dword [esp + 0x40]
test al, 3
jne 0x509220
jmp case.0x508ed1.0
mov ecx, dword [esp + 0x44]
test ecx, ecx
jle 0x5099a3
mov edx, dword [esp + 0x78]
test edx, edx
jne 0x509310
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov edx, dword [esp + 0x28]
mov dword [esp + 0x40], eax
mov dword [esp], edx
call sub.msvcrt.dll_getc
movzx edx, byte [esp + 0x40]
mov ebx, dword [esp + 0x30]
movzx eax, al
lea ecx, [edx*8]
sar edx, 2
and edx, 0x38
mov byte [ebx + 2], cl
mov ecx, eax
add eax, eax
and eax, 0xfffffff8
shl ecx, 6
mov byte [ebx], al
mov eax, dword [esp + 0x4c]
or edx, ecx
mov byte [ebx + 1], dl
add ebx, eax
sub dword [esp + 0x44], 1
mov dword [esp + 0x30], ebx
jne 0x509261
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
add eax, eax
test al, 2
mov dword [esp + 0x40], eax
je case.0x508ed1.0
nop
lea esi, [esi]
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x40], 1
mov eax, dword [esp + 0x40]
test al, 3
jne 0x5092e0
jmp case.0x508ed1.0
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov edx, dword [esp + 0x28]
mov dword [esp + 0x40], eax
mov dword [esp], edx
call sub.msvcrt.dll_getc
movzx edx, byte [esp + 0x40]
mov ebx, dword [esp + 0x30]
lea ecx, [edx*8]
sar edx, 3
and edx, 0x1c
mov byte [ebx + 2], cl
mov ecx, eax
and eax, 0xfffffff8
mov byte [ebx], al
mov eax, dword [esp + 0x4c]
shl ecx, 5
or edx, ecx
mov byte [ebx + 1], dl
add ebx, eax
sub dword [esp + 0x44], 1
mov dword [esp + 0x30], ebx
jne 0x509310
jmp 0x5092c6
mov edx, dword [esp + 0x44]
test edx, edx
jg 0x5093f6
jmp 0x509487
mov dword [esp + 0x48], 1
mov dword [esp + 0x58], 0xffffffff
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x40], eax
lea eax, [eax + eax*2]
mov ecx, dword [esp + 0x30]
sub dword [esp + 0x48], 1
cmp byte [esp + 0x63], 0
movzx edx, byte [esp + eax + 0xb2]
mov byte [ecx], dl
movzx edx, byte [esp + eax + 0xb1]
mov byte [ecx + 1], dl
movzx eax, byte [esp + eax + 0xb0]
lea edx, [ecx + 4]
mov byte [ecx + 2], al
lea eax, [ecx + 3]
cmovne eax, edx
sub dword [esp + 0x44], 1
mov dword [esp + 0x30], eax
je 0x509487
cmp dword [esp + 0x5c], 1
jne 0x509382
mov eax, dword [esp + 0x48]
test eax, eax
je 0x50942c
jmp 0x509a15
mov eax, dword [esp + 0x28]
sub dword [esp + 0x2c], 1
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x509410
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x48], eax
test eax, eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
jne 0x509580
call sub.msvcrt.dll_getc
test eax, eax
mov dword [esp + 0x48], eax
jne 0x5095b5
add dword [esp + 0x44], 1
mov dword [esp + 0x2c], 0
sub dword [esp + 0x44], 1
jne 0x5093f6
mov ecx, dword [esp + 0x5c]
test ecx, ecx
jne case.0x508ed1.0
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
test al, 3
mov dword [esp + 0x40], eax
je case.0x508ed1.0
lea esi, [esi]
lea edi, [edi]
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x40], 1
mov eax, dword [esp + 0x40]
test al, 3
jne 0x5094b0
jmp case.0x508ed1.0
mov ebx, dword [esp + 0x44]
test ebx, ebx
jle 0x509a0c
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ecx, dword [esp + 0x30]
mov byte [ecx + 2], al
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ecx, dword [esp + 0x30]
mov byte [ecx + 1], al
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov ecx, dword [esp + 0x30]
mov byte [ecx], al
mov eax, dword [esp + 0x4c]
add ecx, eax
sub dword [esp + 0x44], 1
mov dword [esp + 0x30], ecx
jne 0x5094e5
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
lea eax, [eax + eax*2]
test al, 3
mov dword [esp + 0x40], eax
je case.0x508ed1.0
nop
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x40], 1
mov eax, dword [esp + 0x40]
test al, 3
jne 0x509550
jmp case.0x508ed1.0
mov dword [esp + 0x80], 1
call sub.msvcrt.dll_getc
mov dword [esp + 0x40], eax
mov dword [esp + 0x2c], 0
mov ebx, dword [esp + 0x40]
mov eax, dword [esp + 0x40]
test ebx, ebx
mov dword [esp + 0x58], eax
jns 0x5093ad
jmp 0x509392
cmp eax, 1
je 0x509726
mov edx, eax
mov dword [esp + 0x58], 0xffffffff
and edx, 1
cmp eax, 2
mov dword [esp + 0x2c], edx
jne 0x509392
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
imul eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x64]
mov dword [esp + 0x40], 0
mov dword [esp + 0x2c], 0
mov dword [esp + 0x58], 0
imul eax, dword [edx + 4]
mov dword [esp + 0x48], eax
mov eax, dword [esp + 0x40]
jmp 0x5093ad
mov dword [esp + 0x80], 1
call sub.msvcrt.dll_getc
mov dword [esp + 0x58], eax
mov dword [esp + 0x2c], 0
jmp 0x508fff
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov byte [esp + 0x50], al
jmp 0x5091ac
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x40], eax
sar eax, 4
and eax, 0xf
jmp 0x509023
cmp eax, 1
je 0x509726
cmp eax, 2
je 0x5096cb
mov edx, eax
mov ecx, 4
and eax, 3
sub ecx, eax
mov eax, ecx
sar eax, 1
and eax, 1
mov dword [esp + 0x2c], eax
mov eax, edx
sub eax, 1
mov dword [esp + 0x48], eax
jmp 0x508fa3
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
imul eax, dword [esp + 0x2c]
mov edx, dword [esp + 0x64]
imul eax, dword [edx + 4]
sub eax, 1
cmp byte [esp + 0x54], 0xf0
mov dword [esp + 0x48], eax
je 0x509884
mov dword [esp + 0x2c], 0
mov dword [esp + 0x58], 0
jmp 0x508fb6
mov dword [esp + 0x2c], 0
jmp case.0x508ed1.0
mov byte [esp + 0x50], 0
cmp byte [esp + 0x63], 0
je 0x509836
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 8]
mov dword [esp + 0x2c], eax
sub eax, 1
mov dword [esp + 0x44], eax
js 0x509836
mov edx, dword [esp + 0x64]
mov eax, dword [edx + 4]
mov ecx, eax
mov dword [esp + 0x40], eax
imul eax, dword [esp + 0x44]
imul eax, dword [edx + 0xc]
mov edx, dword [edx + 0x1c]
test ecx, ecx
lea eax, [edx + eax + 3]
mov dword [esp + 0x30], eax
jle 0x50987d
mov byte [esp + 0x2c], pe_nt_image_headers32
jmp 0x5097aa
movzx eax, byte [esp + 0x2c]
mov edx, dword [esp + 0x4c]
add dword [esp + 0x30], edx
shr eax, 1
sub dword [esp + 0x40], 1
mov dword [esp + 0x2c], eax
je 0x5097e5
cmp byte [esp + 0x2c], 0x80
je 0x509852
movzx ebx, byte [esp + 0x2c]
movzx ecx, byte [esp + 0x50]
mov edx, dword [esp + 0x30]
test bl, cl
sete al
neg eax
cmp bl, 1
mov byte [edx], al
jne 0x509790
mov edx, dword [esp + 0x4c]
add dword [esp + 0x30], edx
sub dword [esp + 0x40], 1
mov byte [esp + 0x2c], pe_nt_image_headers32
jne 0x5097aa
mov eax, dword [esp + 0x64]
mov eax, dword [eax + 4]
lea edx, [eax + 0xe]
add eax, 7
cmovs eax, edx
sar eax, 3
test al, 3
mov dword [esp + 0x2c], eax
je 0x509824
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x2c], 1
mov eax, dword [esp + 0x2c]
test al, 3
jne 0x509800
sub dword [esp + 0x44], 1
mov eax, dword [esp + 0x44]
cmp eax, 0xffffffff
jne 0x50975b
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_fclose
jmp 0x508a37
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov edx, dword [esp + 0x30]
mov byte [esp + 0x50], al
not eax
sar al, 7
mov byte [edx], al
jmp 0x509790
mov eax, ecx
jmp 0x5097ec
xor eax, eax
mov dword [esp + 0x2c], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x40], 0
jmp 0x509023
add ecx, edx
mov dword [esp + 0x30], ecx
mov eax, dword [esp + 0x28]
mov dword [esp + 8], 3
mov dword [esp + 4], 1
mov dword [esp + 0x80], 1
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0x2c]
mov dword [esp], eax
call sub.msvcrt.dll_fread
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
add dword [esp + 0x2c], 3
mov eax, dword [esp + 0x2c]
cmp dword [esp + 0x30], eax
jne 0x5098a9
jmp 0x508971
mov eax, dword [esp + 0x28]
mov dword [esp + 0x80], 1
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x2c], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
mov dword [esp + 0x40], eax
mov eax, dword [esp + 0x28]
mov dword [esp], eax
call sub.msvcrt.dll_getc
movzx eax, al
mov edx, eax
movzx eax, byte [esp + 0x40]
shl edx, 8
or eax, edx
mov edx, eax
movzx eax, byte [esp + 0x30]
shl edx, 8
or eax, edx
movzx edx, byte [esp + 0x2c]
shl eax, 8
or eax, edx
cmp eax, 0xf800
sete al
movzx eax, al
mov dword [esp + 0x78], eax
mov eax, dword [esp + 0x4c]
jmp 0x508997
mov dword [esp + 0x2c], edx
sub edx, 1
mov dword [esp + 0x74], 0xffffffff
mov dword [esp + 0x68], edx
mov ecx, dword [esp + 0x74]
jmp 0x508e7d
mov eax, dword [esp + 0x44]
jmp 0x5092cd
mov eax, edx
mov byte [esp + 0x63], 1
mov dword [esp + 0x5c], 0
shr eax, 0x1f
mov dword [esp + 0x4c], 4
add eax, edx
mov edx, dword [esp + 0x64]
sar eax, 1
mov dword [edx + 8], eax
jmp 0x508899
mov eax, dword [esp + 0x44]
jmp 0x509540
mov eax, dword [esp + 0x58]
mov dword [esp + 0x40], eax
jmp 0x50959c