Function at 0x4af340
Capabilities:
Enumerate process modules
Get keyboard layout
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x13ec
call fcn.004b0790
push ebx
push edi
mov edi, dword [ebp + 8]
mov ebx, ecx
test edi, edi
je 0x4afc0a
cmp dword [edi], 0x3bc
jb 0x4afc0a
mov eax, dword [edi + 0xc]
test eax, eax
jne 0x4af374
mov eax, 0x4c1318
push esi
mov esi, dword [sym.imp.KERNEL32.dll_lstrcpynW]
push 0x80
push eax
lea eax, [ebp - 0xbc4]
push eax
call esi
mov eax, dword [edi + 0x10]
test eax, eax
jne 0x4af396
mov eax, 0x4c1318
push 0x80
push eax
lea ecx, [ebp - 0x2a4]
push ecx
call esi
call fcn.004ad0f0
push 0x118
lea edx, [ebp - 0x120]
push 0
push edx
mov esi, eax
mov dword [ebp - 0x124], 0x11c
call fcn.004b03e0
add esp, 0xc
lea eax, [ebp - 0x124]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
lea ecx, [ebp - 0x110]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp word [ebp + eax*2 - 0x10e], 0
lea eax, [ebp + eax*2 - 0x10e]
mov dword [ebp - 8], eax
jne 0x4af3ff
add dword [ebp - 8], 2
call dword [sym.imp.KERNEL32.dll_GetConsoleWindow]
mov edx, dword [edi + 0x44]
mov ecx, dword [edi + 0x40]
push edx
mov edx, dword [edi + 0x3c]
push ecx
mov ecx, dword [edi + 0x30]
push edx
mov edx, dword [edi + 0x20]
push eax
mov dword [ebp - 4], eax
movzx eax, word [edi + 0x34]
push eax
mov eax, dword [edi + 0x1c]
push ecx
mov ecx, dword [edi + 0x18]
push edx
mov edx, dword [edi + 0x14]
push eax
push ecx
push edx
mov edx, dword [edi + 0x1b0]
lea eax, [ebp - 0x2a4]
push eax
mov eax, dword [edi + 0x1ac]
lea ecx, [ebp - 0xbc4]
push ecx
mov ecx, dword [edi + 0x1a0]
push edx
mov edx, dword [edi + 0x1a8]
push eax
movzx eax, byte [ebp - 9]
push ecx
mov ecx, dword [ebp - 8]
push edx
mov edx, dword [edi + 0x1a4]
push eax
push ecx
push edx
lea eax, [ebp - 0x110]
push eax
push 0x59
call dword [sym.imp.USER32.dll_GetSystemMetrics]
movzx ecx, word [ebp - 0xc]
movzx edx, word [ebp - 0xe]
push eax
movzx eax, word [ebp - 0x10]
push ecx
movzx ecx, byte [ebp - 0xa]
push edx
mov edx, dword [ebp - 0x118]
push eax
mov eax, dword [ebp - 0x11c]
neg esi
push ecx
mov ecx, dword [ebp - 0x120]
sbb esi, esi
and esi, 0x20
add esi, 0x20
push esi
mov esi, dword [sym.imp.USER32.dll_wsprintfW]
push edx
push eax
push ecx
lea edx, [ebp - 0xac4]
push str.Startup_info_r_n_tOsVer:__u._u._u.x_u__Product:__u__SP:__u._u__Suite:_0x_X__SM_SERVERR2:__u_r_n_tCSDVersion:__s__ReactOS:__u___s___Rsrv:__u_r_n_tDBCS:__u__WINE:__u__ACP:__u__OEMCP:__u_r_n_tDesktop:__s_r_n_tTitle:__s_r_n_tSize:__u__u__u__u_r_n_tFlags:_0x_08X__ShowWindow:__u__ConHWnd:_0x_08X_r_n_tHandles:_0x_08X__0x_08X__0x_08X
push edx
call esi
add esp, 0x7c
push 1
push 0
push 1
lea eax, [ebp - 0xac4]
push eax
mov ecx, ebx
call fcn.004adc30
cmp dword [ebp - 4], 0
je 0x4af57c
xor ecx, ecx
push str.kernel32.dll
mov word [ebp - 0xac4], cx
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x4af546
push str.GetConsoleKeyboardLayoutNameW
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov edi, eax
test edi, edi
je 0x4af546
push 0x100
lea edx, [ebp - 0x2a4]
push 0
push edx
call fcn.004b03e0
add esp, 0xc
lea eax, [ebp - 0x2a4]
push eax
call edi
test eax, eax
je 0x4af546
lea ecx, [ebp - 0x2a4]
push ecx
lea edx, [ebp - 0xac4]
push str.Active_console_layout_name:__s
push edx
call esi
add esp, 0xc
cmp word [ebp - 0xac4], 0
jne 0x4af568
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0xac4]
push str.Active_console_layout:_Unknown__code_u
push eax
call esi
add esp, 0xc
push 1
push 0
push 0
lea ecx, [ebp - 0xac4]
push ecx
mov ecx, ebx
call fcn.004adc30
push 0x7c
lea edx, [ebp - 0x1a0]
push 0
push edx
mov dword [ebp - 0x1a4], 0
call fcn.004b03e0
add esp, 0xc
push 0
call dword [sym.imp.USER32.dll_GetKeyboardLayout]
push eax
mov dword [ebp - 0x1a4], eax
lea eax, [ebp - 0xac4]
push str.Active_HKL:_0x_08X
push eax
call esi
add esp, 0xc
push 1
push 0
push 0
lea ecx, [ebp - 0xac4]
push ecx
mov ecx, ebx
call fcn.004adc30
lea edx, [ebp - 0x1a4]
push edx
push 0x20
call dword [sym.imp.USER32.dll_GetKeyboardLayoutList]
mov edi, eax
mov dword [ebp - 4], edi
test edi, edi
je 0x4af654
cmp edi, 0x20
ja 0x4af654
lea eax, [ebp - 0xac4]
push str.GetKeyboardLayoutList:
push eax
call fcn.004af090
add esp, 8
lea ecx, [ebp - 0xac4]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
xor esi, esi
mov dword [ebp - 8], eax
test edi, edi
jbe 0x4af645
mov edx, dword [ebp + esi*4 - 0x1a4]
mov edi, dword [ebp - 8]
push edx
lea edi, [ebp + edi*2 - 0xac4]
push str._0x_08X
push edi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0xc
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add dword [ebp - 8], eax
inc esi
cmp esi, dword [ebp - 4]
jb 0x4af614
push 1
push 0
push 0
lea eax, [ebp - 0xac4]
push eax
jmp 0x4af679
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea ecx, [ebp - 0xac4]
push str.GetKeyboardLayoutList_failed__code_u
push ecx
call esi
add esp, 0xc
push 1
push 0
push 0
lea edx, [ebp - 0xac4]
push edx
mov ecx, ebx
call fcn.004adc30
push 0
push 0
push 0
push 0
push str.CmdLine:
mov ecx, ebx
call fcn.004ae810
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x18c]
test eax, eax
jne 0x4af6a6
mov eax, str._NULL_
mov dword [ebp - 8], eax
test ebx, ebx
je 0x4af750
test eax, eax
je 0x4af750
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 4], eax
lea eax, [eax + eax*2 + 0x20]
cmp eax, 0x400
jae 0x4af6d6
lea edi, [ebp - 0x13ec]
jmp 0x4af6e5
push eax
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4af750
mov ecx, dword [ebp - 8]
xor esi, esi
cmp word [ecx], si
je 0x4af713
mov eax, dword [ebp - 4]
push esi
push esi
lea edx, [eax + eax*2 + 1]
push edx
push edi
push 0xffffffffffffffff
mov eax, ecx
push eax
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, 1
jle 0x4af713
lea esi, [eax - 1]
push 2
lea ecx, [esi + edi]
push 0x4dd6fc
push ecx
call fcn.004b0bb0
add esi, 2
mov byte [esi + edi], 0
mov eax, dword [ebx + 0xc]
add esp, 0xc
test eax, eax
je 0x4af750
push 0
lea edx, [ebp - 4]
push edx
push esi
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push 0
push 0
push 0
push 0
push str.ExecMod:
mov ecx, ebx
call fcn.004ae810
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x190]
test eax, eax
jne 0x4af776
mov eax, str._NULL_
mov dword [ebp - 8], eax
test ebx, ebx
je 0x4af820
test eax, eax
je 0x4af820
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 4], eax
lea eax, [eax + eax*2 + 0x20]
cmp eax, 0x400
jae 0x4af7a6
lea edi, [ebp - 0x13ec]
jmp 0x4af7b5
push eax
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4af820
mov edx, dword [ebp - 8]
xor esi, esi
cmp word [edx], si
je 0x4af7e3
mov eax, dword [ebp - 4]
push esi
push esi
lea eax, [eax + eax*2 + 1]
push eax
push edi
push 0xffffffffffffffff
mov ecx, edx
push ecx
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, 1
jle 0x4af7e3
lea esi, [eax - 1]
push 2
lea edx, [esi + edi]
push 0x4dd6fc
push edx
call fcn.004b0bb0
add esi, 2
mov byte [esi + edi], 0
mov eax, dword [ebx + 0xc]
add esp, 0xc
test eax, eax
je 0x4af820
push 0
lea ecx, [ebp - 4]
push ecx
push esi
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebx + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push 0
push 0
push 0
push 0
push str.WorkDir:
mov ecx, ebx
call fcn.004ae810
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x194]
test eax, eax
jne 0x4af846
mov eax, str._NULL_
mov dword [ebp - 8], eax
test ebx, ebx
je 0x4af8f0
test eax, eax
je 0x4af8f0
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 4], eax
lea eax, [eax + eax*2 + 0x20]
cmp eax, 0x400
jae 0x4af876
lea edi, [ebp - 0x13ec]
jmp 0x4af885
push eax
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4af8f0
mov ecx, dword [ebp - 8]
xor esi, esi
cmp word [ecx], si
je 0x4af8b3
mov eax, dword [ebp - 4]
push esi
push esi
lea edx, [eax + eax*2 + 1]
push edx
push edi
push 0xffffffffffffffff
mov eax, ecx
push eax
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, 1
jle 0x4af8b3
lea esi, [eax - 1]
push 2
lea ecx, [esi + edi]
push 0x4dd6fc
push ecx
call fcn.004b0bb0
add esi, 2
mov byte [esi + edi], 0
mov eax, dword [ebx + 0xc]
add esp, 0xc
test eax, eax
je 0x4af8f0
push 0
lea edx, [ebp - 4]
push edx
push esi
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push 0
push 0
push 0
push 0
push str.PathEnv:
mov ecx, ebx
call fcn.004ae810
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x198]
test eax, eax
jne 0x4af916
mov eax, str._NULL_
mov dword [ebp - 8], eax
test ebx, ebx
je 0x4af9c0
test eax, eax
je 0x4af9c0
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 4], eax
lea eax, [eax + eax*2 + 0x20]
cmp eax, 0x400
jae 0x4af946
lea edi, [ebp - 0x13ec]
jmp 0x4af955
push eax
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4af9c0
mov edx, dword [ebp - 8]
xor esi, esi
cmp word [edx], si
je 0x4af983
mov eax, dword [ebp - 4]
push esi
push esi
lea eax, [eax + eax*2 + 1]
push eax
push edi
push 0xffffffffffffffff
mov ecx, edx
push ecx
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, 1
jle 0x4af983
lea esi, [eax - 1]
push 2
lea edx, [esi + edi]
push 0x4dd6fc
push edx
call fcn.004b0bb0
add esi, 2
mov byte [esi + edi], 0
mov eax, dword [ebx + 0xc]
add esp, 0xc
test eax, eax
je 0x4af9c0
push 0
lea ecx, [ebp - 4]
push ecx
push esi
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov edx, dword [ebx + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push 0
push 0
push 0
push 0
push str.ConFont:
mov ecx, ebx
call fcn.004ae810
mov eax, dword [ebp + 8]
mov eax, dword [eax + 0x3b8]
test eax, eax
jne 0x4af9e6
mov eax, str._NULL_
mov dword [ebp + 8], eax
test ebx, ebx
je 0x4afa90
test eax, eax
je 0x4afa90
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 4], eax
lea eax, [eax + eax*2 + 0x20]
cmp eax, 0x400
jae 0x4afa16
lea edi, [ebp - 0x13ec]
jmp 0x4afa25
push eax
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4afa90
mov ecx, dword [ebp + 8]
xor esi, esi
cmp word [ecx], si
je 0x4afa53
mov eax, dword [ebp - 4]
push esi
push esi
lea edx, [eax + eax*2 + 1]
push edx
push edi
push 0xffffffffffffffff
mov eax, ecx
push eax
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, 1
jle 0x4afa53
lea esi, [eax - 1]
push 2
lea ecx, [esi + edi]
push 0x4dd6fc
push ecx
call fcn.004b0bb0
add esi, 2
mov byte [esi + edi], 0
mov eax, dword [ebx + 0xc]
add esp, 0xc
test eax, eax
je 0x4afa90
push 0
lea edx, [ebp + 8]
push edx
push esi
push edi
push eax
mov dword [ebp + 8], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push 0
push 1
push 0
push 0
push str.Modules:
mov ecx, ebx
call fcn.004ae810
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push eax
push 8
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
push 0x424
lea ecx, [ebp - 0xfe8]
mov esi, eax
push 0
push ecx
mov dword [ebp + 8], esi
mov dword [ebp - 0xfec], 0x428
call fcn.004b03e0
add esp, 0xc
test esi, esi
je 0x4afc01
cmp esi, 0xffffffff
je 0x4afc01
lea edx, [ebp - 0xfec]
push edx
push esi
call sub.KERNEL32.dll_Module32FirstW
test eax, eax
je 0x4afbfa
lea ecx, [ecx]
mov eax, dword [ebp - 0xfd4]
test eax, eax
je 0x4afb0f
lea ecx, [eax - 1]
jmp 0x4afb11
xor ecx, ecx
lea edx, [ebp - 0xdcc]
push edx
push eax
mov eax, dword [ebp - 0xfd8]
add ecx, eax
push ecx
push eax
lea eax, [ebp - 0xac4]
push str.___08X__08X__8X__s
push eax
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
test ebx, ebx
je 0x4afbe5
lea ecx, [ebp - 0xac4]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov dword [ebp - 4], eax
lea eax, [eax + eax*2 + 0x20]
cmp eax, 0x400
jae 0x4afb63
lea edi, [ebp - 0x13ec]
jmp 0x4afb72
push eax
call fcn.004412a0
mov edi, eax
add esp, 4
test edi, edi
je 0x4afbe2
xor esi, esi
cmp word [ebp - 0xac4], si
je 0x4afba5
mov eax, dword [ebp - 4]
push esi
push esi
lea edx, [eax + eax*2 + 1]
push edx
push edi
push 0xffffffffffffffff
lea eax, [ebp - 0xac4]
push eax
push esi
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
cmp eax, 1
jle 0x4afba5
lea esi, [eax - 1]
push 2
lea ecx, [esi + edi]
push 0x4dd6fc
push ecx
call fcn.004b0bb0
add esi, 2
mov byte [esi + edi], 0
mov eax, dword [ebx + 0xc]
add esp, 0xc
test eax, eax
je 0x4afbe2
push 0
lea edx, [ebp - 4]
push edx
push esi
push edi
push eax
mov dword [ebp - 4], esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebx + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov esi, dword [ebp + 8]
lea ecx, [ebp - 0xfec]
push ecx
push esi
call sub.KERNEL32.dll_Module32NextW
test eax, eax
jne 0x4afb00
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop esi
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 4
push 1
push 0
push 1
push str.LogStartEnv_failed__invalid_apStartEnv
call fcn.004adc30
pop edi
pop ebx
mov esp, ebp
pop ebp
ret 4