Function at 0x101606d0
Capabilities:
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x4c
mov edx, dword [esp + 0x5c]
mov eax, dword [esp + 0x60]
push ebx
push ebp
imul ecx, dword [edx + 0x1c], 0x4c
mov ebp, dword [edx + 0x24]
mov ebx, dword [edx + 0x28]
push esi
mov esi, dword [esp + 0x60]
push edi
imul edi, dword [edx + 0x20], 0x98
mov dword [esp + 0x10], eax
mov eax, dword [esi + 0x14]
mov dword [esp + 0x34], ebp
mov dword [esp + 0x24], ebx
add edi, dword [ecx + eax + 0x1c]
mov eax, dword [esp + 0x68]
mov dword [esp + 0x1c], edi
test byte [eax], 2
je 0x10160778
mov ecx, dword [esp + 0x78]
cmp ecx, 6
jae 0x1016074a
cmp dword [esp + 0x80], 1
jne 0x10160740
push 6
push ecx
push str.opj_t2_encode_packet__:_only__u_bytes_remaining_in_output_buffer.__u_needed._n
push 1
push dword [esp + 0x94]
call fcn.10152920
add esp, 0x14
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x4c
ret
mov edx, dword [esp + 0x70]
sub ecx, 6
mov dword [esp + 0x14], ecx
mov dword [edx], 0x40091ff
movzx eax, byte [esi + 0x349]
mov byte [edx + 4], al
movzx eax, byte [esi + 0x348]
mov byte [edx + 5], al
lea eax, [edx + 6]
mov dword [esp + 0x10], eax
jmp 0x10160780
mov eax, dword [esp + 0x78]
mov dword [esp + 0x14], eax
test ebx, ebx
jne 0x1016084a
mov eax, dword [esp + 0x1c]
add edi, 0x1c
mov dword [esp + 0x6c], edi
mov dword [esp + 0x64], ebx
cmp dword [eax + 0x18], ebx
jbe 0x10160848
push edi
call fcn.10159580
add esp, 4
test eax, eax
jne 0x10160827
lea ebx, [ebp*4]
add ebx, ebp
mov ebp, dword [edi + 0x14]
push dword [ebp + ebx*8 + 0x20]
call fcn.10162290
push dword [ebp + ebx*8 + 0x24]
call fcn.10162290
mov eax, dword [ebp + ebx*8 + 0x14]
add esp, 8
imul eax, dword [ebp + ebx*8 + 0x10]
xor esi, esi
mov dword [esp + 0x50], eax
test eax, eax
je 0x10160823
xor edi, edi
jmp 0x101607f0
mov ecx, dword [ebp + ebx*8 + 0x18]
mov eax, dword [esp + 0x6c]
mov dword [ecx + edi + 0x28], 0
mov eax, dword [eax + 0x1c]
sub eax, dword [ecx + edi + 0x1c]
push eax
push esi
push dword [ebp + ebx*8 + 0x24]
call fcn.101622d0
inc esi
lea edi, [edi + 0x34]
add esp, 0xc
cmp esi, dword [esp + 0x50]
jb 0x101607f0
mov edi, dword [esp + 0x6c]
mov ebp, dword [esp + 0x34]
mov eax, dword [esp + 0x64]
add edi, 0x24
mov ecx, dword [esp + 0x1c]
inc eax
mov dword [esp + 0x64], eax
mov dword [esp + 0x6c], edi
cmp eax, dword [ecx + 0x18]
jb 0x101607a0
mov edi, ecx
jmp 0x1016084a
mov edi, eax
call fcn.10173440
mov ebx, eax
mov dword [esp + 0x64], ebx
test ebx, ebx
je 0x10160740
mov ecx, dword [esp + 0x14]
push ecx
push dword [esp + 0x14]
push ebx
call fcn.101735b0
push 1
push 1
push ebx
call fcn.101736b0
lea eax, [edi + 0x1c]
add esp, 0x18
mov dword [esp + 0x44], eax
xor ecx, ecx
mov dword [esp + 0x50], ecx
mov dword [esp + 0x40], eax
cmp ecx, dword [edi + 0x18]
jae 0x10160b76
push eax
call fcn.10159580
add esp, 4
test eax, eax
jne 0x10160b61
mov ebx, dword [esp + 0x40]
lea edx, [ebp*4]
add edx, ebp
xor edi, edi
mov dword [esp + 0x38], edx
mov ebx, dword [ebx + 0x14]
mov dword [esp + 0x48], ebx
mov ebp, dword [ebx + edx*8 + 0x14]
imul ebp, dword [ebx + edx*8 + 0x10]
mov esi, dword [ebx + edx*8 + 0x18]
mov dword [esp + 0x54], ebp
test ebp, ebp
je 0x10160908
add esi, 4
cmp dword [esi + 0x24], 0
jne 0x10160900
mov eax, dword [esp + 0x24]
lea ecx, [eax + eax*2]
mov eax, dword [esi]
cmp dword [eax + ecx*8], 0
je 0x10160900
push dword [esp + 0x24]
push edi
push dword [ebx + edx*8 + 0x20]
call fcn.101622d0
mov edx, dword [esp + 0x44]
add esp, 0xc
inc edi
add esi, 0x34
cmp edi, ebp
jb 0x101608d6
mov eax, dword [ebx + edx*8 + 0x18]
mov dword [esp + 0x30], 0
test ebp, ebp
je 0x10160b5d
mov ecx, dword [esp + 0x24]
lea ebx, [eax + 0x20]
lea edx, [eax + 8]
mov dword [esp + 0x18], ebx
mov dword [esp + 0x20], edx
lea ebp, [ecx + ecx*2]
shl ebp, 3
lea ecx, [eax + 0x28]
add eax, 4
mov dword [esp + 0x58], ebp
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x2c], eax
mov edx, dword [eax]
xor esi, esi
add edx, ebp
xor edi, edi
xor ebp, ebp
mov dword [esp + 0x3c], edx
mov dword [esp + 0x4c], ebp
cmp dword [ecx], esi
jne 0x10160980
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x48]
inc eax
push eax
mov eax, dword [esp + 0x3c]
push dword [esp + 0x34]
push dword [ecx + eax*8 + 0x20]
push dword [esp + 0x70]
call fcn.10162000
add esp, 0x10
jmp 0x10160996
xor eax, eax
cmp dword [edx], eax
push 1
setne al
push eax
push dword [esp + 0x6c]
call fcn.101736b0
add esp, 0xc
mov eax, dword [esp + 0x3c]
cmp dword [eax], esi
jne 0x101609bb
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x6c]
add eax, 0x34
add dword [esp + 0x20], 0x34
add ecx, 0x34
add dword [esp + 0x18], 0x34
jmp 0x10160b3a
mov eax, dword [esp + 0x6c]
cmp dword [eax], esi
jne 0x101609ea
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x48]
push 0x3e7
push dword [esp + 0x34]
mov dword [ebx], 3
push dword [ecx + eax*8 + 0x24]
push dword [esp + 0x70]
call fcn.10162000
add esp, 0x10
mov ebx, dword [esp + 0x3c]
push dword [ebx]
push dword [esp + 0x68]
call fcn.10161270
mov eax, dword [esp + 0x74]
add esp, 8
mov ebx, dword [ebx]
mov ecx, dword [esp + 0x20]
mov edx, dword [eax]
add ebx, edx
mov dword [esp + 0x28], ebx
mov ecx, dword [ecx]
lea eax, [edx + edx*2]
cmp edx, ebx
jae 0x10160a7b
lea ebx, [eax*8 + 0x14]
mov eax, dword [esp + 0x28]
add ebx, ecx
add edi, dword [ebx - 4]
inc esi
test byte [ebx], 1
jne 0x10160a32
dec eax
cmp edx, eax
jne 0x10160a6b
xor eax, eax
cmp edi, 1
jle 0x10160a48
lea esp, [esp]
sar edi, 1
inc eax
cmp edi, 1
jg 0x10160a40
xor ecx, ecx
cmp esi, 1
jle 0x10160a58
nop
sar esi, 1
inc ecx
cmp esi, 1
jg 0x10160a50
mov esi, dword [esp + 0x18]
sub eax, dword [esi]
sub eax, ecx
inc eax
cmp ebp, eax
jg 0x10160a67
mov ebp, eax
xor edi, edi
xor esi, esi
mov eax, dword [esp + 0x28]
inc edx
add ebx, 0x18
cmp edx, eax
jb 0x10160a24
mov dword [esp + 0x4c], ebp
lea ebx, [ebp - 1]
test ebx, ebx
js 0x10160a9a
mov ebp, dword [esp + 0x64]
push 1
push 1
push ebp
call fcn.101736b0
add esp, 0xc
dec ebx
jns 0x10160a86
mov ebp, dword [esp + 0x4c]
push 1
push 0
push dword [esp + 0x6c]
call fcn.101736b0
mov eax, dword [esp + 0x78]
add esp, 0xc
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x20]
mov ebx, dword [eax]
add dword [edx], ebp
mov ecx, dword [ecx]
lea eax, [ebx + ebx*2]
cmp ebx, dword [esp + 0x28]
jae 0x10160b20
lea ebp, [ecx + 0x14]
lea ebp, [ebp + eax*8]
lea esp, [esp]
add edi, dword [ebp - 4]
inc esi
test byte [ebp], 1
jne 0x10160aed
mov eax, dword [esp + 0x6c]
mov ecx, dword [eax]
mov eax, dword [esp + 0x3c]
mov eax, dword [eax]
dec eax
add eax, ecx
cmp ebx, eax
jne 0x10160b16
xor ecx, ecx
cmp esi, 1
jle 0x10160afc
sar esi, 1
inc ecx
cmp esi, 1
jg 0x10160af4
mov eax, dword [edx]
add eax, ecx
push eax
push edi
push dword [esp + 0x6c]
call fcn.101736b0
mov edx, dword [esp + 0x24]
add esp, 0xc
xor edi, edi
xor esi, esi
inc ebx
add ebp, 0x18
cmp ebx, dword [esp + 0x28]
jb 0x10160ad0
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0x6c]
add eax, 0x34
add dword [esp + 0x20], 0x34
add ecx, 0x34
add edx, 0x34
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x30]
mov ebx, dword [esp + 0x18]
inc edx
mov ebp, dword [esp + 0x58]
mov dword [esp + 0x6c], ecx
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], edx
cmp edx, dword [esp + 0x54]
jb 0x10160946
mov edi, dword [esp + 0x1c]
mov ecx, dword [esp + 0x50]
mov eax, dword [esp + 0x40]
inc ecx
mov ebp, dword [esp + 0x34]
add eax, 0x24
jmp 0x10160882
mov ebx, dword [esp + 0x64]
push ebx
call fcn.10173470
add esp, 4
push ebx
test eax, eax
jne 0x10160b9a
call fcn.10173450
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
call fcn.101735e0
mov esi, dword [esp + 0x14]
mov ebp, dword [esp + 0x18]
add esi, eax
sub ebp, eax
mov dword [esp + 0x14], esi
push ebx
mov dword [esp + 0x1c], ebp
call fcn.10173450
mov eax, dword [esp + 0x70]
add esp, 8
test byte [eax], 4
je 0x10160c0e
cmp ebp, 2
jae 0x10160bfb
cmp dword [esp + 0x80], 1
jne 0x10160740
push 2
push ebp
push str.opj_t2_encode_packet__:_only__u_bytes_remaining_in_output_buffer.__u_needed._n
push 1
push dword [esp + 0x94]
call fcn.10152920
add esp, 0x14
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret
mov word [esi], 0x92ff
add esi, 2
sub ebp, 2
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], ebp
mov ebp, dword [esp + 0x7c]
test ebp, ebp
je 0x10160c43
cmp dword [ebp + 0xc], 0
je 0x10160c43
mov ecx, dword [ebp + 0x58]
mov eax, esi
imul esi, dword [esp + 0x60], 0x250
mov edi, dword [ebp + 8]
sub eax, dword [esp + 0x70]
shl edi, 5
cdq
mov ecx, dword [esi + ecx + 0x224]
mov dword [ecx + edi + 8], eax
mov dword [ecx + edi + 0xc], edx
mov edi, dword [esp + 0x44]
xor eax, eax
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x6c], eax
cmp eax, dword [ecx + 0x18]
jae 0x10160d63
push edi
call fcn.10159580
add esp, 4
test eax, eax
jne 0x10160d3e
mov eax, dword [esp + 0x34]
lea ecx, [eax + eax*4]
mov eax, dword [edi + 0x14]
mov edx, dword [eax + ecx*8 + 0x14]
imul edx, dword [eax + ecx*8 + 0x10]
mov ebx, dword [eax + ecx*8 + 0x18]
xor eax, eax
mov dword [esp + 0x68], eax
mov dword [esp + 0x64], edx
test edx, edx
je 0x10160d3e
mov ecx, dword [esp + 0x24]
lea edi, [ebx + 0x28]
lea ecx, [ecx + ecx*2]
shl ecx, 3
add ebx, 4
mov dword [esp + 0x58], ecx
mov esi, dword [ebx]
add esi, ecx
cmp dword [esi], 0
je 0x10160d27
mov eax, dword [esi + 4]
mov ecx, dword [esp + 0x14]
cmp eax, ecx
ja 0x10160d4f
push eax
push dword [esi + 0x10]
push dword [esp + 0x18]
call sub.MSVCRT.dll_memcpy
mov eax, dword [esi]
add esp, 0xc
add dword [edi], eax
mov eax, dword [esi + 4]
add dword [esp + 0x10], eax
sub dword [esp + 0x14], eax
test ebp, ebp
je 0x10160d1b
cmp dword [ebp + 0xc], 0
je 0x10160d1b
imul ecx, dword [esp + 0x60], 0x250
mov eax, dword [ebp + 0x58]
mov edx, dword [ebp + 8]
fld qword [esi + 8]
shl edx, 5
add edx, dword [ecx + eax + 0x224]
fadd qword [edx + 0x18]
fst qword [edx + 0x18]
fcom qword [ebp]
fnstsw ax
test ah, 0x41
jne 0x10160d19
fstp qword [ebp]
jmp 0x10160d1b
fstp st(0)
mov eax, dword [esp + 0x68]
mov edx, dword [esp + 0x64]
mov ecx, dword [esp + 0x58]
inc eax
add ebx, 0x34
add edi, 0x34
mov dword [esp + 0x68], eax
cmp eax, edx
jb 0x10160ca8
mov edi, dword [esp + 0x44]
mov eax, dword [esp + 0x6c]
inc eax
add edi, 0x24
mov dword [esp + 0x44], edi
jmp 0x10160c49
cmp dword [esp + 0x80], 1
jne 0x10160740
push eax
jmp 0x10160729
mov eax, dword [esp + 0x74]
mov ecx, dword [esp + 0x10]
sub ecx, dword [esp + 0x70]
pop edi
add dword [eax], ecx
mov eax, 1
pop esi
pop ebp
pop ebx
add esp, 0x4c
ret