Function at 0x10005218
Capabilities:
Print debug messages
Read file on windows
Write file on windows

Disassembly:
push edi
push esi
push ebp
push ebx
sub esp, 0x8c
mov ebp, dword [esp + 0xa0]
mov ebx, dword [esp + 0xa4]
mov edx, dword [ebx + 0xc]
mov ecx, dword [ebx + 4]
mov dword [esp + 0x10], edx
mov edx, dword [ebp + 0x4cc]
cmp edx, 0xffffffff
mov dword [esp + 0xc], ecx
je 0x10005897
mov eax, dword [ebp + 0x124]
mov dword [esp + 0x3c], 0xffffffff
xor edi, edi
xor esi, esi
mov ecx, 0x8000040
mov edx, 0x8000040
cmp eax, 4
jle 0x10005278
mov ecx, 0x8008040
mov edx, 0x8008040
mov eax, dword [ebp + 0x13c]
test eax, eax
je 0x1000528a
or ecx, 0x100
mov edx, ecx
mov eax, dword [ebp + 0x140]
test eax, eax
je 0x1000529c
or ecx, 0x400
mov edx, ecx
mov eax, dword [ebp + 0x144]
test eax, eax
je 0x100052b8
or ecx, 0x2000000
mov edx, ecx
mov edi, 0x4040000
mov esi, 0x4040000
mov eax, dword [ebp + 0x148]
test eax, eax
je 0x100052ca
or ecx, 0x10000000
mov edx, ecx
mov eax, dword [ebp + 0x14c]
test eax, eax
je 0x100052e0
or edi, 0x10100000
mov dword [esp + 0x18], edi
jmp 0x100052e4
mov dword [esp + 0x18], esi
mov esi, dword [ebp + 0x16c]
test esi, esi
je 0x100052f6
or ecx, 0x4000000
mov edx, ecx
mov esi, dword [ebp + 0x494]
test esi, esi
je 0x1000530c
or ecx, 0x200000
mov dword [esp + 0x14], ecx
jmp 0x10005310
mov dword [esp + 0x14], edx
lea edx, [esp + 0x14]
mov ecx, dword [ebp + 0x4bc]
mov eax, ebp
call fcn.10005a94
mov ecx, dword [ebp + 0x254]
test ecx, ecx
je 0x10005348
mov edx, dword [ebp]
test edx, edx
je 0x1000533c
cmp edx, 1
je 0x1000533c
cmp edx, 2
jne 0x10005348
mov dword [ebp + 0x254], 0
xor ecx, ecx
test ecx, ecx
je 0x10005358
mov edx, dword [ebp]
cmp edx, 3
je 0x100056dd
test ecx, ecx
je 0x10005371
mov edx, dword [ebp]
cmp edx, 4
je 0x10005702
cmp edx, 5
je 0x10005702
mov edx, dword [esp + 0x18]
mov ecx, dword [ebp + 0x124]
or edx, dword [ecx*4 + 0x10083044]
mov ecx, dword [ebp + 0x130]
cmp ecx, 1
je 0x10005880
cmp ecx, 2
je 0x100053da
cmp ecx, 3
jne 0x100053b5
mov ecx, dword [esp + 0x14]
or ecx, 0x400000
mov dword [esp + 0x14], ecx
or edx, 0x2f00
mov dword [esp + 0x18], edx
jmp 0x100053f2
cmp ecx, 4
jne 0x100053d4
mov ecx, dword [esp + 0x14]
or ecx, 0x400000
mov dword [esp + 0x14], ecx
or edx, 0x3f00
mov dword [esp + 0x18], edx
jmp 0x100053f2
mov dword [esp + 0x18], edx
jmp 0x100053f2
mov ecx, dword [esp + 0x14]
or ecx, 0x400000
mov dword [esp + 0x14], ecx
or edx, 0x500
mov dword [esp + 0x18], edx
mov eax, dword [esp + 0x10]
mov edx, dword [ebx + 0x10]
mov dword [esp + 0x24], edx
mov ecx, dword [ebx + 0xc]
movzx esi, word [ecx + 0xe]
imul esi, dword [ecx + 4]
add esi, 0x1f
and esi, 0xffffffe0
sar esi, 3
mov dword [esp + 0x28], esi
call fcn.10006088
cmp eax, 0x270f
je 0x100055d0
mov dword [esp + 0x2c], eax
cmp eax, 4
je 0x10005433
cmp eax, 1
jne 0x10005449
mov ecx, dword [esp + 0x28]
mov eax, 0x55555556
add ecx, ecx
imul ecx
sar ecx, 0x1f
sub edx, ecx
mov dword [esp + 0x28], edx
mov edx, dword [ebx + 8]
mov dword [esp + 0x1c], edx
mov ecx, dword [ebx + 4]
mov esi, dword [ecx + 0x14]
mov dword [esp + 0x20], esi
mov edx, dword [ebp]
test edx, edx
je 0x10005873
jg 0x10005482
push 0x103206a4
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 0xffffff9c
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
cmp edx, 3
jle 0x10005511
cmp edx, 4
jl 0x10005467
cmp edx, 5
jle 0x100054bb
cmp edx, 6
jne 0x10005467
mov edx, dword [esp + 0xc]
mov dword [edx + 0x14], 0
mov ecx, dword [ebx + 0x18]
xor eax, eax
mov dword [ecx], 0x10
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
lea edx, [esp + 0x14]
push edx
push ebp
call section..text
add esp, 8
cmp eax, 0xffffff9c
je 0x100056a2
mov edx, dword [ebp + 0x210]
test edx, edx
je 0x10005525
mov ecx, dword [esp + 0xc]
mov edx, dword [ebp + 0x4dc]
mov dword [ecx + 0x14], edx
mov eax, dword [ebp + 0x1461c]
test eax, 0x80000000
je 0x100054fd
mov eax, 0x10
jmp 0x100054ff
xor eax, eax
mov edx, dword [ebx + 0x18]
mov dword [edx], eax
xor eax, eax
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
lea edx, [esp + 0x14]
mov eax, ebp
call fcn.100058c0
cmp eax, 0xffffff9c
je 0x100056a2
mov edx, dword [ebp + 0x128]
test edx, edx
jne 0x1000553c
mov edx, dword [esp + 0x14]
or edx, 0x10
mov dword [esp + 0x14], edx
jmp 0x1000555a
mov ecx, dword [esp + 0x14]
or ecx, 0x20
cmp edx, 2
je 0x10005853
mov dword [esp + 0x14], ecx
xor edx, edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], edx
mov edx, dword [ebp + 0x124]
test edx, edx
jne 0x1000556e
mov dword [esp + 0x3c], 1
jmp 0x1000558e
mov edx, dword [ebp + 0x4c0]
cmp edx, dword [ebp + 0x138]
jge 0x1000558e
mov edx, dword [ebp + 0x4bc]
test edx, edx
je 0x1000558e
mov dword [esp + 0x3c], 0
lea ecx, [esp + 0x14]
lea edx, [esp + 0x68]
xor esi, esi
mov dword [esp + 0x58], esi
push edx
push ecx
push esi
push dword [ebp + 0x4b0]
call sym.xvid.dll_xvid_encore
add esp, 0x10
cmp eax, 0xffffffff
je 0x100056a2
cmp eax, 1
jne 0x100055cb
mov eax, 0xfffffffd
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
cmp eax, 2
jne 0x100055e0
mov eax, 0xfffffffe
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
mov edx, dword [esp + 0x3c]
cmp edx, 1
je 0x1000583b
mov edx, dword [ebx + 0x18]
mov dword [edx], 0
mov edx, dword [esp + 0x20]
test edx, edx
jne 0x10005611
mov edx, dword [esp + 0x1c]
mov dword [esp + 0x20], 1
mov byte [edx], 0x7f
mov edx, dword [esp + 0x20]
mov ecx, dword [esp + 0xc]
mov dword [ecx + 0x14], edx
mov edx, dword [ebp]
cmp edx, 3
je 0x1000581f
mov edx, dword [esp + 0x14]
test edx, 0x2000
je 0x100056b2
mov ebx, dword [esp + 0x54]
mov eax, dword [ebp + 0x4c8]
cmp eax, 0xffffffff
je 0x100057db
lea ecx, [esp + 0x54]
lea edx, [esp + 0x88]
push 0
push edx
push 4
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10005697
mov edx, dword [esp + 0x88]
cmp edx, 4
jne 0x10005697
lea edx, [esp + 0x88]
push 0
push edx
push ebx
push dword [esp + 0x5c]
push dword [ebp + 0x4c8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x10005697
cmp ebx, dword [esp + 0x88]
je 0x100056b2
push 0x103206d8
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 0xffffff9c
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
lea ecx, [esp + 0x14]
lea edx, [esp + 0x68]
push edx
push ecx
push ebp
call fcn.1000219c
add dword [ebp + 0x4bc], 1
xor eax, eax
add dword [ebp + 0x4c0], 1
add esp, 0x98
pop ebx
pop ebp
pop esi
pop edi
ret
mov ecx, dword [esp + 0x14]
mov edx, dword [ebp + 0x4d4]
mov dword [esp + 0x40], 0
or ecx, 0x2000
mov dword [esp + 0x50], edx
mov dword [esp + 0x14], ecx
jmp 0x10005371
mov ecx, dword [esp + 0x14]
mov edx, dword [ebp + 0x4d4]
mov eax, dword [ebp + 0x4c8]
mov dword [esp + 0x50], edx
or ecx, 0x4000
mov dword [esp + 0x40], 0
mov dword [esp + 0x14], ecx
cmp eax, 0xffffffff
je 0x10005797
lea ecx, [esp + 0x64]
lea edx, [esp + 0x60]
push 0
push edx
push 4
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000577c
mov edx, dword [esp + 0x60]
cmp edx, 4
jne 0x1000577c
lea edx, [esp + 0x60]
push 0
push edx
push dword [esp + 0x6c]
push dword [esp + 0x5c]
push dword [ebp + 0x4c8]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1000577c
mov edx, dword [esp + 0x60]
cmp edx, dword [esp + 0x64]
je 0x10005371
push 0x10320684
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 0xffffff9c
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
lea ecx, [ebp + 0x258]
xor edx, edx
push edx
push edx
push 3
push edx
push edx
push 0x80000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp + 0x4c8], eax
cmp eax, 0xffffffff
jne 0x1000572d
push 0x10320668
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 0xffffff9c
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
lea ecx, [ebp + 0x258]
xor edx, edx
push edx
push edx
push 2
push edx
push edx
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp + 0x4c8], eax
cmp eax, 0xffffffff
jne 0x10005647
push 0x103206bc
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, 0xffffff9c
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret
mov edx, dword [ebp + 0x20c]
test edx, edx
je 0x10005624
mov edx, ecx
mov dword [edx + 0x14], 0
jmp 0x10005624
mov dword [ebp + 0x4c0], 0
mov edx, dword [ebx + 0x18]
mov dword [edx], 0x10
jmp 0x100055f6
or ecx, 4
mov dword [esp + 0x14], ecx
lea edx, [ebp + 0x180]
lea ecx, [ebp + 0x1c0]
mov dword [esp + 0x30], edx
mov dword [esp + 0x34], ecx
jmp 0x1000555a
mov dword [esp + 0x38], 0
jmp 0x10005525
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x14]
or edx, 0x400000
mov dword [esp + 0x14], edx
jmp 0x100053f2
push ebp
call fcn.10002714
pop ecx
cmp eax, 0xffffff9c
jne 0x1000524d
mov eax, 0xffffff9c
add esp, 0x8c
pop ebx
pop ebp
pop esi
pop edi
ret