Function at 0x4038ee
Capabilities:
Allocate or change rwx memory
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
mov eax, dword [ebp + 8]
xor edx, edx
mov ecx, 0x1d1
push ebx
div ecx
xor edx, edx
push esi
push edi
push 0x21
pop edi
mov esi, dword [ebp + 8]
or si, 0xe3d0
mov ebx, eax
mov eax, 0x262
div dword [ebp + 0xc]
xor edx, edx
mov ecx, eax
mov eax, dword [ebp + 8]
div edi
sub ecx, eax
or cx, 0x1da
lea edi, [ecx + ebx + 0x237]
xor edi, 0x2aa
cmp bx, 0x6a
jne 0x4039a6
cmp di, 0xa
jne 0x403956
mov eax, dword [ebp + 0xc]
imul eax, eax, 0xd
or al, 0x65
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4039ee
cmp di, 0x1d
jae 0x403971
lea eax, [esi - 0x10a]
push esi
and eax, dword [ebp + 0xc]
or al, 0xc8
push eax
call dword [sym.imp.KERNEL32.dll_SetStdHandle]
jmp 0x4039ee
cmp di, 0xfc36
jne 0x4039ee
mov eax, dword [ebp + 0xc]
push 0x40
add eax, 0xffff03ca
push 0x1000
or ax, 0x254
add eax, 0x3dff6
push eax
mov eax, dword [ebp + 8]
and eax, 0x6b
sub eax, 0x4b
push eax
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [ebp - 8], eax
jmp 0x4039ee
cmp bx, 0xc
jb 0x403b97
cmp bx, 0x41
ja 0x4039be
lea edi, [esi - 0x16b]
jmp 0x4039d0
cmp bx, 0x30
jae 0x4039d0
mov bl, byte [ebp + 8]
sub bl, 0x72
and ebx, 0xd7
cmp bx, 0x26
jae 0x4039de
mov eax, dword [ebp + 0xc]
jmp 0x403bd1
cmp bx, 0x64
je 0x4039f6
cmp bx, 0x6a
jne 0x403ab3
mov ecx, dword [ebp + 8]
cmp ecx, 0x51
jne 0x4039fd
mov eax, esi
jmp 0x403bd1
mov eax, 0xc0cb
cmp ecx, eax
jne 0x403a65
mov ecx, dword [ebp + 0xc]
cmp ecx, 0x2d
jne 0x403a15
xor edi, edi
jmp 0x403ac4
cmp ecx, 0xd
ja 0x403a30
movzx eax, di
imul eax, esi
xor edx, edx
mov ecx, 0x13e
div ecx
mov ebx, eax
jmp 0x403abc
cmp ecx, 0x60
jae 0x403a3c
mov eax, ecx
jmp 0x403bd1
cmp ecx, 0x5d
jae 0x403a53
push 0
push eax
movzx eax, di
push 9
push eax
push esi
call dword [sym.imp.KERNEL32.dll_UnlockFileEx]
jmp 0x403abc
cmp ecx, 0xcada
jne 0x403abc
mov eax, 0x442f7f
mov dword [ebp - 4], eax
jmp 0x403abc
cmp ecx, 0x10
je 0x403bce
cmp ecx, 0x30
jae 0x403a84
push 0x6a
xor edx, edx
pop eax
div ecx
mov edi, eax
xor edi, 0x31a
jmp 0x403abc
cmp ecx, 0x19
jae 0x403a9d
mov eax, 0x216
xor edx, edx
div dword [ebp + 0xc]
mov esi, eax
sub esi, 0x33c
jmp 0x403abc
cmp ecx, 0x55
ja 0x403abc
mov eax, 0x3be
sub eax, dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
jmp 0x403abc
cmp bx, 0x42
jne 0x403abc
push 0x17
pop esi
mov eax, dword [ebp + 0xc]
cmp eax, 0x5e
jae 0x403ac9
add edi, 0x35
jmp 0x403b2a
cmp eax, 0x36
jne 0x403ad9
mov eax, dword [ebp + 8]
lea esi, [eax + 0x370]
jmp 0x403b2a
cmp eax, 0x47
ja 0x403b13
movzx ecx, di
movzx eax, bx
xor edx, edx
push ecx
div ecx
mov eax, dword [ebp + 0xc]
imul eax, eax, 0x3b1
imul edx, edx, 0x67
push edx
push ecx
mov ecx, esi
xor edx, edx
sub ecx, eax
mov eax, 0x205
div esi
mov eax, dword [ebp + 0xc]
push ecx
sub eax, edx
push eax
call dword [sym.imp.KERNEL32.dll_LockFile]
jmp 0x403b2a
cmp eax, 0x18
jb 0x403bce
cmp eax, 0xcada
jne 0x403b2a
add dword [ebp - 4], 0x1881
movzx eax, bx
xor edx, edx
mov ecx, 0x3b8
div dword [ebp + 8]
mov eax, edx
xor edx, edx
div ecx
mov eax, dword [ebp + 0xc]
cmp eax, 0xcada
mov ebx, edx
jne 0x403b51
mov eax, dword [ebp - 4]
mov dword [ebp + 0xc], eax
jmp 0x403b91
cmp eax, 0x2a
jb 0x403b91
cmp eax, 0x1b
jae 0x403b63
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
jmp 0x403b91
cmp eax, 0x57
jb 0x403b91
cmp eax, 0xb
jae 0x403b91
mov eax, 0x207
xor edx, edx
div esi
push dword [ebp + 8]
movzx ecx, bx
push ecx
mov eax, ecx
push dword [ebp + 8]
push edx
xor edx, edx
div ecx
add edx, 0x1f
push edx
call dword [sym.imp.KERNEL32.dll_WriteFileEx]
cmp bx, 0x2a
ja 0x403b9c
mov eax, dword [ebp + 8]
jmp 0x403bd1
cmp bx, 0x12
jb 0x403bce
cmp bx, 0x21
jae 0x403bb2
push 0
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x403bce
push 0x10
pop eax
cmp bx, ax
je 0x403bd1
cmp bx, 0x39
jbe 0x403bce
cmp bx, 0x6a
jne 0x403bce
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 8]
mov dword [ecx], eax
movzx eax, di
pop edi
pop esi
pop ebx
leave
ret